Skip to content

Smart search, SVG dedup, and infinite scroll#1285

Open
ekaya97 wants to merge 1 commit intoanomalyco:devfrom
ekaya97:feature/smart-search-filtering
Open

Smart search, SVG dedup, and infinite scroll#1285
ekaya97 wants to merge 1 commit intoanomalyco:devfrom
ekaya97:feature/smart-search-filtering

Conversation

@ekaya97
Copy link
Copy Markdown

@ekaya97 ekaya97 commented Mar 27, 2026

Motivation

models.dev is great but it's slow, consumes a bunch of memory, doesn't support filters or combinatory search.

In contrast to similar PRs, this PR addresses all of these issue with a very lightweight approach - without relying on TanStack Table or any other virtualization techniques. It supports in-browser search (Ctrl+F) across the entire dataset with bidirectional infinite-scroll pagination and SVG dedup - reducing browser memory load from ~1.5GB to 0.25GB

Summary

modelsdev.mp4
  • 6x reduction in browser memory — SVG deduplication via <symbol> definitions and <use> references reduces HTML payload from ~18MB to ~7MB. Infinite scroll reduces number of DOM elements by up to 40x.
  • Browser search (Ctrl+F) support — ghost rows with hidden="until-found" and selectionchange fallback ensure native find works across the full dataset
  • Tested on major browsers — Chrome, Firefox, Safari; includes requestIdleCallback shim and progressive enhancement for older browsers
  • Natural language search — smart search with AND logic (bedrock claude), keyword filters (in:image out:<5 p:openai), and sort keywords (sort:input, sort:-output)

Details

  • Infinite scroll with bidirectional sliding window (500-row cap) instead of rendering all ~4,000 rows
  • Filter chip toggles with smart-match highlighting from search keywords
  • Deferred ghost row building via requestIdleCallback to keep first paint fast
  • Layout shift prevention with table.not-ready opacity gate
  • Sort keywords auto-reset when removed from search; manual header sorts persist
  • Help dialog updated with keyword reference tables

Test plan

  • Verify Ctrl+F finds models across the full dataset (not just visible rows)
  • Test sort:input, sort:-output, sort:context trigger and reset correctly
  • Test keyword filters: in:image, out:<5, p:openai, f:claude, ctx:>100k
  • Test natural language: bedrock claude, reasoning vision, free
  • Scroll down past 500 rows, then scroll back up — rows restore in both directions
  • Test on Chrome, Firefox, and Safari

🤖 Generated with Claude Code

- Add smart search: AND text logic, keyword prefixes (in:, out:, ctx:, p:, f:, sort:), natural language keywords
- Add sort: keyword with short aliases (sort:input, sort:output, sort:context, etc.) with - prefix for descending
- Search-triggered sorts auto-reset when keyword is removed; header-click sorts persist
- SVG deduplication: symbols + use refs (HTML from 18MB to ~7MB)
- Infinite scroll with bidirectional sliding window (500-row cap)
- Ghost rows for Ctrl+F: hidden="until-found" with selectionchange fallback
- Filter chip toggles with smart-match highlighting
- Layout shift prevention with table.not-ready opacity
- Deferred ghost building via requestIdleCallback (with Safari shim)
- Help dialog with search keyword reference
- Add data-column attributes to th elements for robust column lookup

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ekaya97
Copy link
Copy Markdown
Author

ekaya97 commented Mar 27, 2026

PS: I realize +1411 and -240 for a single commit looks like a lot but most of that is CSS, content of "How to use" dialog and html data- attributes.

Tagging for visibility
@kylhuk
@sunipan
@gianpaj
@rekram1-node

@gianpaj
Copy link
Copy Markdown

gianpaj commented Mar 30, 2026

i like it! i didn't the main issue was SVG deduplication :D

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.

2 participants