fix: prevent semver filter placeholder text from being truncated on s…#1992
Conversation
…mall mobile screens
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis pull request introduces a single CSS class addition to the semver filter input element in the Package Versions component. The class Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 1✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). 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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
alexdln
left a comment
There was a problem hiding this comment.
@iiio2 This changed the size not from 12px to 11px, but from 16px to 11px - https://github.com/npmx-dev/npmx.dev/blob/main/app/assets/main.css#L313
In general, we now try to avoid sizes smaller than 14px. Ideally, all sizes should be 16px+
Also, it's not recommended to use different sizes for placeholders and inputs - it disrupts user experience
I think this is a copyright issue - maybe we don't need the description in parentheses since we have a tooltip. imo we need a separate label "Filter by Semver" and placeholder like "^3.0.0 or >= 1.4.2"
@knowler maybe you already know some option, since all the solutions here are mixed with a11y
On iPhone SE 2nd gen (375px width, iOS 14.6), the semver filter placeholder text "Filter by semver (e.g. ^3.0.0)" in the Versions section gets truncated/cut off because the input field doesn't have enough horizontal space. The input uses font-mono at text-xs (12px) and shares its row with an info icon, gap spacing, and padding — leaving insufficient room for the full placeholder on narrow viewports.
Fix: Added max-sm:placeholder:text-2xs class to the filter input in
Versions.vue. This reduces the placeholder font size from 12px to 11px (text-2xs, defined in uno.config.ts) only on screens below the sm breakpoint. The typed text size remains at 12px, and wider screens are unaffected.Before:
After: