Skip to content

Viewer: search filtering, pagination, and per-sender hide with show-hidden toggle#22

Merged
zbuc merged 1 commit into
mainfrom
issue-21
Jul 22, 2026
Merged

Viewer: search filtering, pagination, and per-sender hide with show-hidden toggle#22
zbuc merged 1 commit into
mainfrom
issue-21

Conversation

@zbuc

@zbuc zbuc commented Jul 22, 2026

Copy link
Copy Markdown
Owner

Closes #21

Summary

Front-end only (web/ — the demo inherits these once #20 merges; no server or Rust changes):

  • Search: case-insensitive substring filter over sender addresses; resets to page 1 on input.
  • Pagination: client-side with a page-size selector (25/50/100/500, default 50, persisted), prev/next with "Page X of Y · N senders" info; page clamps when the row set shrinks.
  • Hide (🙈) per row: removes the sender from the list, subtracts its count from Total messages, and recomputes the distinct-senders and top-sender tiles. Persisted in localStorage, so hides survive reload.
  • Show hidden toggle: reveals hidden rows dimmed with an unhide (👁) button; totals continue to exclude hidden senders while shown. Page info notes "(N hidden)" when hides are active.

Sender strings remain rendered exclusively via textContent (attacker-controlled From: headers).

Testing

  • End-to-end against the real web binary with a synthetic 130-sender stats.db: page renders under the server's CSP with 50 rows and correct pager ("Page 1 of 3 · 130 senders").
  • Scripted interaction test in headless Chrome against the 84k demo dataset: search "chatterloop" narrows 1,419 → 8 senders; hiding the top sender subtracts exactly its 6,842 count (84,000 → 77,158) and promotes the next sender in the top tile; show-hidden reveals the dimmed row; localStorage holds the hidden list; unhide restores 84,000; next/prev paging works with correct disabled states.
  • Verified Generate the Pages demo from web/ at deploy time #20's build_demo.py still transforms the new assets cleanly (all anchors intact), so the Pages demo build keeps working whichever merges first.

- Search input filters senders by case-insensitive substring match
- Client-side pagination at 50 rows/page with prev/next and page info
- Each row gets a hide button that removes the sender from the list and
  subtracts its count from the Total messages tile; the distinct-senders
  and top-sender tiles recompute from the remaining senders. Hidden
  senders persist in localStorage.
- A "Show hidden" toggle reveals hidden rows dimmed, each with an unhide
  button; totals keep excluding hidden senders while they are shown.

Search and pagination compose (filtering resets to page 1; the page
clamps when rows disappear), and sender strings are still rendered only
via textContent since they come from arbitrary From: headers.

Closes #21
@zbuc
zbuc merged commit 5a6ec8c into main Jul 22, 2026
1 check passed
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.

Viewer: pagination, search filtering, and per-sender hide with show-hidden toggle

1 participant