Skip to content

Search paged Stock cards without loading the full inventory - #285

Merged
bliatun-code merged 2 commits into
mainfrom
codex/stock-card-search
Nov 25, 2026
Merged

bliatun-code merged 2 commits into
mainfrom
codex/stock-card-search

Conversation

@bliatun-code

Copy link
Copy Markdown
Owner

Stock card search

The Stock tab now sends free text to the paged card reader. SQLite filters individual rolls across the whole inventory before computing group counts, remaining weight, previews and pagination. Search and clear refresh only the cards. The first input after a pause runs immediately, closely spaced edits share a short timer, and superseded reads cannot replace the current results.

The paired Client negotiates the search capability independently of ordinary stock cards and checks the Host, library and generation before applying the result. A Host that supports only the original cards falls back to the complete stock reader. Disconnected Clients search their saved complete capture. Compact reads preserve that capture.

Tests

  • SQLite covers a match in group 98 beyond the 96-card page, multiple terms, a single matching member and its weight, short roll references and literal wildcard characters.
  • The desktop browser exercises an in-flight search, a newer query, clearing the field, results after a generation change, the original card-only Host and disconnected search.
  • The native Client test cycles A–B–A while the authenticated Host search response is in flight and verifies that the saved full capture remains intact.

Search measurements

Production Chromium UI, release Rust, SQLite and an authenticated loopback Host. The paired Client already had a complete offline capture. Each sample starts on an open Stock tab and enters a QR search in one input event. At 10,000 rolls the sole hit is outside the three previews of the product group. At zero rolls the empty state remains visible. Times run from input to the rendered result with completed calls. JSON request and response body bytes exclude HTTP headers and static assets. Medians of seven measured samples per combination after two warm-ups, alternating versions.

Library Spools Time (ms), before → after Desktop bridge (bytes) Client–Host (body bytes)
Local 0 21.2 → 19.9 1,513 → 456 —
Paired 0 70.8 → 20.6 1,447 → 495 4,451 → 1,062
Local 10,000 155.2 → 37.1 10,045,398 → 1,426 —
Paired 10,000 269.9 → 36.9 9,131,460 → 1,465 10,047,720 → 2,032

@bliatun-code
bliatun-code merged commit e1fdf8e into main Nov 25, 2026
10 checks passed
@bliatun-code
bliatun-code deleted the codex/stock-card-search branch November 25, 2026 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant