Name the viewing agent's fetch gate at the end of the list and in the empty state, where a phone sees it, and say in the reader when that gate rejects the role open
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
af1efd4fd6
commit
6b12d10bee
2 files changed
+64
-10
No files matched your search
+51
-10
@@ -42,8 +42,10 @@
|
||||
* the same three whichever agent is viewed, and all carry the agent's votes.
|
||||
* What fits me needs a CV: an agent without one is shown What I'm looking
|
||||
* for, as an agentless page is shown Newest. Every order keeps to the
|
||||
* roles the agent's fetch gate passes, which a note under Viewing as says;
|
||||
* Show gated (`gated=true`) adds the ones it rejects, with the reason.
|
||||
* roles the agent's fetch gate passes, which a note under Viewing as says,
|
||||
* and for a phone, whose rail is shut, the end of the list and the empty
|
||||
* state; Show gated (`gated=true`) adds the ones it rejects, with the
|
||||
* reason. The reader says when the gate rejects the role open.
|
||||
*
|
||||
* Saved filters belong to the viewing agent (`/api/agents/{id}/filters`):
|
||||
* pills in the rail, newsdesk's `#active` row, each the query string
|
||||
@@ -1413,15 +1415,24 @@
|
||||
const retry = empty.querySelector("[data-retry]");
|
||||
if (retry) retry.onclick = () => (state.agentsLoaded ? loadFeed() : start());
|
||||
} else {
|
||||
// An agent's list is what its fetch gate passes, which a phone,
|
||||
// whose rail is shut, learns here and at the end of the list.
|
||||
const filtered = state.q || filtersOn();
|
||||
const gate = gateKept() ? `${esc(gateOwner())} fetch gate` : "";
|
||||
empty.innerHTML = filtered
|
||||
? `<h2>Nothing matches</h2>
|
||||
<p>No open role fits these filters.
|
||||
<p>No open role ${gate ? `that passes ${gate} ` : ""}fits these filters.
|
||||
<button type="button" class="linky" data-clear>Clear them</button> and start again.</p>`
|
||||
: `<h2>No roles yet</h2>
|
||||
<p>Nothing has been pulled yet. <a href="/settings/sources#runs">Runs</a> starts one;
|
||||
<a href="/settings/sources#job-boards">Job boards</a> and
|
||||
<a href="/settings/sources#company-boards">Company boards</a> decide what it brings in.</p>`;
|
||||
: gate
|
||||
? `<h2>No roles yet</h2>
|
||||
<p>No open role passes ${gate} yet. <a href="/settings/sources#runs">Runs</a>
|
||||
starts a pull; <a href="/settings/sources#job-boards">Job boards</a> and
|
||||
<a href="/settings/sources#company-boards">Company boards</a> decide what it
|
||||
brings in, <a href="/settings/agents">Search agents</a> what the gate passes.</p>`
|
||||
: `<h2>No roles yet</h2>
|
||||
<p>Nothing has been pulled yet. <a href="/settings/sources#runs">Runs</a> starts one;
|
||||
<a href="/settings/sources#job-boards">Job boards</a> and
|
||||
<a href="/settings/sources#company-boards">Company boards</a> decide what it brings in.</p>`;
|
||||
const clear = empty.querySelector("[data-clear]");
|
||||
if (clear) clear.onclick = () => { state.q = ""; $("#search").value = ""; clearFilters(); };
|
||||
}
|
||||
@@ -1434,9 +1445,32 @@
|
||||
const end = $("#feed-end");
|
||||
const n = state.items.length;
|
||||
end.hidden = !state.loaded || !n;
|
||||
end.textContent = state.more
|
||||
? "Loading more…"
|
||||
: `${number.format(n)} ${n === 1 ? "role" : "roles"} — that is all of them.`;
|
||||
end.textContent = state.more ? "Loading more…" : `${listSaid(n)} — that is all of them.`;
|
||||
}
|
||||
|
||||
/** Whether the list keeps to the viewing agent's fetch gate: there is an
|
||||
agent, and Show gated is off. */
|
||||
const gateKept = () => state.filter.agent !== null && !state.filter.gated;
|
||||
|
||||
/** Whose fetch gate, for a sentence: the viewing agent's name, or "this
|
||||
agent's" until the agents are in. */
|
||||
function gateOwner() {
|
||||
const agent = viewed();
|
||||
return agent ? `${agent.name}'s` : "this agent's";
|
||||
}
|
||||
|
||||
/** The rows on screen in words, for the end of the list: how many and,
|
||||
with an agent viewing, that they are what its fetch gate passes (and
|
||||
the filters keep), or with Show gated that they hold what it rejects. */
|
||||
function listSaid(n) {
|
||||
const roles = `${number.format(n)} ${n === 1 ? "role" : "roles"}`;
|
||||
if (state.filter.agent === null) return roles;
|
||||
const gate = `${gateOwner()} fetch gate`;
|
||||
const filtered = Boolean(state.q) || filtersOn() > (state.filter.gated ? 1 : 0);
|
||||
if (state.filter.gated) {
|
||||
return `${roles}${filtered ? " in these filters" : ""}, the ones ${gate} rejects included`;
|
||||
}
|
||||
return `${roles} ${n === 1 ? "passes" : "pass"} ${gate}${filtered ? " and these filters" : ""}`;
|
||||
}
|
||||
|
||||
/* With exactly one company filtered, which is where its name leads, a
|
||||
@@ -1808,6 +1842,10 @@
|
||||
const waiting = state.summarising === state.readingUid;
|
||||
const teaser = loaded && !r.article_text && out && (r.description || "").length < TEASER;
|
||||
|
||||
// Under the title, in the copy note's style: that the viewing agent's
|
||||
// fetch gate rejects the role and why (`gated_reason`), since a link
|
||||
// from elsewhere, a saved role on Applications say, opens one the feed
|
||||
// never lists.
|
||||
el.innerHTML = `
|
||||
<div class="reader-bar">
|
||||
<span class="judge"></span>
|
||||
@@ -1831,6 +1869,9 @@
|
||||
<h1>${esc(r.title || "")}</h1>
|
||||
${loaded && r.dup_of ? `<p class="reader-note reader-copy">A copy of
|
||||
<a href="${esc(pathFor(r.dup_of))}">a posting</a> the feed lists once.</p>` : ""}
|
||||
${loaded && state.filter.agent !== null && r.gated_reason
|
||||
? `<p class="reader-note reader-copy">Rejected by ${esc(gateOwner())} fetch gate:
|
||||
${esc(r.gated_reason)}. The feed lists it only with Show gated.</p>` : ""}
|
||||
${pay ? `<p class="reader-salary">${esc(pay.range)}</p>
|
||||
${pay.detail ? `<p class="muted small">${esc(pay.detail)}</p>` : ""}
|
||||
${pay.note ? `<p class="muted small">${esc(pay.note)}</p>` : ""}` : ""}
|
||||
|
||||
@@ -119,3 +119,16 @@ def test_a_company_on_settings_sources_links_to_its_company_view_by_key() -> Non
|
||||
script = (STATIC / "companies.js").read_text()
|
||||
assert "`/?company_keys=${encodeURIComponent(company.key)}`" in script
|
||||
assert "/?company=" not in script
|
||||
|
||||
|
||||
def test_the_end_of_the_list_the_empty_state_and_the_reader_name_the_fetch_gate() -> None:
|
||||
"""A phone's rail, which holds the note, is shut, so the end of the list
|
||||
and the empty state say whose fetch gate the list keeps to, and the
|
||||
reader says when that gate rejects the role open (`gated_reason`)."""
|
||||
script = (STATIC / "roles.js").read_text()
|
||||
assert "`${listSaid(n)} — that is all of them.`" in script
|
||||
assert '${n === 1 ? "passes" : "pass"} ${gate}' in script
|
||||
assert "No open role ${gate ? `that passes ${gate} ` : \"\"}fits these filters." in script
|
||||
assert "No open role passes ${gate} yet." in script
|
||||
assert "Rejected by ${esc(gateOwner())} fetch gate:" in script
|
||||
assert "loaded && state.filter.agent !== null && r.gated_reason" in script
|
||||
Reference in new issue
Block a user