Skip to content

Surface the 500-row cap in the Tweets tab#6

Merged
cybermejo merged 1 commit into
mainfrom
worktree-studio-tweets-cap-notice
Jun 18, 2026
Merged

Surface the 500-row cap in the Tweets tab#6
cybermejo merged 1 commit into
mainfrom
worktree-studio-tweets-cap-notice

Conversation

@cybermejo

Copy link
Copy Markdown
Owner

Summary

Surfaces the Tweets tab's 500-row render cap, which was previously applied silently.

Why

TweetsTab did .slice(0, 500) with no UI hint. On a large dataset, users filtering down would see exactly 500 rows and reasonably conclude matches were missing.

What changed

  • Split the memo: matched is the full filtered+sorted set; filtered = matched.slice(0, MAX_VISIBLE) is the render list.
  • The result counter now shows the true match count (matched.length of tweets.length), not the capped 500.
  • When matches exceed the cap, a line renders: "Showing the top 500 of N matches".
  • Extracted MAX_VISIBLE + capNotice() into src/lib/display.js — pure and unit-tested.

Testing

Adds src/lib/display.test.js (4 tests: at/below cap → null, above cap, thousands formatting, default cap). Build green; 44 tests pass.

Note: this is the lightweight half of the original review item. Full list virtualization (react-window) is the heavier scale answer and is intentionally out of scope here.

TweetsTab sliced filtered results to 500 with no UI indication, so on large
datasets users would believe matching tweets were missing.

- Compute the full match count (matched) separately from the capped render list
  (filtered = matched.slice(0, MAX_VISIBLE)); the result count now reads the true
  total, not the capped 500.
- Show 'Showing the top 500 of N matches' when matches exceed the cap.
- Extract MAX_VISIBLE + capNotice into lib/display.js (pure, unit-tested).

Adds lib/display.test.js (4 tests). Build + 44 tests green.
@cybermejo
cybermejo merged commit 9b90607 into main Jun 18, 2026
4 checks passed
cybermejo pushed a commit that referenced this pull request Jun 18, 2026
PR #10 (config/query/api/cli split + __main__.py) had merged into its stacked
base branch but not into main, which still carried the flat tweet_scraper.py.
Bring the split to main. Touches only scraper/CI/docs — no Studio files, so the
PR #6/#7 Studio work is untouched. CLAUDE.md auto-merged (kept the PR #8 Studio
note + the split's python -m updates). Validation loop green: 65 tests, mypy on
the package, python -m tweet_scraper verified.
@cybermejo
cybermejo deleted the worktree-studio-tweets-cap-notice branch June 18, 2026 03:17
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