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

+8 -7
View File
@@ -1,12 +1,13 @@
{# The frame every page is in. The top bar is `TABS` from app/web/pages.py
plus the cog, and the cog's sub-tabs are `SETTINGS` there: adding a page is
one entry in one of those lists, never a link here.
plus the cog, and the cog's pages are `SETTINGS` there, in the rail
settings/_rail.html draws: adding a page is one entry in one of those
lists, never a link here.
Three blocks let a page go past the default frame, which only the Roles
page does: `body_attrs` for attributes on `<body>`, `header_tools` for
controls between the brand and the tabs (its burger and search box), and
`page` to replace the centred `<main>` with a layout of its own (its rail,
feed and reader). A page setting `active_path` lights the tab for that path
Three blocks let a page go past the default frame: `body_attrs` for
attributes on `<body>`, `header_tools` for controls between the brand and
the tabs (the Roles page's burger and search box), and `page` to replace
the centred `<main>` with a layout of its own (the Roles page's rail, feed
and reader, and the settings rail in settings/_layout.html). A page setting `active_path` lights the tab for that path
rather than its own, which is how `/roles/{uid}` keeps Roles lit. #}
<!doctype html>
<html lang="en">
+17 -4
View File
@@ -8,6 +8,12 @@
renders only the select options, from `app.models` and
`plugins.ats.FUNCTIONS`, so they cannot drift from what the store accepts.
The rail opens on Viewing as: which search agent the feed is seen as.
An agent is a persona (a candidate, a hiring manager watching the market)
with its own scores, votes and hidden companies, so the order, the stance
on each row and every vote cast belong to the agent picked here. Order is
its own section below, the same two choices whichever agent is picked.
`/roles/{uid}` renders this same page with `role` set: the reader starts
open, so a phone lands on the role rather than on the list for as long as
the script takes. No `data-rail` on `<body>` until the script sets one:
@@ -33,6 +39,14 @@
<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. #}
<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>
<h3>Filters</h3>
<button type="button" class="rail-row" id="show-read" aria-pressed="true"
@@ -40,11 +54,10 @@
class="count" aria-hidden="true">👁</span></button>
</section>
<section>
<h3>Order and period</h3>
{# Best first and Newest first. With more than one ranking enabled the
segmented control gives way to the select, one entry per ranking. #}
<h3>Order</h3>
{# Best first is the viewing agent's score, Newest first is first seen;
both carry that agent's votes. #}
<div class="seg" id="sort" role="group" aria-label="Order"></div>
<select id="agent" class="rail-select" aria-label="Order" hidden></select>
<label class="rail-field" for="period">First seen</label>
<select id="period" class="rail-select"></select>
</section>
+13
View File
@@ -0,0 +1,13 @@
{% extends "base.html" %}
{# Every page under the cog: the settings rail beside the page's own content,
through base.html's `page` block, as the Roles page puts its rail beside
the feed. A settings page extends this and fills `content`. #}
{% block page %}
<div class="settings-shell">
{% include "settings/_rail.html" %}
<main>
{% block content %}{% endblock %}
</main>
</div>
{% endblock %}
+43
View File
@@ -0,0 +1,43 @@
{# The rail beside every settings page: `SETTINGS` from app/web/pages.py, each
page current by its own path, and under a page in `SECTIONS` its sections,
indented. Links, not buttons: a page is a page of its own and a section is
a fragment on it, so `/settings/sources#runs` opens Runs from anywhere.
Which section is current is the page script's to mark (sources.js), since
the server never sees the fragment.
The Roles rail's look without its overlay or its toggle: it is five links,
not a panel of filters. Below 60rem the same links are a strip across the
top of the content, pinned under the header, so a phone can still jump
between sections without scrolling back up. #}
<aside class="settings-rail" aria-label="Settings">
<h3>Settings</h3>
<nav>
{% for tab in SETTINGS %}
{% set current = request.url.path == tab.path %}
{% set sections = SECTIONS.get(tab.path, ()) %}
<div class="rail-group"{% if current %} data-current="true"{% endif %}>
<a class="rail-link{% if sections %} parent{% endif %}" href="{{ tab.path }}"
{% if current %}aria-current="page"{% endif %}>{{ tab.label }}</a>
{% for anchor, label in sections %}
<a class="rail-link sub" href="{{ tab.path }}#{{ anchor }}" data-section="{{ anchor }}">{{ label }}</a>
{% endfor %}
</div>
{% endfor %}
</nav>
</aside>
{# The header's height, for the rail pinned under it: 44px touch targets make
the header taller, and a rail pinned to a stale number slides under it.
roles.js measures the same on the Roles page. On a phone the current page
is scrolled into the strip, which a long label can push off its edge. #}
<script>
(function () {
"use strict";
const header = document.querySelector("header.top");
const measure = () =>
document.documentElement.style.setProperty("--chrome", `${header.offsetHeight}px`);
measure();
window.addEventListener("resize", measure);
const here = document.querySelector(".settings-rail a[aria-current=page]");
if (here) here.scrollIntoView({ block: "nearest", inline: "nearest" });
})();
</script>
-8
View File
@@ -1,8 +0,0 @@
{# The sub-tabs under the cog: `SETTINGS` from app/web/pages.py, each active by
its own path. Links, not a script: every sub-tab is a page of its own. #}
<nav class="subtabs" aria-label="Settings">
{% for tab in SETTINGS %}
<a href="{{ tab.path }}"
{% if request.url.path == tab.path %}class="active" aria-current="page"{% endif %}>{{ tab.label }}</a>
{% endfor %}
</nav>
+2 -4
View File
@@ -1,10 +1,8 @@
{% extends "base.html" %}
{% extends "settings/_layout.html" %}
{% block title %}Account — roledesk{% endblock %}
{% block content %}
<h1>Settings</h1>
{% include "settings/_tabs.html" %}
<h1>Account</h1>
<p class="lede">The one password, the devices signed in with it, and the passkeys that sign in without it.</p>
<section class="card">
+18 -16
View File
@@ -1,23 +1,24 @@
{% extends "base.html" %}
{% extends "settings/_layout.html" %}
{% block title %}Search agents — roledesk{% endblock %}
{# A list and a form: `static/agents.js` fills the list from `/api/agents`,
the form edits the picked agent, New clears it, Delete removes it with its
votes, liked companies and scores. #}
{# A card per agent: `static/agents.js` fills the list from `/api/agents`,
newest first. A card shows what the agent looks for, its switch and its
weights; Edit turns that card into the form below, in place, and New puts
a blank one on top. The form is a `<template>` because only one card edits
at a time, so its ids stay unique. #}
{% block content %}
<h1>Settings</h1>
{% include "settings/_tabs.html" %}
<h1>Search agents</h1>
<p class="lede">A search agent is what the Roles tab ranks by: describe the role, weigh the terms, and it scores every open role. Several agents rank the same roles differently, each with its own votes and liked companies; Viewing as on Roles picks one, and its votes are that agent's.</p>
<p class="lede">A search agent is what the Roles tab ranks by: describe the role, weigh the terms, and it scores every open role. Several agents rank the same roles differently, each with its own votes and liked companies; the order menu on Roles picks one.</p>
<p id="agents-count" class="count" role="status"></p>
<div id="agents-list" class="crows"></div>
<div class="agents-head">
<p id="agents-count" class="count" role="status"></p>
<button type="button" id="a-new">New agent</button>
</div>
<div id="agents-list" class="agent-cards"></div>
<template id="agent-form-template">
<form id="agent-form" class="agent-form" autocomplete="off">
<div class="row-between">
<h2 id="agent-form-title">New agent</h2>
<button type="button" id="a-new" class="secondary">New agent</button>
</div>
<h2 id="agent-form-title">New agent</h2>
<label>Name <input type="text" id="a-name" required placeholder="My search"></label>
<label>What you are looking for
<textarea id="a-intent" rows="7" placeholder="Senior backend engineer. Python and Go services, PostgreSQL, APIs on Kubernetes. Wants ownership of production systems in a product company."></textarea>
@@ -37,10 +38,11 @@
</details>
<div class="agent-actions">
<button type="submit">Save and score</button>
<button type="button" id="a-delete" class="secondary" hidden>Delete</button>
<button type="button" id="a-cancel" class="secondary">Cancel</button>
<button type="button" id="a-delete" class="secondary">Delete</button>
</div>
<p id="agent-status" class="count" role="status"></p>
</form>
</template>
{% endblock %}
{% block scripts %}
+18 -20
View File
@@ -1,24 +1,19 @@
{% extends "base.html" %}
{% extends "settings/_layout.html" %}
{% block title %}Sources — roledesk{% endblock %}
{# One page, three sections, one per plugin: the `search` plugin's job board
queries, the `ats` plugin's company boards, and the runs that read both,
with the message log at the end. Each section keeps the element ids it had
as a page of its own, so its script (sources.js, companies.js, jobs.js,
messages.js) is unchanged and finds its root or does nothing. #}
{# One page, four sections: the `search` plugin's job board queries, the
`ats` plugin's company boards, the runs that read both, and the message
log. One is shown at a time, the one the URL fragment names (`#runs`), or
Job boards without one; sources.js hides the rest and the rail picks one.
Hidden rather than separate pages, because each section keeps the element
ids it had as a page of its own and its script (sources.js, companies.js,
jobs.js, messages.js) is unchanged: it finds its root or does nothing. The
ids are `SECTIONS` in app/web/pages.py, which the rail links to. #}
{% block content %}
<h1>Settings</h1>
{% include "settings/_tabs.html" %}
<h1>Sources</h1>
<p class="lede">Sources are where roles come from: queries on job boards that span companies, and the boards of the companies you follow. Each section is one plugin; the runs read them all.</p>
<nav class="jump" aria-label="Sections">
<a href="#job-boards">Job boards</a>
<a href="#company-boards">Company boards</a>
<a href="#runs">Runs</a>
</nav>
<section class="card" id="job-boards">
<section class="card" id="job-boards" data-section>
<h2>Job boards</h2>
<p class="lede">A query on Jobindex or Adzuna finds roles at any company. Switching one off closes its roles until you switch it back on.</p>
@@ -64,7 +59,7 @@
<div id="searches-list" class="srows"></div>
</section>
<section class="card" id="company-boards">
<section class="card" id="company-boards" data-section>
<h2>Company boards</h2>
<p class="lede">Every company roledesk has seen, and how many of its roles are open. Switching a board off stops reading it and closes its roles; hiding a company keeps reading it but leaves its roles out of the list and unscored, and favourite or like lifts one instead, in Best match.</p>
@@ -126,7 +121,7 @@
</details>
</section>
<section class="card" id="runs">
<section class="card" id="runs" data-section>
<div class="row-between">
<h2>Runs</h2>
<button type="button" id="pull-now" class="secondary">Pull now</button>
@@ -159,8 +154,11 @@
</div>
</details>
<div class="row-between" id="messages">
<h3>Messages</h3>
</section>
<section class="card" id="messages" data-section>
<div class="row-between">
<h2>Messages</h2>
<button type="button" id="clear-all" class="secondary">Clear all</button>
</div>
<p class="lede">What the server said that nobody has cleared, newest first. A message goes when you clear it, or a fortnight after it was last said.</p>