Skip to content

Comments

refactor(ui): distributions of elements in package header#855

Closed
MatteoGabriele wants to merge 9 commits intonpmx-dev:mainfrom
MatteoGabriele:refactor/package-header-ui-distribution
Closed

refactor(ui): distributions of elements in package header#855
MatteoGabriele wants to merge 9 commits intonpmx-dev:mainfrom
MatteoGabriele:refactor/package-header-ui-distribution

Conversation

@MatteoGabriele
Copy link
Contributor

@MatteoGabriele MatteoGabriele commented Feb 3, 2026

These changes resolve several issues related to the current layout and element placement. They guarantee that the entire header experiences minimal element movement and overlaps.

The header, with its variable package name and numerous elements (version, provenance, badges, code, docs, etc.), can be very hard to maintain.
This becomes especially tricky as the screen size shrinks, causing misaligned elements.

The idea is to limit the number of variables at play:

  • the package name sits alone, with only the repository star count, which is a very important metric for how users judge whether to use a library or another
  • versions and badges sit right under the package name
  • the description stays the same
  • Various links and tabs are next to each other, which also makes more sense since the mobile view has them all together.

Notes

  • The org/name has been renamed simply using the provider name to avoid long names that eat space and repetition with the header title
  • The forks link has been removed. I can put it back, if everyone thinks it's very useful, but tbh, I feel it's the least important info I can get from the view, and it just takes space and visual attention.

Let me know what you think and if it needs adjustments

I've attached two videos: one with a small name and one with a longer name, to demonstrate that it works well in both cases.

Screen.Recording.2026-02-03.at.16.26.45.mov
Screen.Recording.2026-02-03.at.16.26.02.mov

@MatteoGabriele MatteoGabriele changed the title refactor(ui): better distributions of elements in package header refactor(ui): distributions of elements in package header Feb 3, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 3, 2026

📝 Walkthrough

Walkthrough

The PR reorganises the package page header into a compact, flex-based layout with a left column and right-aligned controls. Organisation/name rendering is now inline, the copy button is repositioned, version/provenance is presented inline, and metrics/actions are reflowed. External links are consolidated and internal Docs/Code/Compare navigation is retained with responsive behaviour and keyboard hints. Public API change: useRepoMeta(repositoryUrl) now destructures { repoRef, stars, starsLink } (forks and forksLink removed). Lines changed: +269 / -286.

Possibly related PRs

Suggested reviewers

  • danielroe
🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The pull request description clearly explains the layout refactoring objectives, specific changes made, and design decisions with supporting demo videos.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

@codecov
Copy link

codecov bot commented Feb 3, 2026

Codecov Report

❌ Patch coverage is 14.70588% with 58 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
app/pages/package/[...package].vue 14.70% 51 Missing and 7 partials ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

@vercel
Copy link

vercel bot commented Feb 3, 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 5, 2026 1:37pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Feb 5, 2026 1:37pm
npmx-lunaria Ignored Ignored Feb 5, 2026 1:37pm

Request Review

@graphieros
Copy link
Contributor

Looks great !
We discussed in chat about the removal of the fork-count, which does not reach consensus.
I personally think this metric has some merit, but would not mind not having if it improves the layout.

Copy link
Contributor

@wojtekmaj wojtekmaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works nicely for me

@jhroemer
Copy link
Contributor

jhroemer commented Feb 4, 2026

Awesome stuff, thanks for this @MatteoGabriele

@danielroe
Copy link
Member

I think I ended up somewhat implementing this in #1188

would you see if there's anything I missed or you still think needs to be done there, and if so, resolve conflicts? 🙏

I'll mark as draft in the interim.

@danielroe danielroe marked this pull request as draft February 8, 2026 23:17
@MatteoGabriele
Copy link
Contributor Author

Many improvements have been implemented, so I believe the PR is no longer needed. However, we might still want to consider relocating the tabs elsewhere, rather than next to the name, to prevent UI misalignment caused by longer names. Overall, it looks good, and I will close this one. 🙏

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.

5 participants