10 Commits
Author SHA1 Message Date
CatoandClaude 76b5c6e8dc fix(links): a link does not preload its target (#418)
Next preloads every link that scrolls into view, and these pages are drawn on
request. Measured in a browser on 2026-11-29: one visit to the home page made
27 preload requests to the server. Solon, built the same way, made 91 to 778
a visit and stopped answering under a handful of readers (solon#643).

components/link.tsx wraps next/link with prefetch={false}; all 167 files that
imported next/link import it instead, and ESLint (no-restricted-imports)
keeps a bare next/link from coming back.

pnpm run verify passes (format, types, lint, 1,144 tests).


Claude-Session: https://claude.ai/code/session_019MDtmvTCDbJAYNKQpNyKzz

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-29 17:25:02 +01:00
CatoandClaude c59cd1dc11 refactor(palette): search as you type through searchkit's useSearchAsYouType (#380)
The command palette hand-rolled its own debounce, abort and stale-answer
drop. @bitbaum/searchkit/react's useSearchAsYouType does exactly that, and
the org rule is that a package capability is used, not re-implemented. The
local useSearch is gone; the palette keeps its cache (an earlier query
answers without a request), its keyboard behaviour and its rows.

What the reader sees: the last research results stay on screen while a
newer query loads instead of blanking out, the "All N results" count only
shows for the query actually answered, and a failed research search now
says so on the last row instead of failing silently.

package-plan.json binds CommandPalette.tsx to useSearchAsYouType under the
search block; README describes the new behaviour.

Claude-Session: https://claude.ai/code/session_019MDtmuvTGrpo3VChP3skH8

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-12 08:40:56 +01:00
Cato a46565435a fix(shell): hide mobile tab bar on auth pages (#377) 2026-11-12 07:32:53 +01:00
CatoandClaude 0b6ec077a3 fix(nav): /portal reaches the desk, and the desk is linked for every reader (#366)
/portal returned 404. The member portal is the desk at /account, so
/portal, /portal/* and /desk now redirect there (temporary, so a portal
page of its own can take the address back).

The top bar's Desk link and the palette's Desk row were shown only to a
signed-in reader, so nobody without a session could find it. Signed out,
/account already says what the desk is and offers sign-in; both now show
for everyone.


Claude-Session: https://claude.ai/code/session_019MDtmuvTGrpo3VChP3skH8

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-12 05:05:07 +01:00
CatoandClaude Sonnet 5.5 408d9d77f1 feat(home): the homepage, rebuilt ask-first (#204)
* feat(home): the homepage, rebuilt ask-first

The hero is the Ask box (chatkit composer plus four questions, one built from
the worst bottleneck); sending opens /chat with the question started. Worst
right now is one row component with a fixed gauge column; what changed falls
back to the sweep's unchecked finds or is absent, never an empty box; the
numbers are four equal linked cells; doors share one anatomy; the footer is
calm. The page is served from a 60 second cache: the shell learns its reader
from /api/me in the browser instead of reading the session while rendering.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE

* fix(home): centred column, aligned worst rows, broken-word scan

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018WZnBnaLP6RhwFkLxRTKgE

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-22 23:02:26 +02:00
Cato d0d8a04514 fix(chat): anchor composer to bottom and lock viewport scroll (#193)
- Make .ask-empty flex: 1 and overflow-y: auto so starters do not push the composer off-screen
- Anchor .ck-composer-wrap with position: sticky and bottom: 0
- Suppress site footer on /chat and lock .shell.is-chat height to visual viewport with overflow: hidden
- Update useViewportHeight on /chat to sync with documentElement
- Add automated tests in test/chat-scroll.test.ts verifying anchoring, scrollability, and shell locking
2026-10-22 01:07:58 +02:00
CatoandClaude Opus 5.5 f0a80823d8 One slip still finds it: searchkit in every search box (#179)
* feat(search): match with @bitbaum/searchkit; forgive a slip in every search box

Site search was the one box in the fleet with typo tolerance, and it carried
its own copies of what searchkit now does once for everyone: folding, an
edit distance, the typo budget, prefix lookup, highlight offsets and snippet
cutting. Those now come from the package. What stays is what is genuinely
this corpus's: the TF-IDF ranking over long documents with type weights and
phrase bonuses (search/score.ts), the narrow plural rule, the stop words, and
"a real word is never corrected".

A full swap to createSearch's tie-break ranking was tried against the golden
pairs and lost two: "gallium ch" put Chalco first (a two-letter prefix that
covers a one-word title outranks an exact rare word) and "quartz" put a
company above the quartz bottleneck (no term frequency). So searchkit decides
which words a typed word could mean (candidates) and where to mark them;
the ranking stays here.

Small gains in the engine: a slip in the word still being typed ("photres")
and in a word the corpus has only as the start of others ("canno" -> Canon)
now find it; marks use original offsets, so accented words are marked where
they stand. Real words are still never corrected, so result counts for them
are unchanged.

The other boxes had no tolerance at all and now share the package: the globe's
country finder and the palette's page list (search + marks), and the filter
boxes on Exposure, Data series and the desk (lib/text-filter.ts: membership
only, every word required, the table's own order kept). One slip in a country
or page name used to return nothing 96-97% of the time; success@1 is now
0.989 for both. Careers keeps its SQL substring, with a comment saying why.

Tests: generated typo suites (typoCases + evaluate) over company and country
names in site search, every country name in the finder, and every page label
in the palette, plus hand-picked slips and the existing golden pairs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6u11m24oVkG98wAVbN7nf

* chore(deps): add @bitbaum/searchkit, pinned to orangecat a868c0a9

The fleet's one search package, installed from orangecat by commit
(packages/searchkit). It ships compiled dist/, so no transpile step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6u11m24oVkG98wAVbN7nf

* docs(changelog): link the search entry to #179

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M6u11m24oVkG98wAVbN7nf

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-12 10:18:54 -07:00
CatoandClaude Opus 5.5 4f15398ffe feat(atlas): a named map, clearer chain headings, 12px floor, and three new globe shadings (#177)
* feat(atlas): a named map, clearer chain headings, 12px floor, and three new globe shadings

- The page heading reads "Global Resource Map – Location, Production, and
  Supply-Chain Connections" (still visually hidden over the full-bleed canvas).
- Chain diagram: column headings ("Goes into it", "Holds up") are larger and
  bold; the "Made by" list heading inside the card is lighter.
- Every atlas label below 12px now uses --text-label (12px); globe labels 12px.
- The sidebar's Explore heading carries a subtitle, "Interactive map,
  bottlenecks, policy" (config/site-nav.ts).
- The legend's Production/Reserves switch becomes a "Shade the globe by"
  picker: Production volumes, Reserves, Historical trend (one-year change in
  the same USGS table) and Risk heat-map (OECD export restrictions recorded).
  Trade flows and Environmental impact zones are listed as not yet available:
  no sourced country data for either is on file.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(changelog): atlas shadings and headings (#177)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 06:58:41 -07:00
CatoandClaude Opus 5.5 3707efbd58 fix(shell): Ask in the phone top bar, 'Sign in' instead of a dot; structural overlap test (#104)
- Phones: the floating Ask button covered the text above the tab bar; Ask now
  lives in the top bar (as Loki's does) and opens the same dock panel.
- Signed out, the account control reads 'Sign in' (label inside the control).
- test/ask-verify: 'the lookups overlapped' was a 20 ms stopwatch and flaked
  under load; it now checks both started before either ended (mutation-proven).

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 02:13:44 -07:00
CatoandClaude Opus 5.5 d7111fd34f feat(nav): one shell for every page — grouped sidebar, rail, phone tabs, ⌘K palette (#103)
The left panel had grown to 17 flat rows and the public header carried a
second, different grouping of the same pages. Replaced with the shell Loki
and OrangeCat already use: five sections grouped by what a reader is doing
(only the current one opens by itself), an icon rail at 768-1023px and on
collapse, four phone tabs plus More, account things in the account menu,
and the long tail in a command palette that also searches the index.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-25 01:44:30 -07:00