Order a role's buttons ▼ ● ▲ ★ and like a role when it is saved

The company control follows as ⊘ ▲ ★, so like and favourite sit together.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Opus 5.5 committed 2026-09-30 21:06:11 +02:00
1 parent bf6ef72b15
commit 17e7615599
5 files changed
+18 -12

No files matched your search

+2
View File
@@ -276,6 +276,8 @@ What was decided for roledesk and the one reason for each. The longer reasoning
**Read state is a column on `roles`, and a vote stamps it too.** `read_at` sits beside `vote`, the same shape as newsdesk's `items.read_at`, so the feed filters and counts by it directly rather than joining a side table on every page load. `set_vote` stamps it only when it is still NULL, since voting is reading in newsdesk as well; clearing a vote leaves it alone, because taking back an opinion is not un-reading the posting.
**A role's buttons run ▼ ● ▲ ★, and saving a role likes it.** The order is low to high, so ▲ sits beside ★. A role worth saving is a liked one, so `judge.js` casts ▲ for the viewing agent after a save that succeeded, unless ▲ is cast already. Unsaving leaves the vote alone, as clearing a vote leaves the read mark. This is done in the page, not in `POST /api/applications`, because an application belongs to no agent and a vote does. The company control follows the same order, ⊘ ▲ ★.
**Tags are a table, written only by `summarise`.** `role_tags(uid, tag)` follows newsdesk's `tags` table rather than a JSON array on `roles`, so `tag_counts` and the any/all filter are ordinary SQL (`GROUP BY`, `EXISTS`) instead of scanning every row's array. `summarise` already reads the whole posting once per role, so writing 3 to 8 tags alongside the summary costs no extra model call.
**Tag filtering runs in SQL before `LIMIT`, the same as `hide_muted`.** An `EXISTS` or `COUNT(DISTINCT tag)` clause in `_roles_from` keeps the guarantee the muted-company exclusion already established: a filter narrows the rows a page is built from, not the page after it is already built, so a tag matching only older roles is not silently empty on page one.