Skip to content

Card flip: screenshot backgrounds + front/back flip card - #7

Open
ekoslow1-creator wants to merge 20 commits into
mainfrom
worktree-project-card-screenshot-backgrounds
Open

Card flip: screenshot backgrounds + front/back flip card#7
ekoslow1-creator wants to merge 20 commits into
mainfrom
worktree-project-card-screenshot-backgrounds

Conversation

@ekoslow1-creator

Copy link
Copy Markdown
Collaborator

Summary

  • Replace whole-card link with a front/back flip card (title-only link on front, tags + description on back)
  • Layer project website screenshot backgrounds (with scrim) into ProjectCard
  • Add npm run screenshots to pre-generate project website screenshots into a manifest
  • Accessibility/UX fixes: hide flipped front-face link from keyboard/a11y tree, disable pointer-events on hidden face, prevent flip-away on text selection, hover color on title

Test plan

  • npm run dev and confirm cards flip on click/hover as expected
  • Verify keyboard navigation doesn't focus the hidden front-face link when flipped
  • Verify text selection on the card doesn't trigger a flip
  • npm test

Replaces #5, which GitHub auto-closed and permanently locked after a history rewrite (removing a sensitive CSV) force-pushed the branch. Same content as #5, minus the CSV.

Sefaria Intern and others added 20 commits July 28, 2026 13:09
…r bucketing

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…pty experience trend

- getToolUsageCounts now filters sefaria_tools_used to string entries before
  normalizing, so a non-string entry (null, number, etc.) in this free-text
  user-submitted field is skipped instead of throwing and blanking out all
  four Charts & Analytics charts via the outer catch handler.
- Move the experienceTrend.length === 0 empty-state message inline (matching
  the pie chart's own conditional-render guard) instead of an early return,
  so the two bar charts and the pie chart still render when there's no
  experience-level data.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Shares VIBE_CODED_SERIES between submissionsTrend.js and
ChartsAndAnalytics.jsx (mirroring the EXPERIENCE_LEVELS precedent)
instead of hardcoding the strings twice, and adds a one-sentence
caption noting vibe_coded is a newly-tracked field so the chart isn't
misread as a real overnight trend reversal.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Extracts known technology names from the free-text tech_used_raw field
via case-insensitive substring matching, with "Claude Code" checked and
excluded first so it doesn't double-count toward the generic
Claude/Anthropic API bucket. Shows the top 8 by project count as a
horizontal bar chart, matching the existing keyword-frequency chart's style.
Reuses the fixed-order categorical hue palette already used in the
charts (blue/orange/aqua/violet/magenta, gray for Uncategorized).
Background and border are computed via color-mix() at low strength
so each pill stays pale; text is mixed toward --text-h for a muted
look instead of a fully saturated hue.
…chart

Recharts' category axis auto-hides tick labels it calculates would
overlap; interval={0} disables that, and the wider axis column gives
longer labels like "Claude/Anthropic API" room to fit.
…, screenshot URL validation)

- screenshots.test.js: update the positive-case test to expect the real
  manifest path now that screenshotManifest.json is populated, and add a
  case covering the numeric id form used by ProjectCard.jsx
- index.css: give has-screenshot cards their own hover background on the
  scrim pseudo-element so hovering isn't washed out by the 88%-opacity
  overlay
- generate-screenshots.mjs: validate project_link before navigating to it,
  rejecting non-http(s) schemes and localhost/private/link-local hosts to
  close an SSRF/file-read path from unauthenticated submissions
The flip-card's hidden face was still hit-testable in the region behind
the visible face's centered content (backface-visibility only affects
painting, not pointer events), so clicking the center of a flipped-back
card could trigger the hidden front title's link instead of unflipping.
Scope pointer-events to whichever face is currently visible.

Also add a hover color (var(--accent)) on the project title link, per
request, as a visual affordance that it's clickable.
…ip-away on text selection, remove stale CSS

- Add visibility: hidden alongside pointer-events: none on the flipped
  front face so the title link is removed from the tab order and
  accessibility tree while visually hidden.
- Guard the card's click-to-flip handler against active text selections
  so releasing a text-selection drag inside the back-face description
  no longer flips the card away.
- Remove stale position: relative on .project-card (no longer needed
  now that faces position against .project-card-inner).
- Update stale comment on .project-card-desc to reflect the back-face
  layout (no image/title/link on that face anymore).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@gitvelocity-reviewer

Copy link
Copy Markdown

📊 Code Quality Score: 60/100

60 (base) × 1.0 (ESF, Extra Large 809 lines) = 60

Category Score Factors
🔭 Scope 15/20 8+ files across scripts/components/utils/CSS/data; new dev tool (Puppeteer script); new public-facing flip-card UI; 3 new utility modules; new npm dependency; screenshot manifest and binary assets added
🏗️ Architecture 10/20 New screenshot pipeline (script → manifest → utility → component); new chart data pipeline (3 utils feeding ChartsAndAnalytics); flip-card pattern is a new UI abstraction; follows existing patterns without introducing new service boundaries
⚙️ Implementation 13/20 runPool concurrency pool implementation; normalizeEndpoint longest-match algorithm with pre-sorted array; CSS 3D flip with backface-visibility and pointer-events management; isSafeUrl SSRF mitigation; color-mix() CSS for dynamic category colors; cross-coordinate-space layout math in CSS
⚠️ Risk 8/20 External URL navigation via Puppeteer with incomplete SSRF mitigation (+4); binary JPEG assets and generated manifest committed to repo (+2); no fetch timeout on API call (+1); no auth/DB changes; easily reversible (-1)
✅ Quality 11/15 Good unit test coverage for all 5 new utility modules; edge cases covered (non-string inputs, deduplication, boundary conditions); inline comments explain recharts workaround and CSS math; no integration tests for screenshot script; manifest artifact management is a quality concern
🔒 Perf / Security 3/5 isSafeUrl present but missing 172.16/12 range and IPv6 ULA/link-local; JPEG quality=60 is a reasonable bandwidth choice; no AbortSignal timeout on fetch; networkidle2 can hang on long-polling sites

Was this score accurate? 👍 Yes · 👎 No

How this was scored →

Scored by GitVelocity · How are scores calculated?

@ekoslow1-creator

Copy link
Copy Markdown
Collaborator Author

Comments:

  • Some changes here as well, mostly that we need to take the screenshots out.
  • Instead of committing the screenshots to the repository, we should upload them to google cloud storage and include links in the data we're migrating to the DB. Will create a card for this, for now - please remove these screenshots from the PR and code.
  • src/data/screenshotManifest.json: Assuming this is irrelevant once we take the screenshots out, please confirm and if so - remove this file.
  • scripts/generate-screenshots.mjs: We can keep this script for now, it may need to live elsewhere (like our forthcoming automation - i.e. upon project submission we run a script to collect a screenshot) but for now let's keep it in and only delete the actual screenshots themselves.
  • src/utils/screenshots.js: Let's also get rid of this
  • src/utils/screenshots.test.js: Also get rid of this
  • src/utils/sefariaTools.test.js: Let's put the test files in a separate test subdirectory
  • src/utils/submissionsTrend.js: I'm not sure what's going on here, can you reply with an explanation of the logic and why it is needed?

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