Show and filter the limits on the Companies list, list the traits on Sources

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
WolfandClaude Fable 5.1 committed 2026-09-30 16:00:45 +02:00
1 parent 439fc94e78
commit 6451f503f2
3 files changed
+72 -4

No files matched your search

+32 -1
View File
@@ -33,6 +33,12 @@
* changed only by a Recheck ("999 roles · checked 30 Sep"). Recheck, beside
* Change, sizes the board again (`/api/sources/{id}/size`) and queues a
* pull, since the size decides whether the board is filtered.
*
* After the size stand the board's limits, words for what its read cannot do
* ("read incomplete · no pay · without text: 12", `limits` from
* app/jobs/limits.py), and the Limits group of the filter picks the companies
* that have one. "N on this board" beside the open roles says the company
* has roles from a search too.
*/
(function () {
"use strict";
@@ -107,6 +113,14 @@
return button;
}
/** What a limit word means, from the title of its option in the filter
select ("without text: 12" is looked up as "without text"). */
function limitMeaning(word) {
const phrase = word.split(":")[0];
const option = [...$("#c-filter").options].find((o) => o.value === phrase);
return option && option.title ? `${word}: ${option.title}` : "";
}
function subLine(company, rerender) {
const sub = document.createElement("span");
sub.className = "sub";
@@ -143,11 +157,26 @@
sub.appendChild(link);
}
sub.append(` · ${count(company.open_roles, "open role")}`);
// open_roles also counts what a search listed; say so when the board's own differ.
if (company.board_open != null && company.board_open !== company.open_roles) {
sub.append(` (${company.board_open} on this board)`);
}
if (company.reach) sub.append(` · reads ${company.reach}`);
if (company.size != null) {
const checked = checkedOn(company.size_checked);
sub.append(` · ${count(company.size, "role")}${checked ? ` · checked ${checked}` : ""}`);
}
const words = (company.limits || []).filter((w) => w !== "failing");
if (words.length) {
// What limits the read (app/jobs/limits.py). The failing word is the
// line after this one; only the filter needs it as a word.
const limits = document.createElement("span");
limits.className = "limits";
limits.append(words.join(" · "));
limits.title = words.map(limitMeaning).filter(Boolean).join("\n");
sub.append(" · ");
sub.appendChild(limits);
}
if (company.failing_since) {
// The board has failed on every pull since then; after 21 days its
// roles close.
@@ -369,7 +398,9 @@
case "on": return company.on === true;
case "off": return company.on === false;
case "unreadable": return company.subscription_id == null && !company.from_search;
default: return true;
case "": return true;
// A limit (app/jobs/limits.py): the word up to its colon, which may carry a number.
default: return (company.limits || []).some((word) => word.startsWith(filter));
}
}