From 51d2537d733ed23018291f0336a4919f2c7d2e52 Mon Sep 17 00:00:00 2001 From: Wolf Date: Tue, 29 Sep 2026 16:58:51 +0200 Subject: [PATCH] Search roles by company too, link the careers page in the reader, widen the list and reader Co-Authored-By: Claude Opus 5.5 --- app/static/app.css | 11 ++++++----- app/static/roles.js | 3 +++ app/storage/store.py | 13 +++++++------ app/templates/roles.html | 2 +- tests/test_storage.py | 3 +++ 5 files changed, 20 insertions(+), 12 deletions(-) diff --git a/app/static/app.css b/app/static/app.css index 49ebaeb..144a20e 100644 --- a/app/static/app.css +++ b/app/static/app.css @@ -477,11 +477,11 @@ body[data-rail="shut"] #rail { display: none; } /* Reading opens a third column and the shell goes full width: the list keeps a narrow lane on the left, the role takes the rest. */ body[data-reader="open"] .shell { - grid-template-columns: 15rem 21rem minmax(0, 1fr); + grid-template-columns: 15rem 29rem minmax(0, 1fr); max-width: none; gap: 1.2rem; } body[data-reader="open"][data-rail="shut"] .shell { - grid-template-columns: 21rem minmax(0, 1fr); + grid-template-columns: 29rem minmax(0, 1fr); } /* -- the rail -- */ @@ -842,12 +842,13 @@ tr.muted { opacity: .55; } padding: 1.6rem 2rem 4rem; overflow-wrap: anywhere; } -/* ~68 characters a line at the reading size -- past that the eye loses the - start of the next line and has to hunt for it. */ -.reader-body > * { max-width: 36rem; margin-inline: auto; } +/* ~90 characters a line at the reading size: newsdesk's 36rem wrapped a + posting's short lines and lists too early. */ +.reader-body > * { max-width: 48rem; margin-inline: auto; } .reader-meta { margin-top: 0; } .reader-meta b { font-weight: 600; color: var(--dim); } +.reader-meta .reader-careers { color: var(--dim); } .reader-meta .affinity { font-size: .85rem; } .reader-meta .affinity:empty { display: none; } diff --git a/app/static/roles.js b/app/static/roles.js index 34a16b8..4cb3b05 100644 --- a/app/static/roles.js +++ b/app/static/roles.js @@ -798,6 +798,7 @@ : text ? paragraphs(text) : `

The board gave no description for this one.

`; const pay = payDisplay(r); + const careers = safeUrl(companies.get(r.company_key)?.careers_url); const waiting = state.summarising === state.readingUid; const teaser = loaded && !r.article_text && out && (r.description || "").length < TEASER; @@ -813,6 +814,8 @@
${r.company ? `${esc(r.company)}` : ""} + ${careers ? `Careers ↗` : ""} ${r.place ? `${esc(r.place)}` : ""} ${r.first_seen ? `${ago(r.first_seen)}` : ""} diff --git a/app/storage/store.py b/app/storage/store.py index 1f7d22d..6a5fc28 100644 --- a/app/storage/store.py +++ b/app/storage/store.py @@ -496,10 +496,11 @@ class Store: """Newest first by `posted_at`. `company` and `place` are case-insensitive substrings of the columns a board wrote — not the key, so a search does not have to know the exact slug a company folds - to. `q` is matched word by word against `title`; a role must match - every word. `function` and `remote` match a gate column exactly. - `days` keeps only roles posted within that many days of now. `pay` - (a key of `PAY`) filters on `salary_state`. + to. `q` is matched word by word against `title` and `company`; a + role must match every word in one or the other. `function` and + `remote` match a gate column exactly. `days` keeps only roles posted + within that many days of now. `pay` (a key of `PAY`) filters on + `salary_state`. `agent` says whose votes, hidden companies and scores are meant. Each row carries that agent's `vote` and `voted_at`; `judged` (a key of @@ -653,8 +654,8 @@ class Store: where.append("posted_at >= ?") params.append(_iso(self.clock() - timedelta(days=days))) for word in (q or "").split(): - where.append("title LIKE ? ESCAPE '\\'") - params.append(_like(word)) + where.append("(title LIKE ? ESCAPE '\\' OR company LIKE ? ESCAPE '\\')") + params += [_like(word)] * 2 if judged: if judged not in JUDGED: raise ValueError(f"judged is {', '.join(JUDGED)}, not {judged!r}") diff --git a/app/templates/roles.html b/app/templates/roles.html index 44a67d7..cd1e6dd 100644 --- a/app/templates/roles.html +++ b/app/templates/roles.html @@ -28,7 +28,7 @@ - {% endblock %} diff --git a/tests/test_storage.py b/tests/test_storage.py index 210fb36..7b7b196 100644 --- a/tests/test_storage.py +++ b/tests/test_storage.py @@ -668,6 +668,9 @@ def test_roles_filters_q_function_remote_and_days(store: Store, clock: Clock) -> function="sales")) assert [r.source_id for r in store.roles(q="senior engineer")] == ["2", "1"] assert [r.source_id for r in store.roles(q="backend nonsense")] == [] + # A word may match the company instead of the title, each on its own. + assert [r.source_id for r in store.roles(q="acme engineer")] == ["2", "1"] + assert [r.source_id for r in store.roles(q="acme nonsense")] == [] assert [r.source_id for r in store.roles(function="engineering")] == ["1"] assert [r.source_id for r in store.roles(remote="remote")] == ["1"] assert [r.source_id for r in store.roles(company="ac")] == ["2", "1"]