feat: add sidebar toggle to package code browser#2352
feat: add sidebar toggle to package code browser#2352jfernsio wants to merge 2 commits intonpmx-dev:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
|
Hello! Thank you for opening your first PR to npmx, @jfernsio! 🚀 Here’s what will happen next:
|
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
📝 WalkthroughWalkthroughThis pull request implements a sidebar toggle feature for the package code viewer. The Vue component now manages sidebar visibility state through computed properties linked to user settings, with a new button in the header to toggle between collapsed and expanded states. The button includes dynamic icons and translations based on the sidebar state. Supporting translation entries for "Show sidebar" and "Hide sidebar" have been added to the English locale file. Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
app/pages/package-code/[[org]]/[packageName]/v/[version]/[...filePath].vue (1)
389-390: Use global focus-visible styling for this button instead of inline utility classes.On Line 389,
focus-visible:outline-accent/70should be removed to follow the project’s shared button/select focus pattern.Suggested diff
- class="hidden md:flex items-center justify-center w-8 h-8 text-fg-subtle hover:text-fg transition-colors focus-visible:outline-accent/70 rounded" + class="hidden md:flex items-center justify-center w-8 h-8 text-fg-subtle hover:text-fg transition-colors rounded"Based on learnings, focus-visible styling for
button/selectshould be applied globally viaapp/assets/main.css, not per-element utility classes.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 21d559b3-820f-46e9-91d7-648a9ccb385a
📒 Files selected for processing (2)
app/pages/package-code/[[org]]/[packageName]/v/[version]/[...filePath].vuei18n/locales/en.json
🔗 Linked issue
Resolves #2058
🧭 Context
The package code browser previously had a fixed file tree sidebar that took up space even when not needed. This change adds a simple toggle to show/hide the sidebar, giving users better control over screen space on the code page
📚 Description
I implemented a sidebar toggle for the package code browser instead of full resizability. The toggle is simple, persistent, and matches the existing UI patterns.
Changes made:
Before :
After :