Tag a company All roles to read its big boards with the agents' wide reach; favourite scores only
Migration 21 adds companies.all_roles, tags every favourite of any agent and each company whose board had params {"reach": "all"} (logged per board, the param removed). reach.plan reads a tagged company's boards with the union of the enabled agents' require reach and the base reach; favourite no longer widens the fetch. POST /api/companies/{key}/all-roles sets it and queues a pull when on. The Companies list, the reader and the company strip draw the toggle beside the affinity buttons, the list filters on it, and the board's reach editor drops its All roles option.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8d9a059e24
commit
5d5b7e7d3f
20 files changed
+422
-124
No files matched your search
+18
-9
@@ -81,8 +81,8 @@
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
const { api, esc, debounce, safeUrl, companies, loadCompanies, affinityControl, judgeButtons,
|
||||
loadTracked, chipInput } = window;
|
||||
const { api, esc, debounce, safeUrl, companies, loadCompanies, affinityControl, allRolesControl,
|
||||
judgeButtons, loadTracked, chipInput } = window;
|
||||
const $ = (sel, root = document) => root.querySelector(sel);
|
||||
|
||||
// Below this the rail is over the feed rather than beside it, and the reader
|
||||
@@ -1071,15 +1071,19 @@
|
||||
el.querySelector(".strip-drop").onclick = dropCompany;
|
||||
}
|
||||
const slot = el.querySelector(".affinity-slot");
|
||||
if (slot.dataset.affinity !== String(affinity)) {
|
||||
slot.dataset.affinity = String(affinity);
|
||||
const drawn = `${affinity}:${company ? company.all_roles : ""}`;
|
||||
if (slot.dataset.affinity !== drawn) {
|
||||
slot.dataset.affinity = drawn;
|
||||
slot.replaceChildren(affinityControl(key, affinity,
|
||||
(updated) => affinityChanged(key, company, updated), state.filter.agent));
|
||||
// The All roles tag needs a company row, which a first stance makes.
|
||||
if (company) slot.append(" ", allRolesControl(key, company.all_roles, renderStrip));
|
||||
// What ★ does, before; what it did, after.
|
||||
el.querySelector(".strip-note").textContent = affinity === 2
|
||||
? "★ Favourite: roles from every place the agent's required gates allow are listed."
|
||||
? "★ Favourite: roles from every place the agent's required gates allow are listed. "
|
||||
+ "All fetches them from a big board."
|
||||
: "★ Favourite also lists this company's roles outside your places, as far as the "
|
||||
+ "agent's required gates allow.";
|
||||
+ "agent's required gates allow. All fetches them from a big board.";
|
||||
}
|
||||
const n = state.total;
|
||||
el.querySelector(".strip-count").textContent = state.loaded
|
||||
@@ -1358,9 +1362,10 @@
|
||||
}
|
||||
|
||||
/* The company's ★ ▲ ⊘, the one place a company is judged outside the
|
||||
Companies page. A company seen only through a search has no row until
|
||||
its first change creates one, so the list is reloaded then. A change
|
||||
dims or undims its rows in the feed. */
|
||||
Companies page, and its All roles tag beside them. A company seen only
|
||||
through a search has no row until its first change creates one, so the
|
||||
list is reloaded then, and the tag, which needs a row, waits for it. A
|
||||
change dims or undims its rows in the feed. */
|
||||
function renderAffinity(slot, r) {
|
||||
const company = companies.get(r.company_key);
|
||||
if (!r.company_key) { slot.replaceChildren(); return; }
|
||||
@@ -1369,6 +1374,10 @@
|
||||
renderAffinity(slot, r);
|
||||
renderFeed();
|
||||
}, state.filter.agent));
|
||||
if (company) {
|
||||
slot.append(" ", allRolesControl(r.company_key, company.all_roles,
|
||||
async () => renderAffinity(slot, r)));
|
||||
}
|
||||
}
|
||||
|
||||
/* The answer, into the role on screen and into its row, whose excerpt is
|
||||
|
||||
Reference in new issue
Block a user