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

+34
View File
@@ -8,6 +8,9 @@
* `api()` from app.js, so a refusal (a query that finds nothing) is one
* toast with the server's own sentence. The catch blocks here only put a
* control back.
*
* It is also the page's first script, so it shows the one section of the
* four the URL fragment names and marks it in the settings rail.
*/
(function () {
"use strict";
@@ -202,6 +205,37 @@
}
}
// ------------------------------------------------------ one section shown
// Sources shows one section: the one the fragment names, or the first when
// there is none or it names none, so `/settings/sources#runs` (a rail link,
// an old path's 301, the Search agents page's "follow it under Runs") opens
// Runs. The rest are hidden, not removed, so their scripts still find their
// roots. It runs as the script loads rather than on DOMContentLoaded, so the
// page never paints all four first.
function showSection() {
const sections = [...document.querySelectorAll("section[data-section]")];
if (!sections.length) return;
const want = decodeURIComponent(location.hash.slice(1));
const shown = sections.find((s) => s.id === want) || sections[0];
for (const section of sections) section.hidden = section !== shown;
for (const link of document.querySelectorAll(".settings-rail a[data-section]")) {
if (link.dataset.section === shown.id) {
link.setAttribute("aria-current", "location");
link.scrollIntoView({ block: "nearest", inline: "nearest" });
} else {
link.removeAttribute("aria-current");
}
}
}
showSection();
// A switch starts the section at the top of the page, as opening it would.
window.addEventListener("hashchange", () => {
showSection();
window.scrollTo(0, 0);
});
// -------------------------------------------------------------------- init
document.addEventListener("DOMContentLoaded", async () => {