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:
1 parent
515d2250fc
commit
a9290a6926
23 files changed
+2252
-715
No files matched your search
+19
-2
@@ -43,8 +43,9 @@ class Model:
|
||||
return agent.Reply(data={"summaries": self.reply(items)}, backend="api")
|
||||
|
||||
|
||||
def written(items: list[dict[str, Any]]) -> list[dict[str, str]]:
|
||||
return [{"uid": i["uid"], "summary": f"A backend role at Acme, {i['uid']}."}
|
||||
def written(items: list[dict[str, Any]]) -> list[dict[str, Any]]:
|
||||
return [{"uid": i["uid"], "summary": f"A backend role at Acme, {i['uid']}.",
|
||||
"tags": ["Backend Engineer", "python", "fintech"]}
|
||||
for i in items]
|
||||
|
||||
|
||||
@@ -89,12 +90,28 @@ def test_a_batch_writes_the_summary_and_stamps_summarised_at(
|
||||
assert role is not None
|
||||
assert role.summary == f"A backend role at Acme, {uid}."
|
||||
assert role.summarised_at is not None
|
||||
assert role.tags == ["backend engineer", "fintech", "python"]
|
||||
assert result["summarised"] == 1 and result["pending"] == 0
|
||||
[[item]] = model.asked
|
||||
assert item == {"uid": uid, "title": "Backend Engineer 1", "company": "Acme",
|
||||
"place": "Copenhagen", "text": "Python and Go on Kubernetes. Pays 700k DKK."}
|
||||
|
||||
|
||||
def test_the_replys_tags_are_normalised_and_stored(
|
||||
store: Store, config: Config, monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
[uid] = ranked(store, "1")
|
||||
stub(monkeypatch, lambda items: [
|
||||
{"uid": items[0]["uid"], "summary": "A backend role, long enough to store.",
|
||||
"tags": [" Backend Engineer ", "PYTHON", "python", "", " "]}])
|
||||
|
||||
modeltask.run(summarise.TASK, config, store)
|
||||
|
||||
role = store.role(uid)
|
||||
assert role is not None
|
||||
# Collapsed whitespace, lowercased, deduplicated, empties dropped.
|
||||
assert role.tags == ["backend engineer", "python"]
|
||||
|
||||
|
||||
def test_the_fetched_page_is_read_before_the_description_and_capped(
|
||||
store: Store, config: Config, monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
[uid] = ranked(store, "1")
|
||||
|
||||
Reference in new issue
Block a user