Skip to content

Phase 4: Real GSMArena research, engine refactor, UI improvements - #1

Merged
devilforcex merged 1 commit into
mainfrom
arena/01a01c55-casescreenchecker
Aug 20, 2026
Merged

Phase 4: Real GSMArena research, engine refactor, UI improvements#1
devilforcex merged 1 commit into
mainfrom
arena/01a01c55-casescreenchecker

Conversation

@arena-ai-coding-agent

Copy link
Copy Markdown

Какво включва този PR

Фаза 0 — Demo изчистен (code hygiene)

  • Research tab вече не е скрит зад env flag
  • Server-only deps (express, cors, pg, ssh2) преместени в optionalDependencies
  • Zod validation на localStorage hydrate boundary

Фаза 1 — Реално търсене на модели

  • Нов src/utils/modelSearch.ts — нормализация, alias matching, Levenshtein fuzzy ranking
  • PhoneSearchBar: combobox с keyboard navigation (стрелки + Enter + Escape)
  • Динамични brand chips от данните
  • URL query params: ?model=samsung-a05s&cat=screen_protector

Фаза 2 — Engine & scoring

  • Config seam (engineConfig.ts) — теглата извадени от magic numbers
  • all_accessories dual path — отделни [Screen] + [Case] резултати
  • aspectRatio и islandWidthMm/islandHeightMm факторизирани в scoring
  • Inference никога не връща CONFIRMED_COMPATIBLE/EXACT_MATCH (max HIGHLY_LIKELY)
  • Pair lookup чрез Map<string, CompatibilityPair[]> — O(1) достъп

Фаза 3 — UI за гише

  • CompatibilityResultsView: min confidence filter, sort (score/verified/A-Z)
  • UNKNOWN в exhaustive switch с never check
  • VisualOverlayModal: i18n за всички лейбъли, Escape за затваряне
  • Dynamic SVG scale от max(H,W)
  • PhoneProfileCard: махнат фалшив verified specs badge
  • Accessibility: aria- атрибути на search combobox

🌐 Фаза 4 — Реално GSMArena търсене

  • server/utils/gsmarenaParser.ts — парсва HTML страниците на GSMArena
  • server/routes/research.ts — POST /api/v1/research endpoint
  • src/utils/researchCache.ts — клиентски localStorage кеш с 24h TTL
  • ExternalResearchPanel — пълен rewrite:
    • RESEARCHED badge за резултати от GSMArena
    • Promote to Catalog бутон
    • Edit specs преди добавяне
    • Source link към GSMArena

Тестове

39 теста, 4 test suites, всички минават

Build

  • TypeScript: чиста компилация
  • Production build: 356KB JS, 43KB CSS

- New server/utils/gsmarenaParser.ts — parses GSMArena HTML into PhoneModel
  (search results + specs page with dimensions, screen, camera, features)
- New server/routes/research.ts — POST /api/v1/research endpoint
  (scrapes GSMArena via axios + cheerio, validates with Zod)
- New src/utils/researchCache.ts — client-side 24h localStorage cache
- Rewrote ExternalResearchPanel.tsx — real GSMArena search with:
  - RESEARCHED badge, Promote to Catalog button
  - Edit specs before adding, view raw GSMArena data
  - Cache-first strategy, automatic duplicate skipping
- Research tab now always visible (replaces hidden demo tab)
- Separated server deps (express, cors, pg, ssh2) into optionalDependencies
- Added axios + cheerio for server-side scraping
- 39 tests total (+12 new): gsmarenaParser (5), researchCache (7)
- Production build succeeds (356KB JS, 43KB CSS)
- Clean TypeScript compilation

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
@vercel

vercel Bot commented Aug 20, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
case-screen-checker Ready Ready Preview Aug 20, 2026 12:19am

@devilforcex
devilforcex merged commit 0354fb9 into main Aug 20, 2026
2 of 4 checks passed
@devilforcex
devilforcex deleted the arena/01a01c55-casescreenchecker branch August 26, 2026 23:47
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