Roles as a feed, a read page, votes that move the rank, unstar

The Roles tab is news's feed row: the title opens /roles/{uid}, company,
place and age under it, the badges, a one-line excerpt (summary, else the
description's opening), and ▲ ● ▼ ★ on the right, under the text at 640px.
The company affinity control leaves the row. A passed role and a hidden
company's are dimmed and stay. The filter bar is one row: order, search and
a Filters <details> holding the rest, with a judged select and "Show hidden
companies". The list loads 60 and appends on an IntersectionObserver
sentinel; back from a read page restores the filters, rows and scroll.

GET /api/roles takes offset, defaults to 60 and answers {items, total}.
judged= is a WHERE on roles.vote. Under a ranking the served score and the
order are the stored score moved by the vote (x0.5 pass, x1.2 like, capped
at 1), so a vote shows at once without a rescore. POST and DELETE
/api/roles/{uid}/vote set and clear it; pressing the pressed stance clears.

★ saves; pressed again it calls DELETE /api/applications/{id}, which drops
the application while it is still saved and answers 409 after. save_role no
longer writes the placeholder next step.

The read page (role.html, role.js) is news's reader: a bar with back,
▲ ● ▼ ★ and ↗, the company with its affinity control, place, badges, salary,
summary, the text (fetched posting, else description) and the link out.
It offers Fetch the posting for a teaser and Summarise without a summary,
against the /text and /summarise routes B4 adds. The vote and star buttons
are judge.js, shared by the feed and the reader.

Applications: titles open the read page, the Next column is gone, a Saved
column instead, and the lede says what the page is for.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Fable 5.1 committed 2026-09-25 21:51:48 +02:00
1 parent 7d31cca394
commit 09c5dde113
13 files changed
+1216 -192

No files matched your search

+185 -28
View File
@@ -311,38 +311,204 @@ textarea:focus-visible {
.count { color: var(--dim); font-size: .85rem; margin: .75rem 0 .5rem; }
/* roles */
/* == roles, the read page, applications ================================== */
/* The feed row and the reader are news's (`newsdesk/web/static/app.css`):
* the row a grid with a bottom rule and no card, the actions on the right
* dropping under the text at 640px, a cast vote filled rather than tinted.
* Drawn by static/roles.js, static/role.js and static/judge.js; the phone
* and touch rules for all of it are at the end of this section rather than
* in the phone section below, so the section is one piece. */
.roles { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
/* The filter bar: the order, the search box, and Filters on one row at any
width. Filters is a `<details>` whose summary is lifted into that row, so
the panel it opens sits in the flow under the row and pushes the list
down instead of covering it. */
.roles-filters { display: block; position: relative; }
.filter-line { display: flex; gap: .5rem; align-items: center; margin-right: 6.75rem; }
.filter-line select { flex: 0 1 auto; max-width: 45%; }
.filter-line input[type="search"] { flex: 1 1 8rem; }
.filter-more > summary {
position: absolute; top: .75rem; right: .75rem;
display: flex; align-items: center; justify-content: center; min-width: 6rem;
padding: .4rem .6rem; line-height: 1.2;
border: 1px solid var(--line); border-radius: .3rem;
color: var(--fg); background: var(--bg); cursor: pointer;
list-style: none; white-space: nowrap;
}
.filter-more > summary::-webkit-details-marker { display: none; }
.filter-more[open] > summary { border-color: var(--accent); color: var(--accent); }
.filter-active { margin-left: .3rem; color: var(--accent); font-weight: 600; }
.filter-panel {
display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
margin-top: .75rem; padding-top: .75rem; border-top: 1px solid var(--line);
}
.filter-panel select { flex: 1 1 9rem; }
/* The feed. */
.roles {
list-style: none; margin: 0; padding: 0;
background: var(--panel);
border: 1px solid var(--line); border-radius: var(--radius);
}
.roles:empty { display: none; }
.roles-end { height: 1px; }
.role {
background: var(--panel); border: 1px solid var(--line); border-radius: .5rem;
padding: .6rem .8rem;
display: flex; flex-direction: column; gap: .35rem;
display: grid; grid-template-columns: minmax(0, 1fr) auto;
align-items: start; gap: .85rem;
padding: .8rem 1rem .85rem;
border-bottom: 1px solid var(--line);
}
.role:last-child { border-bottom: 0; }
.role-body { min-width: 0; }
.role-title {
display: block; max-width: 60ch;
color: var(--fg); text-decoration: none;
font-size: 1.05rem; font-weight: 600; line-height: 1.35;
overflow-wrap: anywhere;
}
.role-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; }
.role-title { font-weight: 600; text-decoration: none; }
@media (hover: hover) {
.role-title:hover { text-decoration: underline; }
.role-title:hover { text-decoration: underline; text-underline-offset: 2px; }
}
.role-company { color: var(--dim); }
.role-meta {
display: flex; flex-wrap: wrap; align-items: center; gap: .5rem;
color: var(--dim); font-size: .85rem;
.role-meta, .reader-meta {
display: flex; flex-wrap: wrap; gap: .1rem .55rem; align-items: baseline;
margin-top: .25rem; font-size: .85rem; color: var(--dim);
}
.role-meta .badge {
/* The company is how you decide whether to read on: weight and full ink. */
.role-meta b, .reader-meta b { font-weight: 600; color: var(--fg); }
.role-meta > :empty, .reader-meta > :empty { display: none; }
.role-meta > * + *::before { content: "· "; }
.role-badges { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .35rem; }
.role-badges > :empty { display: none; }
.role-badges:not(:has(> :not(:empty))) { display: none; }
.role-badges .badge {
background: transparent; color: var(--dim);
border: 1px solid var(--line); border-radius: 1rem;
padding: .05rem .55rem; font-size: .78rem;
}
.role-meta .badge:empty { display: none; }
.role-meta .role-score {
.role-badges .role-score {
color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
font-variant-numeric: tabular-nums;
}
.role-gated { color: var(--error); font-size: .85rem; }
.role-age { margin-left: auto; }
.role.muted, tr.muted { opacity: .55; }
.role.gated { opacity: .7; }
.role-gated { color: var(--error); font-size: .8rem; }
.role-excerpt {
margin: .35rem 0 0; max-width: 68ch;
font-size: .9rem; color: var(--dim);
white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.role-excerpt:empty { display: none; }
/* A pass and a hidden company are dimmed and stay: a stray tap has to be
visible to be undone. The buttons keep full contrast, so the undo does. */
.role.muted .role-body, .role.passed .role-body { opacity: .55; }
.role.gated .role-body { opacity: .7; }
/* The Companies table dims a hidden company's row the same way. */
tr.muted { opacity: .55; }
/* ▲ ● ▼ ★, on a row and in the reader's bar (static/judge.js). */
.judge { display: flex; gap: .15rem; align-items: center; }
.judge button {
padding: .2rem .45rem; font-size: 1rem; line-height: 1;
color: var(--dim); background: none;
border: 1px solid transparent; border-radius: .3rem;
}
@media (hover: hover) {
.judge button:hover { color: var(--fg); border-color: var(--line); }
}
/* Filled when cast: a reversed glyph on solid ground reads at arm's length
where a tint does not. `--panel` for the glyph because it is the opposite
end of the scale from every fill in both schemes. */
.judge .up[aria-pressed="true"] {
color: var(--panel); background: var(--accent); border-color: var(--accent);
}
.judge .down[aria-pressed="true"] {
color: var(--panel); background: var(--error); border-color: var(--error);
}
/* Neither way is an answer and must be as loud as the other two, or it
cannot be told from unjudged; grey, since it is no direction. */
.judge .mid[aria-pressed="true"] {
color: var(--panel); background: var(--dim); border-color: var(--dim);
}
/* Saved is a different question from judging: amber, and set apart. */
.judge .star[aria-pressed="true"] {
color: var(--panel); background: var(--warn); border-color: var(--warn);
}
.judge .star { margin-left: .35rem; }
/* The read page. */
.reader {
background: var(--panel);
border: 1px solid var(--line); border-radius: var(--radius);
}
.reader-bar {
position: sticky; top: var(--header-h, 0px); z-index: 4;
display: flex; align-items: center; gap: .2rem;
padding: .35rem .6rem;
background: var(--panel);
border-bottom: 1px solid var(--line);
border-radius: var(--radius) var(--radius) 0 0;
}
.reader-bar .spacer { flex: 1; }
.reader-back, .reader-external {
display: inline-flex; align-items: center; justify-content: center;
padding: .2rem .55rem; font-size: 1rem; line-height: 1;
color: var(--dim); text-decoration: none;
border: 1px solid var(--line); border-radius: .3rem;
}
.reader-back { margin-right: .4rem; }
@media (hover: hover) {
.reader-back:hover, .reader-external:hover { color: var(--fg); border-color: var(--dim); }
}
.reader-body { padding: 1.4rem 2rem 2.5rem; overflow-wrap: anywhere; }
/* About 70 characters a line at the reading size. */
.reader-body > * { max-width: 40rem; margin-inline: auto; }
.reader-meta { align-items: center; margin-top: 0; }
.reader-meta .affinity { font-size: .85rem; }
.reader h1 { font-size: 1.6rem; line-height: 1.25; margin: .6rem auto .5rem; }
.reader .role-badges { margin-top: 0; }
.reader-salary { margin: .6rem auto 0; font-weight: 600; }
.reader-summary {
margin-top: 1.1rem; padding: .7rem .9rem;
background: color-mix(in srgb, var(--accent) 7%, var(--panel));
border-left: 3px solid var(--accent); border-radius: .3rem;
}
.reader-summary p { margin: 0; }
/* A label over a block rather than the posting's own heading. */
.reader-label {
margin: 0 0 .3rem; font-size: .72rem; font-weight: 600;
letter-spacing: .08em; text-transform: uppercase; color: var(--dim);
}
.reader-tools { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: 1rem; }
.reader-tools:not(:has(> :not([hidden], :empty))) { display: none; }
.prose { margin-top: 1.2rem; font-size: 1.02rem; line-height: 1.7; }
.prose p { margin: 0 0 1rem; }
.reader-out { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
/* Applications: the table is the shared `table.list`. */
table.applications td[data-label="Saved"] { white-space: nowrap; color: var(--dim); }
@media (max-width: 640px) {
.filter-line { margin-right: 6.25rem; }
.filter-more > summary { right: 10px; min-width: 5.5rem; }
/* Edge to edge, like every panel on a phone. */
.roles, .reader { margin-inline: -10px; border-radius: 0; border-inline: 0; }
.reader { margin-top: -10px; border-top: 0; }
.reader-bar { border-radius: 0; }
.role { grid-template-columns: minmax(0, 1fr); gap: .45rem; padding: .75rem 10px; }
/* Under the text and to the right, where a thumb is. Two filled blocks
side by side need a gap or they read as one control. */
.role-actions { justify-content: flex-end; gap: .4rem; }
.role-actions button { padding: .25rem .75rem; min-height: 32px; font-size: 1.2rem; }
.reader-body { padding: .9rem .75rem 1.5rem; }
.reader h1 { font-size: 1.3rem; }
}
@media (pointer: coarse) {
.filter-more > summary { min-height: 2.75rem; }
.judge button { padding: .5rem .7rem; font-size: 1.15rem; }
.reader-bar { padding: .3rem .5rem; }
.reader-back, .reader-external { min-height: 2.75rem; min-width: 2.75rem; }
}
/* == end of roles, the read page, applications ============================ */
.affinity { display: inline-flex; gap: .15rem; }
.role-main .affinity { margin-left: auto; }
@@ -357,11 +523,6 @@ textarea:focus-visible {
background: var(--error); border-color: var(--error);
}
.save { align-self: flex-start; padding: .3rem .8rem; font-weight: 600; }
.save[disabled] {
background: var(--bg); color: var(--dim); border-color: var(--line); cursor: default;
}
/* agents */
.agents { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
@@ -437,10 +598,6 @@ table.list select { padding: .25rem .4rem; }
}
}
@media (max-width: 480px) {
.role-age, .role-main .affinity { margin-left: 0; }
}
/* -- the phone ------------------------------------------------------------ */
/* Two axes, and deliberately not the same one, as in newsdesk: width decides
the layout, pointer decides the sizes. A tablet is wide and touched, a