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:
1 parent
bf6ef72b15
commit
17e7615599
5 files changed
+18
-12
No files matched your search
+1
-1
@@ -809,7 +809,7 @@ body[data-reader="open"] .company-strip { display: none; }
|
|||||||
.empty { padding: 4rem 0; max-width: 34rem; color: var(--dim); }
|
.empty { padding: 4rem 0; max-width: 34rem; color: var(--dim); }
|
||||||
.empty h2 { font-size: 1.2rem; font-weight: 600; color: var(--fg); margin: 0 0 .4rem; }
|
.empty h2 { font-size: 1.2rem; font-weight: 600; color: var(--fg); margin: 0 0 .4rem; }
|
||||||
|
|
||||||
/* ▲ ● ▼ ★, on a row and in the reader's bar (static/judge.js). */
|
/* ▼ ● ▲ ★, on a row and in the reader's bar (static/judge.js). */
|
||||||
.judge { display: flex; gap: .15rem; align-items: center; }
|
.judge { display: flex; gap: .15rem; align-items: center; }
|
||||||
.judge button {
|
.judge button {
|
||||||
padding: .2rem .45rem; font-size: 1rem; line-height: 1;
|
padding: .2rem .45rem; font-size: 1rem; line-height: 1;
|
||||||
|
|||||||
+4
-3
@@ -136,11 +136,12 @@
|
|||||||
pressing the one that is already pressed is how a company gets back to
|
pressing the one that is already pressed is how a company gets back to
|
||||||
it. "Hidden" is the word for -1 everywhere the UI names it, even though
|
it. "Hidden" is the word for -1 everywhere the UI names it, even though
|
||||||
the code and the API keep `mute`/`hide_muted` — a rename in the store
|
the code and the API keep `mute`/`hide_muted` — a rename in the store
|
||||||
and CLI is a separate, larger change than this control. */
|
and CLI is a separate, larger change than this control. Low to high, as
|
||||||
|
the role's ▼ ● ▲ ★, so like and favourite sit together on the right. */
|
||||||
const AFFINITY_LEVELS = [
|
const AFFINITY_LEVELS = [
|
||||||
{ value: 2, icon: "★", label: "Favourite" }, // ★
|
|
||||||
{ value: 1, icon: "▲", label: "Like" }, // ▲
|
|
||||||
{ value: -1, icon: "⦸", label: "Hidden" }, // ⊘
|
{ value: -1, icon: "⦸", label: "Hidden" }, // ⊘
|
||||||
|
{ value: 1, icon: "▲", label: "Like" }, // ▲
|
||||||
|
{ value: 2, icon: "★", label: "Favourite" }, // ★
|
||||||
];
|
];
|
||||||
|
|
||||||
/* `onChange` runs after the server accepted the change, so each page
|
/* `onChange` runs after the server accepted the change, so each page
|
||||||
|
|||||||
+7
-4
@@ -1,4 +1,4 @@
|
|||||||
/* ▲ ● ▼ ★ for one role: the feed row and the reader bar share them.
|
/* ▼ ● ▲ ★ for one role: the feed row and the reader bar share them.
|
||||||
*
|
*
|
||||||
* news's `voteButtons`, `starButton` and `vote()`, adapted. Three stances and
|
* news's `voteButtons`, `starButton` and `vote()`, adapted. Three stances and
|
||||||
* no stance is four states from three buttons; pressing the stance a role
|
* no stance is four states from three buttons; pressing the stance a role
|
||||||
@@ -9,7 +9,9 @@
|
|||||||
* ★ is Save. It files the role under Applications (`POST /api/applications`)
|
* ★ is Save. It files the role under Applications (`POST /api/applications`)
|
||||||
* and, pressed again, takes it back out (`DELETE /api/applications/{id}`),
|
* and, pressed again, takes it back out (`DELETE /api/applications/{id}`),
|
||||||
* which the server allows only while the application is still at `saved`; a
|
* which the server allows only while the application is still at `saved`; a
|
||||||
* 409 is toasted by `api()` and the star stays lit.
|
* 409 is toasted by `api()` and the star stays lit. A save also casts ▲ for
|
||||||
|
* the agent, unless it is cast already, since a starred role is a liked one;
|
||||||
|
* an unsave leaves the vote alone. ▲ sits next to ★ for that reason.
|
||||||
*
|
*
|
||||||
* Both are optimistic: the button changes before the request and changes back
|
* Both are optimistic: the button changes before the request and changes back
|
||||||
* if it fails. `api()` has already toasted the failure by then.
|
* if it fails. `api()` has already toasted the failure by then.
|
||||||
@@ -63,9 +65,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
const STANCES = [
|
const STANCES = [
|
||||||
{ value: 1, cls: "up", glyph: "▲", said: "Like" },
|
|
||||||
{ value: 0, cls: "mid", glyph: "●", said: "Neither way" },
|
|
||||||
{ value: -1, cls: "down", glyph: "▼", said: "Pass" },
|
{ value: -1, cls: "down", glyph: "▼", said: "Pass" },
|
||||||
|
{ value: 0, cls: "mid", glyph: "●", said: "Neither way" },
|
||||||
|
{ value: 1, cls: "up", glyph: "▲", said: "Like" },
|
||||||
];
|
];
|
||||||
|
|
||||||
function button(cls, glyph) {
|
function button(cls, glyph) {
|
||||||
@@ -150,6 +152,7 @@
|
|||||||
tracked.set(role.uid, await api("/api/applications", {
|
tracked.set(role.uid, await api("/api/applications", {
|
||||||
method: "POST", body: { role_uid: role.uid, status: "saved" },
|
method: "POST", body: { role_uid: role.uid, status: "saved" },
|
||||||
}));
|
}));
|
||||||
|
if (role.vote !== 1) vote(1);
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (before) tracked.set(role.uid, before);
|
if (before) tracked.set(role.uid, before);
|
||||||
|
|||||||
+4
-4
@@ -11,7 +11,7 @@
|
|||||||
* A row is newsdesk's `.row`: the score gutter and number (hidden under
|
* A row is newsdesk's `.row`: the score gutter and number (hidden under
|
||||||
* Newest first, since the score is not what put the row there), the title,
|
* Newest first, since the score is not what put the row there), the title,
|
||||||
* company · place · badges · age · tags, the summary or the description's
|
* company · place · badges · age · tags, the summary or the description's
|
||||||
* opening, and ▲ ● ▼ ★ from judge.js. A passed role and a hidden company's
|
* opening, and ▼ ● ▲ ★ from judge.js. A passed role and a hidden company's
|
||||||
* are dimmed, never dropped, so a stray tap stays visible to be undone.
|
* are dimmed, never dropped, so a stray tap stays visible to be undone.
|
||||||
*
|
*
|
||||||
* Opening a role pushes `/roles/{uid}`; closing goes back. Stepping with j/k
|
* Opening a role pushes `/roles/{uid}`; closing goes back. Stepping with j/k
|
||||||
@@ -62,7 +62,7 @@
|
|||||||
* screen with that company as its one company chip (`?company_keys=`); a
|
* screen with that company as its one company chip (`?company_keys=`); a
|
||||||
* plain click filters in place and pushes. With one company filtered a strip
|
* plain click filters in place and pushes. With one company filtered a strip
|
||||||
* over the feed names it, counts its roles, links its careers page and
|
* over the feed names it, counts its roles, links its careers page and
|
||||||
* carries its ★ ▲ ⊘ for the viewing agent. `?company=`, `?company_keys=` and
|
* carries its ⊘ ▲ ★ for the viewing agent. `?company=`, `?company_keys=` and
|
||||||
* `?agent=` are how the Companies and Search agents pages link in.
|
* `?agent=` are how the Companies and Search agents pages link in.
|
||||||
*
|
*
|
||||||
* Company and Place in the rail are chip inputs (chips.js) on the suggest
|
* Company and Place in the rail are chip inputs (chips.js) on the suggest
|
||||||
@@ -1082,7 +1082,7 @@
|
|||||||
|
|
||||||
/* With exactly one company filtered, which is where its name leads, a
|
/* With exactly one company filtered, which is where its name leads, a
|
||||||
strip over the feed says whose roles these are and carries what is done
|
strip over the feed says whose roles these are and carries what is done
|
||||||
with a company from here: its careers page, and its ★ ▲ ⊘ for the viewing
|
with a company from here: its careers page, and its ⊘ ▲ ★ for the viewing
|
||||||
agent, which is where a company is starred from. Built again only for
|
agent, which is where a company is starred from. Built again only for
|
||||||
another company or agent, since the feed is drawn on every page; the
|
another company or agent, since the feed is drawn on every page; the
|
||||||
count and the affinity are patched. */
|
count and the affinity are patched. */
|
||||||
@@ -1407,7 +1407,7 @@
|
|||||||
el.querySelector(".reader-body").scrollTop = scrolled;
|
el.querySelector(".reader-body").scrollTop = scrolled;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The company's ★ ▲ ⊘, the one place a company is judged outside the
|
/* The company's ⊘ ▲ ★, the one place a company is judged outside the
|
||||||
Companies page, and its two fetch overrides beside them. A company seen
|
Companies page, and its two fetch overrides beside them. A company seen
|
||||||
only through a search has no row until its first change creates one, so
|
only through a search has no row until its first change creates one, so
|
||||||
the list is reloaded then, and the overrides, which need a row, wait for it. A
|
the list is reloaded then, and the overrides, which need a row, wait for it. A
|
||||||
|
|||||||
@@ -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.
|
**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.
|
**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.
|
**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.
|
||||||
|
|||||||
Reference in new issue
Block a user