diff --git a/app/static/roles.js b/app/static/roles.js index c4a94ea..e590031 100644 --- a/app/static/roles.js +++ b/app/static/roles.js @@ -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 ? `
No open role fits these filters. +
No open role ${gate ? `that passes ${gate} ` : ""}fits these filters. and start again.
` - : `Nothing has been pulled yet. Runs starts one; - Job boards and - Company boards decide what it brings in.
`; + : gate + ? `No open role passes ${gate} yet. Runs + starts a pull; Job boards and + Company boards decide what it + brings in, Search agents what the gate passes.
` + : `Nothing has been pulled yet. Runs starts one; + Job boards and + Company boards decide what it brings in.
`; 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 = `