Viewing as leads the Roles rail; settings get a rail, agent cards, one Sources section at a time

A search agent is a persona, and every like or pass belongs to the one
being viewed. The rail now opens on Viewing as: a full-width chooser,
the name alone with one agent, a note with none, remembered in the URL
and localStorage. The vote buttons, the reader's affinity control, the
feed, the tag counts and the reader fetch all carry that agent; before,
votes sent none and every one landed on the default agent. Best first
and Newest first are back as the segmented control under Order,
independent of the agent. The rail selects no longer clip descenders:
Chrome ignores line-height on a select, so the fixed box is gone in
favour of padding and a min-height.

Settings render inside a sticky rail (Search agents; Sources with Job
boards, Company boards, Runs, Messages; Account), a strip under the
header on a phone, so Runs is one click away however long the company
list gets. Sources shows one section at a time, chosen by the fragment,
so the old redirects still land. Search agents are cards, newest first:
name, an On/Off switch with its word, the intent in full, the weights,
Edit in place, New agent on top, and a link to Roles as that agent.
Switching one on rescores it.

replace_scores writes nothing for an agent deleted while score was
running, instead of failing the run on the foreign key.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Fable 5.1 committed 2026-09-28 15:05:55 +02:00
1 parent 063771d617
commit c4f2bcc0c9
20 files changed
+836 -326

No files matched your search

+26 -10
View File
@@ -1,10 +1,12 @@
"""The pages: two tabs, a cog, and three settings pages behind it.
`TABS` is the top bar, Roles and Applications, and `SETTINGS` is the row of
sub-tabs under the cog at `/settings/<name>`: Search agents, Sources, Account.
`base.html` renders the first, `settings/_tabs.html` the second, every page
marks itself active by its own `path`, and adding one is one entry here plus
one template. `/settings` itself is Search agents.
`TABS` is the top bar, Roles and Applications, and `SETTINGS` is the rail
beside every page under the cog at `/settings/<name>`: Search agents,
Sources, Account. `base.html` renders the first, `settings/_rail.html` the
second, every page marks itself active by its own `path`, and adding one is
one entry here plus one template. `SECTIONS` is the rows the rail indents
under a page that is shown one section at a time, which is only Sources.
`/settings` itself is Search agents.
Every page is a shell. Each is filled and driven by its own script under
`static/` from the JSON routes in `web/api.py`; the Runs section of Sources
@@ -14,10 +16,11 @@ one page, so a link to a role and the role opened from the feed are the same
screen. What the server renders is only what a select needs to offer, so the
options cannot drift from what the store accepts.
Sources is one page in three sections, one per plugin: job boards (the
`search` plugin's queries), company boards (`ats`) and the runs that read
them, with the message log at the end. Its scripts are the ones the sections
had as pages of their own, each guarding on its own root element.
Sources is one page in four sections: job boards (the `search` plugin's
queries), company boards (`ats`), the runs that read them, and the message
log. One is shown at a time, the one the URL fragment names; the others stay
in the page, hidden, so each section's script (the ones they had as pages of
their own, each guarding on its own root element) keeps working.
Every path a page has had before (`/agents`, `/companies`, `/sources`,
`/jobs`, `/schedules`, `/messages`, `/account`, and the six sub-tabs the
@@ -70,13 +73,25 @@ TABS: tuple[Tab, ...] = (
Tab("/applications", "Applications", "applications.html"),
)
#: The sub-tabs under the cog, in order; `settings/_tabs.html` renders them.
#: The pages under the cog, in order; `settings/_rail.html` renders them.
SETTINGS: tuple[Tab, ...] = (
Tab("/settings/agents", "Search agents", "settings/agents.html"),
Tab("/settings/sources", "Sources", "settings/sources.html"),
Tab("/settings/account", "Account", "settings/account.html"),
)
#: `anchor, label` for each section of a settings page that shows one at a
#: time, keyed by the page's path. The anchor is the section's element id and
#: the fragment that picks it; the first is what the page opens on without one.
SECTIONS: dict[str, tuple[tuple[str, str], ...]] = {
"/settings/sources": (
("job-boards", "Job boards"),
("company-boards", "Company boards"),
("runs", "Runs"),
("messages", "Messages"),
),
}
#: Where each page that used to be a tab or a sub-tab lives now. The fragment
#: is the section on the merged page; a browser keeps it across the 301.
MOVED: dict[str, str] = {
@@ -117,6 +132,7 @@ def asset(path: str) -> str:
templates = Jinja2Templates(directory=str(TEMPLATE_DIR))
templates.env.globals["TABS"] = TABS
templates.env.globals["SETTINGS"] = SETTINGS
templates.env.globals["SECTIONS"] = SECTIONS
templates.env.globals["asset"] = asset
#: Out of the OpenAPI schema: these are pages.