Show Viewing as on Roles as a select, also with one agent

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Fable 5.1 committed 2026-09-29 16:40:33 +02:00
1 parent 6124b00062
commit 4b722744a7
5 files changed
+9 -16

No files matched your search

-6
View File
@@ -617,12 +617,6 @@ kbd {
min-height: 2.6rem; padding: .2rem .5rem;
border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
}
/* One agent is not a choice, so it is its name, not a select of one. */
#rail p.agent-pick {
padding: .45rem .6rem; line-height: 1.35; overflow-wrap: anywhere;
background: color-mix(in srgb, var(--accent) 10%, transparent);
box-shadow: inset 3px 0 0 var(--accent); border-radius: 3px;
}
.rail-viewing .rail-note { margin-top: 0; }
/* A link in a heading ("agents", "clear") is a word, not a second heading. */
#rail h3 .linky { text-transform: none; letter-spacing: 0; font-weight: 400; }
+3 -6
View File
@@ -410,16 +410,15 @@
$("#rail-toggle").setAttribute("aria-expanded", String(state.railOpen));
}
/* Viewing as: a select with two or more agents, the name with one, and
/* Viewing as: a select of the enabled agents, also when there is one, and
with none a sentence and the way to make one. Nothing until the agents
are in, so a page with agents never says it has none. */
function renderAgent() {
const agents = state.agents;
const select = $("#agent");
select.hidden = agents.length < 2;
$("#agent-one").hidden = agents.length !== 1;
select.hidden = !agents.length;
$("#agent-none").hidden = !state.agentsLoaded || agents.length > 0;
if (agents.length > 1) {
if (agents.length) {
// Rebuilt only when the agents changed, since the rail is drawn again on
// every filter and a rebuild shuts a select that is open.
const key = agents.map((a) => `${a.id}:${a.name}`).join("\n");
@@ -430,8 +429,6 @@
select.value = String(state.filter.agent);
// A long name is cut at the rail's edge; the whole of it is a hover away.
select.title = select.selectedOptions[0]?.text || "";
} else if (agents.length === 1) {
$("#agent-one").textContent = agents[0].name;
} else if (state.agentsLoaded) {
$("#agent-none").innerHTML = `No search agent is enabled, so nothing is ranked.
<a href="/settings/agents">Search agents</a> sets one up.`;
+3 -3
View File
@@ -40,11 +40,11 @@
<div class="shell">
<aside id="rail" aria-label="Filters">
<section class="rail-viewing" aria-labelledby="viewing-as">
{# One agent is its name, two or more a select, none a sentence with
the way to make one. The script shows whichever applies. #}
{# A select of the enabled agents, also when there is one, so the place
to switch agent is always the same; none is a sentence with the way
to make one. The script shows whichever applies. #}
<h3 id="viewing-as">Viewing as <a class="linky" href="/settings/agents">agents</a></h3>
<select id="agent" class="rail-select agent-pick" aria-labelledby="viewing-as" hidden></select>
<p id="agent-one" class="agent-pick" hidden></p>
<p id="agent-none" class="rail-note" hidden></p>
</section>
<section>
+2
View File
@@ -160,6 +160,8 @@ What was decided for roledesk and the one reason for each. The longer reasoning
**Search agents are back in the UI as a list.** One person may run several: their own hunt, and one that monitors roles for someone else, each with its own intent and gates. The list has New and Delete; a delete takes the agent's votes, liked companies and scores with it.
**Viewing as on Roles is a select, also with one agent.** One enabled agent used to show as its name, since one is not a choice, but the owner looked for the select to switch agent and found it gone after the second agent was switched off. The select lists the enabled agents; an agent that is off has no fresh scores and is left out.
**Settings pages sit beside a rail, and Sources shows one section at a time, chosen by the URL fragment.** The company boards list runs to 50 or 60 companies, so Runs at the end of a stacked page was out of reach and jump links still meant scrolling back up. The rail (`settings/_rail.html`, from `SETTINGS` and `SECTIONS` in `app/web/pages.py`) is sticky beside the content, and a strip under the header below 60rem. The fragment rather than a path per section, because a hidden section stays in the DOM, so each section's script runs unchanged.
**Runs is the queue's own elements plus a Problems log.** `<desk-jobs>` and `<desk-schedules>` draw what is running and when the pull runs next, the app adds only "Run the pull now", disabled while a pull cascade is live, and the message log is the section's last block rather than a section of its own; `#messages` still lands on it. "Run one stage" went because the cascade is the unit of work: a stage run alone is a partial pull whose result the next stage never sees. `app job <stage>` and `POST /api/jobs` keep the per-stage entry points, which is what "Save and score" uses.
+1 -1
View File
@@ -57,7 +57,7 @@ def test_the_roles_page_is_the_rail_the_feed_and_a_shut_reader(client: TestClien
def test_the_rail_opens_on_viewing_as_then_filters_then_order(client: TestClient) -> None:
rail = client.get("/").text.split('<aside id="rail"', 1)[1].split("</aside>", 1)[0]
for part in ('id="agent"', 'id="agent-one"', 'id="agent-none"', 'href="/settings/agents"'):
for part in ('id="agent"', 'id="agent-none"', 'href="/settings/agents"'):
assert part in rail, part
headings = [rail.index(h) for h in ("Viewing as", "<h3>Filters</h3>", "<h3>Order</h3>",
"<h3>Tags")]