Skip to content

Drop the logo to print the fxcss pick report - #93

Merged
adamXbot merged 2 commits into
websitefrom
feat/website-logo-picker
Oct 31, 2026
Merged

adamXbot merged 2 commits into
websitefrom
feat/website-logo-picker

Conversation

@adamXbot

@adamXbot adamXbot commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

Follow-up to #92. Dropping the dragged logo now does what a click does in fxcss pick: it picks the element and prints the CLI's report for it.

What changes

  • Pick card. Releasing over an element opens a terminal-style card beside it showing the tag and selector, classes (the site's own first, then a count after six), box, notable computed styles (the CLI's list and filtering), and the site's rules that match. Rules naming one of the element's classes come first, the site's own rules come before Tailwind's, and layered rules are marked with their layer. Copy selector copies the full selector, and a link goes to /docs/pick.
  • Dialog behaviour. It is a non-modal <dialog open> that takes focus. Escape or the close button returns focus to the logo. A press elsewhere, a new drag or leaving the page closes it. It is rendered as a sibling of the logo link, so React events from the portal don't reach the link.
  • Accidental drags. The logo lifts only once the pointer is more than 8px outside it, so a shaky click still goes home (previously 4px of movement lifted it and swallowed the click). Carrying the logo back onto itself, releasing outside the page or pressing Escape picks nothing and follows nothing. The outline disappears over the logo to show that dropping there cancels.
  • Time-machine themes. The report follows the page, so retro stops list their html[data-retro] rules. The card itself becomes an MS-DOS Prompt (1999, C:\>), Mac OS X Terminal (2003, %) or xterm (2002, $). The pink header stays, as in the real picker. Every text pair meets 4.5:1 and focus rings meet 3:1.
  • tsconfig.json enables allowImportingTsExtensions, so lib/pick-report.ts can import ./logo-picker.ts under Node's test runner.

Dependency audit fix

CI's audit started failing on GHSA-g3hv-75wg-m249 (published 30 October), which affects every minimatch release before 11.0.1. minimatch comes only from the shadcn CLI, through ts-morph and @ts-morph/common, which asks for ^10. There is no patched 10.x release, and the newest shadcn and ts-morph still ask for 10, so an override moves @ts-morph/common to minimatch 11.0.3. ts-morph calls only minimatch(path, pattern), which 11 keeps, and its glob matching and npx shadcn still work. The README says when to remove the override.

Testing

  • npm run typecheck, npm run lint, and npm test (40 passing, including rule matching and ordering, report wording, class shortening and the click slop).
  • npm run test:browser: 70 passing in Chromium and Firefox. New cases cover the report and copying, closing by Escape, by a press elsewhere, by a new drag and by the docs link, a shaky click going home, carrying the logo home, Escape mid-drag, and the card in all three time-machine stops.
  • Not covered by a browser test: releasing outside the window, because Playwright can't release the mouse outside the page reliably. In that case elementFromPoint returns null, so nothing is picked.

🤖 Generated with Claude Code

adamXbot and others added 2 commits October 31, 2026 23:50
Releasing a dragged logo over an element now picks it, as a click does in `fxcss pick`. A card beside the element prints the CLI's report for the live page: tag and selector, classes with the site's own first, box, notable computed styles, and the matching rules, with rules naming one of its classes first and Tailwind's layered rules marked by layer. It copies the selector and links to the `fxcss pick` documentation. It is a non-modal dialog that takes focus; Escape or its close button returns focus to the logo, and a press elsewhere, a new drag or leaving the page closes it.

The logo now lifts only once the pointer leaves it, so a shaky click still goes home. Carrying it back onto itself, releasing outside the page or pressing Escape picks nothing and follows nothing.

Each time-machine stop gets its own terminal: an MS-DOS Prompt in 1999, Terminal on Mac OS X in 2003 and an xterm in 2002, with contrast checked for every colour pair.

`allowImportingTsExtensions` lets `lib/pick-report.ts` import `./logo-picker.ts`, which Node's test runner needs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GHSA-g3hv-75wg-m249, published on 30 October, affects every minimatch release before 11.0.1 and fails the dependency audit. minimatch reaches the site only through the shadcn CLI, via ts-morph and @ts-morph/common, which asks for minimatch ^10. No 10.x release is patched, and the newest shadcn and ts-morph releases still ask for 10, so an override moves @ts-morph/common to 11.0.3. ts-morph calls only minimatch(path, pattern), which 11 keeps; its glob matching and the shadcn CLI still work. The README notes when to remove the override.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@adamXbot
adamXbot merged commit f77d5d8 into website Oct 31, 2026
3 checks passed
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