Roles is newsdesk's feed: rail, feed and reader, with read state and tags

The Roles tab takes newsdesk's shell, ported from its index.html and
app.css rather than rewritten: a filter rail (Show read, Best first or
Newest first, first seen, tag chips with counts, the old filters behind a
disclosure), the feed in newsdesk's row layout (score gutter, title,
company, place, badges, age, tags, the summary as excerpt, judge buttons)
and the reader as a third column that replaces the list on a phone. The
router pushes /roles/{uid}, which the server also renders with the reader
open, so the separate read page and role.js go. j/k, u/n/d, S, Enter,
Escape, o, /, f and c work as in newsdesk. The phone rules come with their
comments.

Two things the row lacked: roles.read_at, stamped when the reader opens a
role or a vote is cast, behind include_read on /api/roles; and role_tags,
written by summarise alongside the summary and served with counts by
/api/filters, filtered in SQL before LIMIT. Migration 5.

PyCharm run configurations in .run/ for serve, pull, seed and pytest.
core.autocrlf=input is set locally so a Windows-side checkout commits LF.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Fable 5.1 committed 2026-09-28 12:37:45 +02:00
1 parent 515d2250fc
commit a9290a6926
23 files changed
+2252 -715

No files matched your search

+21
View File
@@ -71,6 +71,9 @@ CREATE TABLE IF NOT EXISTS roles (
-- neutral, 1 like. It moves the rank at read time and never hides a role.
vote INTEGER CHECK (vote IN (-1, 0, 1)),
voted_at TEXT,
-- NULL unread, else when the feed first opened it or judged it: a vote
-- stamps this too, see Store.set_vote, because voting is reading.
read_at TEXT,
-- About 60 words from summarise, and when it wrote them.
summary TEXT NOT NULL DEFAULT '',
summarised_at TEXT,
@@ -81,6 +84,15 @@ CREATE TABLE IF NOT EXISTS roles (
created_at TEXT NOT NULL
);
-- The open vocabulary summarise reads off a posting: the role family, the
-- technologies and skills it names, and the domain. What the feed's filter
-- row is built from; see Store.set_tags and Store.tag_counts.
CREATE TABLE IF NOT EXISTS role_tags (
uid TEXT NOT NULL REFERENCES roles(uid) ON DELETE CASCADE,
tag TEXT NOT NULL,
PRIMARY KEY (uid, tag)
);
-- A company as a target, whether or not any board of it is read. key is
-- models.company_key(name), the slug roles.company_key holds.
CREATE TABLE IF NOT EXISTS companies (
@@ -208,6 +220,7 @@ CREATE INDEX IF NOT EXISTS idx_application_events
ON application_events(application_id, at);
CREATE INDEX IF NOT EXISTS idx_scores_agent ON scores(agent_id, score DESC);
CREATE INDEX IF NOT EXISTS idx_vectors_model ON vectors(model);
CREATE INDEX IF NOT EXISTS idx_role_tags_tag ON role_tags(tag);
"""
#: The table whose absence marks a file that has never been a roledesk
@@ -244,6 +257,14 @@ ALTER TABLE roles ADD COLUMN summary TEXT NOT NULL DEFAULT '';
ALTER TABLE roles ADD COLUMN summarised_at TEXT;
ALTER TABLE roles ADD COLUMN article_text TEXT NOT NULL DEFAULT '';
ALTER TABLE roles ADD COLUMN article_at TEXT;
"""),
(5, "roles.read_at and role_tags, for the feed's read state and tags", """
ALTER TABLE roles ADD COLUMN read_at TEXT;
CREATE TABLE role_tags (
uid TEXT NOT NULL REFERENCES roles(uid) ON DELETE CASCADE,
tag TEXT NOT NULL,
PRIMARY KEY (uid, tag)
);
"""),
)