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:
1 parent
439fc94e78
commit
6451f503f2
3 files changed
+72
-4
No files matched your search
+32
-1
@@ -33,6 +33,12 @@
|
|||||||
* changed only by a Recheck ("999 roles · checked 30 Sep"). Recheck, beside
|
* changed only by a Recheck ("999 roles · checked 30 Sep"). Recheck, beside
|
||||||
* Change, sizes the board again (`/api/sources/{id}/size`) and queues a
|
* Change, sizes the board again (`/api/sources/{id}/size`) and queues a
|
||||||
* pull, since the size decides whether the board is filtered.
|
* 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 () {
|
(function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
@@ -107,6 +113,14 @@
|
|||||||
return button;
|
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) {
|
function subLine(company, rerender) {
|
||||||
const sub = document.createElement("span");
|
const sub = document.createElement("span");
|
||||||
sub.className = "sub";
|
sub.className = "sub";
|
||||||
@@ -143,11 +157,26 @@
|
|||||||
sub.appendChild(link);
|
sub.appendChild(link);
|
||||||
}
|
}
|
||||||
sub.append(` · ${count(company.open_roles, "open role")}`);
|
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.reach) sub.append(` · reads ${company.reach}`);
|
||||||
if (company.size != null) {
|
if (company.size != null) {
|
||||||
const checked = checkedOn(company.size_checked);
|
const checked = checkedOn(company.size_checked);
|
||||||
sub.append(` · ${count(company.size, "role")}${checked ? ` · checked ${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) {
|
if (company.failing_since) {
|
||||||
// The board has failed on every pull since then; after 21 days its
|
// The board has failed on every pull since then; after 21 days its
|
||||||
// roles close.
|
// roles close.
|
||||||
@@ -369,7 +398,9 @@
|
|||||||
case "on": return company.on === true;
|
case "on": return company.on === true;
|
||||||
case "off": return company.on === false;
|
case "off": return company.on === false;
|
||||||
case "unreadable": return company.subscription_id == null && !company.from_search;
|
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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+19
-3
@@ -18,8 +18,9 @@
|
|||||||
*
|
*
|
||||||
* Under the Follow form of Company boards, a fold lists what each reader
|
* Under the Follow form of Company boards, a fold lists what each reader
|
||||||
* declares (`/api/readers`): how its list arrives, where the text is, what
|
* declares (`/api/readers`): how its list arrives, where the text is, what
|
||||||
* it filters at the source, how it states places, and the robots.txt
|
* it filters at the source, how it states places, how it knows a read is
|
||||||
* decision taken when it was built.
|
* complete, its page size and ceiling, which fields its rows state, and the
|
||||||
|
* robots.txt decision taken when it was built.
|
||||||
*
|
*
|
||||||
* The Unmapped section lists what prep could not place, most roles first:
|
* The Unmapped section lists what prep could not place, most roles first:
|
||||||
* the place texts no place resolves (`/api/prep/unlinked`), with the
|
* the place texts no place resolves (`/api/prep/unlinked`), with the
|
||||||
@@ -297,6 +298,20 @@
|
|||||||
return shown.length ? shown.join(", ") : "none";
|
return shown.length ? shown.join(", ") : "none";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** What the reader declares of its limits, short: how completeness is known,
|
||||||
|
the page size and ceiling, a teaser beside the detail text, an empty list
|
||||||
|
that may be an unknown slug, and what its rows state. */
|
||||||
|
function limits(reader) {
|
||||||
|
const out = [`complete ${reader.complete}`];
|
||||||
|
if (reader.page_size) out.push(`${reader.page_size} a page`);
|
||||||
|
if (reader.ceiling) out.push(`ceiling ${reader.ceiling}`);
|
||||||
|
if (reader.teaser) out.push("teaser in the list");
|
||||||
|
if (reader.empty === "suspect") out.push("empty may be an unknown slug");
|
||||||
|
const fields = Object.entries(reader.fields || {}).map(([name, how]) => `${name} ${how}`);
|
||||||
|
if (fields.length) out.push(`states ${fields.join(", ")}`);
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
function renderReaders(readers) {
|
function renderReaders(readers) {
|
||||||
const fold = document.createElement("details");
|
const fold = document.createElement("details");
|
||||||
fold.className = "prune";
|
fold.className = "prune";
|
||||||
@@ -319,7 +334,8 @@
|
|||||||
const sub = document.createElement("span");
|
const sub = document.createElement("span");
|
||||||
sub.className = "sub";
|
sub.className = "sub";
|
||||||
sub.textContent = [`list ${reader.listing}`, `text ${reader.text}`,
|
sub.textContent = [`list ${reader.listing}`, `text ${reader.text}`,
|
||||||
`filters ${filters(reader)}`, `places ${reader.places}`, reader.robots].join(" · ");
|
`filters ${filters(reader)}`, `places ${reader.places}`, ...limits(reader),
|
||||||
|
reader.robots].join(" · ");
|
||||||
row.append(name, sub);
|
row.append(name, sub);
|
||||||
list.appendChild(row);
|
list.appendChild(row);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -111,6 +111,27 @@
|
|||||||
<option value="on">On</option>
|
<option value="on">On</option>
|
||||||
<option value="off">Off</option>
|
<option value="off">Off</option>
|
||||||
<option value="unreadable">Not readable yet</option>
|
<option value="unreadable">Not readable yet</option>
|
||||||
|
{# The phrases of app/jobs/limits.py `WORDS`, with their meanings; a test
|
||||||
|
compares the two. companies.js shows the meaning on the row. #}
|
||||||
|
<optgroup label="Limits">
|
||||||
|
<option value="failing" title="the last read failed; the roles stay open until it has failed for 21 days">failing</option>
|
||||||
|
<option value="read incomplete" title="the last read answered but did not list the whole board, so it closed nothing">read incomplete</option>
|
||||||
|
<option value="swept" title="the board is over the page cap and is read across several pulls">swept</option>
|
||||||
|
<option value="filtered by reach" title="the read asked the host for the agents' countries and remote only">filtered by reach</option>
|
||||||
|
<option value="remote not asked" title="filtered by country on a host with no remote filter while the agents want remote">remote not asked</option>
|
||||||
|
<option value="narrowed by terms" title="read by the agents' fetch terms, so a role outside them is never listed">narrowed by terms</option>
|
||||||
|
<option value="nothing asked" title="the host knows none of the places asked, so the read asked nothing and closed nothing">nothing asked</option>
|
||||||
|
<option value="size 0" title="the board was sized at no roles">size 0</option>
|
||||||
|
<option value="over the ceiling" title="the board is at or over what the host answers at all, so the read is incomplete">over the ceiling</option>
|
||||||
|
<option value="text per role" title="the list has no text; enrich reads each role's page, ranked roles first">text per role</option>
|
||||||
|
<option value="no text" title="the host gives no text">no text</option>
|
||||||
|
<option value="excerpt only" title="the host gives a teaser and nothing more">excerpt only</option>
|
||||||
|
<option value="no pay" title="the host states no pay">no pay</option>
|
||||||
|
<option value="date not trusted" title="the host's date is not the posting date">date not trusted</option>
|
||||||
|
<option value="without text" title="open roles with no description, teaser or page text (the number follows)">without text</option>
|
||||||
|
<option value="text failed" title="roles whose page read failed and is tried again (the number follows)">text failed</option>
|
||||||
|
<option value="read whole" title="under 300 roles or a host that cannot filter, so the reach does not narrow it">read whole</option>
|
||||||
|
</optgroup>
|
||||||
</select>
|
</select>
|
||||||
{# Liked and hidden are per search agent: this picks whose the list shows
|
{# Liked and hidden are per search agent: this picks whose the list shows
|
||||||
and whose the buttons set. companies.js fills it from /api/agents. #}
|
and whose the buttons set. companies.js fills it from /api/agents. #}
|
||||||
|
|||||||
Reference in new issue
Block a user