Skip to content

Filter paged Stock cards without loading the full inventory - #286

Merged
bliatun-code merged 1 commit into
mainfrom
codex/stock-card-filters
Nov 25, 2026
Merged

bliatun-code merged 1 commit into
mainfrom
codex/stock-card-filters

Conversation

@bliatun-code

Copy link
Copy Markdown
Owner

Filter paged Stock cards

Opening More filters and changing or clearing a filter now uses the Stock card reader. SQLite applies free text and all selected roll filters before grouping and pagination, so counts and remaining weight only include matching rolls. The same database snapshot supplies the distinct material and vendor choices across the whole inventory. A Client negotiates filter support independently of ordinary cards and free-text search, retains its complete offline capture, and rejects superseded responses.

Verification

  • A SQLite fixture puts a distinct material and vendor beyond the first 96 groups. A combined search and filter matches one member and checks its group count and weight, including ownership, legacy assigned status, low stock and home location. Empty rolls remain searchable with their own status filter.
  • Browser coverage includes opening More filters, resetting while an old filter response is in flight, A–B–A, filtering the full offline copy, and fallback with a Host that supports search but lacks filters.
  • The native Client test also cycles the Host/library generation during a filtered HTTP response.

Measurements

Production Chromium UI and release Rust with synthetic SQLite libraries. Each run starts on an open Stock tab, opens More filters, selects Lost, then resets the filters. At 10,000 rolls there is one lost roll in a large product group. The paired Client uses an authenticated loopback Host and starts with a complete offline copy. Medians of seven measured runs after two warm-ups, alternating before and after. Times include the UI update to the expected visible count. Byte counts include serialized requests and responses through completion, excluding transport headers and assets.

Library Spools Action Time, ms (before → after) Desktop bytes Client–Host bytes
Local 0 open 20.2 → 20.8 1,513 → 530 —
Local 0 select 12.9 → 13.2 0 → 546 —
Local 0 reset 13.2 → 12.8 0 → 530 —
Paired 0 open 70.3 → 21.0 1,447 → 569 4,566 → 1,240
Paired 0 select 12.7 → 13.3 0 → 585 0 → 1,242
Paired 0 reset 13.1 → 13.4 0 → 569 0 → 1,240
Local 10,000 open 158.9 → 54.6 10,045,377 → 3,334 —
Local 10,000 select 10.4 → 14.5 0 → 1,506 —
Local 10,000 reset 152.0 → 62.0 0 → 3,334 —
Paired 10,000 open 270.5 → 53.4 9,131,439 → 3,373 10,047,814 → 4,044
Paired 10,000 select 10.3 → 30.4 0 → 1,545 0 → 2,202
Paired 10,000 reset 258.2 → 62.5 0 → 3,373 0 → 4,044

Before this change, opening transferred the full inventory and subsequent actions used the rows already in memory. The new flow reads a bounded card page per action.

@bliatun-code
bliatun-code merged commit a0df197 into main Nov 25, 2026
10 checks passed
@bliatun-code
bliatun-code deleted the codex/stock-card-filters branch November 25, 2026 23:00
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