Skip to content

refactor: add radio and checkbox component#1476

Draft
essenmitsosse wants to merge 16 commits intonpmx-dev:mainfrom
essenmitsosse:replace-buttons-links
Draft

refactor: add radio and checkbox component#1476
essenmitsosse wants to merge 16 commits intonpmx-dev:mainfrom
essenmitsosse:replace-buttons-links

Conversation

@essenmitsosse
Copy link
Copy Markdown
Contributor

This adds a button and checkbox component and replaces all things I could find that were button before but should be a radio or checkbox. It doesn't touch the SettingsToggle component, which is also a checkbox.

The radio button also replaces the previous TagRadioButton

For the checkboxes I added a variant, that looks like a toggable button. For the radio buttons I didn't. I am going to leave this PR as a draft, because I am sure there is some discussion to be had.

The goal of this PR should be to move all things that should be radio/checkboxes to an abstract component. I don't think these components need to be functionally or visually perfect just now. Having only one place to maintain them should be a benefit in itself. So I think we should try not to get lost in detailed "how round should the focus be" discussions. I also think surfacing that something is a radio/checkbox in the UI by actually displaying it can be good intermediate step to make everybody think more consciously about UX dicisions. What I mean by that: 'Maybe if too many radio buttons look to crowded, the problem is not showing them, but having so many of them' — maybe.

Screenshot 2026-02-13 at 20 26 14 Screenshot 2026-02-13 at 20 30 48

Screenshot 2026-02-13 at 20 30 23 Screenshot 2026-02-13 at 20 37 06

@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Feb 13, 2026

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

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Feb 13, 2026 7:39pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Feb 13, 2026 7:39pm
npmx-lunaria Ignored Ignored Feb 13, 2026 7:39pm

Request Review

@essenmitsosse
Copy link
Copy Markdown
Contributor Author

@knowler @alexdln could you take a look if you like the general direction of this or have any remarks, especially regarding regressions? This would move the majority of inputs and buttons into a few abstract components. If you think this generally looks fine I can fix the tests and rebase.

@alexdln
Copy link
Copy Markdown
Member

alexdln commented Feb 26, 2026

The checkbox in the columns is currently 14x14 and looks a bit small. Maybe let's make it 1.2em

Also, let's make the color accent-accent, otherwise the blue looks too default

image

Regarding the facets logic - I like it and wanted to talk about this too. But it seems like the logic is broken somewhere now. Also, I'm a bit worry that this is a very complex logic, maybe we should postpone it until post-launch (or at least to separate PR)?

Based on the tag style, making them brightly colored looks better, but it's a bit too bright when there are a lot of them, and when active, it requires a different hover effect (at the end of the video, when you hover over a tag, it's unclear whether it's activated or not)

Screen.Recording.2026-02-26.111332.mp4

Regarding the versions, I think this version of toggle is very specific for us. They've already been updated into a unified look in production, but I'm in favor of a redesigning it anyway, but to something like for filters toggle (PR, discord). Maybe the design of the active tag can also be taken from here

Preview/prod/mentioned toggle
image
image
image

I like the idea of ​​radio filters, but not for the search category. It's like the search category is more like a select or a toggle-group. It also seems better to reduce the indents to gap-6 instead of gap-8. And let's use accent-accent as well
image

@github-actions github-actions Bot added the stale This has become stale and may be closed soon label Apr 18, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 18, 2026

Important

Review skipped

Auto reviews are limited based on label configuration.

🚫 Review skipped — only excluded labels are configured. (1)
  • release

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ffd363df-52cd-49e8-9957-35466816082d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@npmx-dev npmx-dev deleted a comment from github-actions Bot Apr 18, 2026
@github-actions github-actions Bot removed the stale This has become stale and may be closed soon label Apr 19, 2026
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.

2 participants