feat(sf-fe-a3): UI primitives — HeadlineBar + Badge + Drawer #341
No reviewers
Labels
No labels
admin
analytics
auth
automation
bug
business
chore
ci
compliance
data
data-moat
docs
duplicate
dx
enhancement
Fable 5 ревью
feedback/max
generative
GG-форсайт
needs-discussion
needs-human
observability
pause-bots
performance
priority/p0
priority/p1
priority/p2
priority/p3
scope/backend
scope/db
scope/devops
scope/frontend
scope/qa
scrapers
security
site-finder
stage/1
stage/2
status/blocked
status/done
status/needs-analysis
status/needs-fix
status/qa
status/ready
status/review
status/wip
tech-debt
tradein
ux
week ревью 1
wontfix
вторичка
ИРД
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lekss361/gendesign#341
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "feat/sf-fe-a3-primitives"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
SF Frontend Migration Wave 1 parallel со A1. 3 reusable UI primitives для Wave 2-4.
Files (6 NEW)
frontend/src/components/ui/HeadlineBar.tsx— dark verdict strip; propstitle,subtitle?,rightSlot?. Server component. CSS tokens (--bg-headline,--fg-on-dark,--fg-on-dark-muted)frontend/src/components/ui/Badge.tsx— inline-flex semantic badge. Variants:success | warning | danger | info | neutral. Sizes:sm | md. Icon slot (Lucide).frontend/src/components/ui/Drawer.tsx— accessible slide-in panel.side="right"(360px default) илиside="bottom"(mobile bottom-sheet). Click-outside, Escape, focus trap, body scroll lock, 180ms transition."use client".Constraints соблюдены
Open questions (non-blocking, можно отдельно)
--bg-headline,--success-soft, etc.) must be defined вglobals.css— UI Brief spec'ит их, но проверить что они в проекте. Если нет — fallback transparent.package.json— tests созданы, but won't run пока. Setup — отдельный PR.Next
Components готовы для use в A2 (EntryMap+Drawer для preview), A4 (HeadlineBar для analysis page header), Sections (Badge для статусов "Свежий", "Низкое покрытие" etc).
Part of plan vault
code/patterns/SiteFinder_Frontend_Migration_Plan_May18.md§A3.Deep Code Review — APPROVE
Drawer a11y completeness: focus trap (Tab/Shift+Tab wrap), Escape, click-outside via
target === currentTarget, body scroll lock with prev-value restore, focus save/restore viapreviousFocusRef,requestAnimationFrame+cancelAnimationFramecleanup. AlluseEffecthooks have proper cleanups — no leaks."use client"present. Minor:role="dialog" aria-modal="true"sit on the backdrop, not the panel (unusual but harmless);aria-labelledbyis left to callers — acceptable for a primitive.HeadlineBar: server component (no
"use client"), pure prop rendering.role="banner"is a small nitpick (site-level role) but not blocking.Badge: 5×2 lookup objects, no
any, nodangerouslySetInnerHTML.icon?: ReactNodeis broader than typedLucideIconbut more flexible — fine for a primitive slot.CSS tokens (MINOR, follow-up): confirmed no
globals.cssinfrontend/src/**and no:root { --bg-headline ... }block anywhere exceptfrontend/public/*.htmlstatic prototypes. Until a follow-up PR adds the tokens to a global stylesheet imported fromapp/layout.tsx, Drawer panels and HeadlineBar will render with transparent fallback (background: var(--bg-headline)→ unset). This isn't a regression — existingSection.tsx/KpiCard.tsxhardcode inline hex, so the tokens pattern was never wired. PR is correctly forward-looking.MarketTab.tsxuses two-argvar(--bg-headline, #0F172A)fallback — worth considering for this PR too, but not blocking.Tests (MINOR, follow-up): 15 tests in valid TS strict (would pass
tsc --noEmit).jest/@testing-library/reactnot inpackage.json, notestscript — tests unrunnable until setup PR. Acceptable per author's open question.Cross-file impact: zero callers yet, no signature/contract regressions. Safe to merge.
Merging.