Repository navigation
feat(comparison): add 1-click preset chips to home page empty state - #224
Conversation
|
@1-DARK is attempting to deploy a commit to the osama's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Thank you for the pull request! ✅ A maintainer will review this soon. Please be patient while we take a look. 🙌 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
O2sa
left a comment
There was a problem hiding this comment.
One change I'd request before merging: this PR currently includes commit 3bd5737 (feat(profile): add Get README Badge dialog...), which belongs to PR #223. GitHub shows both commits as part of this PR, and user-profile-client.tsx is therefore included in the changed files.
Please rebase/clean up the branch against main so PR #224 contains only the comparison preset changes. This will keep the PR isolated and prevent the changes from #223 from being merged through this PR.
The preset implementation itself looks good to me.
2dca45d to
8f04133
Compare
8f04133 to
738b2ca
Compare
738b2ca to
42183dc
Compare
|
✨ Thank you, @1-DARK! Another great contribution merged! 🚀 We truly appreciate your continued support! If you find this tool useful, please consider giving us a ⭐ star on GitHub—it helps more developers find our work and motivates us to keep improving! |
Summary
Adds clickable example-comparison chips under the compare form so first-time visitors can see the product in action with one click and zero typing.
Closes #220
Changes
config/comparison-presets.ts: new curated list of well-known open-source developer pairs (username pair + translation key per preset),plus an exported
ComparisonPresettype.components/preset-pills.tsx: new accessible chip list component (native<button>elements, labelled section,aria-busywhile loading).components/home-page-client.tsx: renders the chips directly underCompareFormwhile no comparison result is shown. Clicking a chip fillsusername1/username2and callshandleComparewith the preset values directly (not via state, to avoid stale values), respecting the currently selected languages.locales/en.json,locales/ar.json: addedpresets.titleand a label key for each preset.Behavior
!displayData), including after an error so users can recover with one click.Accessibility
<button type="button">: Tab to focus, Enter/Space to activate.focus-visiblering using theme tokens.aria-labelledby; list markedaria-busyduring load.prefers-reduced-motion(motion-reduce).i18n
en.jsonandar.json.Testing
pnpm validate-localespnpm testnpx tsc --noEmitpnpm lint/pnpm format:checkpnpm build/api/comparerequest is made per clickScreenshots
Light / dark