Split the All tag into two company overrides: All countries and All roles (WP L)

Fetching has two filters, and a company now overrides each on its own.
All countries (companies.all_countries) is the old All roles tag: its big
boards are read with the agents' wide reach. All roles (companies.all_roles,
new meaning) drops the agents' fetch terms and any later role filter.

- Migration 24 copies the old tag to all_countries and keeps all_roles for
  those companies, and moves a board's {"terms": false} to its company.
- The runner no longer reads {"terms": false}; the plan leaves the terms out
  for a company set to All roles.
- POST /api/companies/{key}/all-countries and /all-roles, each queueing a
  pull when turned on; CompanyOut carries both.
- Two toggles replace All on the Companies row, the reader and the Roles
  strip; the reach line states countries and role types in plain words;
  the filter select gets both options.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Opus 5.5 committed 2026-09-30 12:50:45 +02:00
1 parent 795ca3628c
commit e52857dea5
23 files changed
+602 -215

No files matched your search

+10 -10
View File
@@ -81,7 +81,7 @@
(function () {
"use strict";
const { api, esc, debounce, safeUrl, companies, loadCompanies, affinityControl, allRolesControl,
const { api, esc, debounce, safeUrl, companies, loadCompanies, affinityControl, overridesControl,
judgeButtons, loadTracked, chipInput } = window;
const $ = (sel, root = document) => root.querySelector(sel);
@@ -1071,19 +1071,19 @@
el.querySelector(".strip-drop").onclick = dropCompany;
}
const slot = el.querySelector(".affinity-slot");
const drawn = `${affinity}:${company ? company.all_roles : ""}`;
const drawn = `${affinity}:${company ? `${company.all_countries}:${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));
// The two overrides need a company row, which a first stance makes.
if (company) slot.append(" ", overridesControl(key, company, 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. "
+ "All fetches them from a big board."
+ "All countries 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. All fetches them from a big board.";
+ "agent's required gates allow. All countries fetches them from a big board.";
}
const n = state.total;
el.querySelector(".strip-count").textContent = state.loaded
@@ -1362,9 +1362,9 @@
}
/* The company's ★ ▲ ⊘, the one place a company is judged outside the
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
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
the list is reloaded then, and the overrides, which need a row, wait for it. A
change dims or undims its rows in the feed. */
function renderAffinity(slot, r) {
const company = companies.get(r.company_key);
@@ -1375,7 +1375,7 @@
renderFeed();
}, state.filter.agent));
if (company) {
slot.append(" ", allRolesControl(r.company_key, company.all_roles,
slot.append(" ", overridesControl(r.company_key, company,
async () => renderAffinity(slot, r)));
}
}