Skip to content

fix: package code page improvements - #2217

Merged
alexdln merged 30 commits into
npmx-dev:mainfrom
alex-key:fix/docs-page-improvements
Apr 2, 2026
Merged

fix: package code page improvements#2217
alexdln merged 30 commits into
npmx-dev:mainfrom
alex-key:fix/docs-page-improvements

Conversation

@alex-key

Copy link
Copy Markdown
Contributor

🔗 Linked issue

Resolves#1942

🧭 Context

Code page has multiple minor issues (including mobile view). Also we want to align with existing Figma mocks.

📚 Description

  • added container toggle button (standard / full-width)
  • separated two components for better code maintenance: CodeHeader, CodeSkeletonLoader
  • all buttons with text replaced with icon buttons
  • mobile: breadcrumbs (file path) now has dropdown with all segments except the last one
  • loading state fixed not to shoe empty state in page load
  • other minor visual fixes
Screenshotsimageimageimageimage

@vercel

vercelBot commented Mar 22, 2026

Copy link
Copy Markdown
Contributor

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

ProjectDeploymentActionsUpdated (UTC)
npmx.devReadyReadyPreview, CommentApr 1, 2026 10:31pm
2 Skipped Deployments
ProjectDeploymentActionsUpdated (UTC)
docs.npmx.devIgnoredIgnoredPreviewApr 1, 2026 10:31pm
npmx-lunariaIgnoredIgnoredApr 1, 2026 10:31pm

Request Review

@github-actions

github-actionsBot commented Mar 22, 2026

Copy link
Copy Markdown

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

FileNote
i18n/locales/ar.jsonLocalization changed, will be marked as complete. 🔄️
i18n/locales/az-AZ.jsonLocalization changed, will be marked as complete. 🔄️
i18n/locales/bg-BG.jsonLocalization changed, will be marked as complete. 🔄️
i18n/locales/bn-IN.jsonLocalization changed, will be marked as complete. 🔄️
i18n/locales/cs-CZ.jsonLocalization changed, will be marked as complete. 🔄️
i18n/locales/de.jsonLocalization changed, will be marked as complete. 🔄️
i18n/locales/en.jsonSource changed, localizations will be marked as outdated.
i18n/locales/es.jsonLocalization changed, will be marked as complete. 🔄️
i18n/locales/fr-FR.jsonLocalization changed, will be marked as complete. 🔄️
i18n/locales/hi-IN.jsonLocalization changed, will be marked as complete. 🔄️
i18n/locales/hu-HU.jsonLocalization changed, will be marked as complete. 🔄️
i18n/locales/id-ID.jsonLocalization changed, will be marked as complete. 🔄️
i18n/locales/it-IT.jsonLocalization changed, will be marked as complete. 🔄️
i18n/locales/ja-JP.jsonLocalization changed, will be marked as complete. 🔄️
i18n/locales/kn-IN.jsonLocalization changed, will be marked as complete. 🔄️
i18n/locales/mr-IN.jsonLocalization changed, will be marked as complete. 🔄️
i18n/locales/nb-NO.jsonLocalization changed, will be marked as complete. 🔄️
i18n/locales/ne-NP.jsonLocalization changed, will be marked as complete. 🔄️
i18n/locales/pl-PL.jsonLocalization changed, will be marked as complete. 🔄️
i18n/locales/pt-BR.jsonLocalization changed, will be marked as complete. 🔄️
i18n/locales/ru-RU.jsonLocalization changed, will be marked as complete. 🔄️
i18n/locales/ta-IN.jsonLocalization changed, will be marked as complete. 🔄️
i18n/locales/te-IN.jsonLocalization changed, will be marked as complete. 🔄️
i18n/locales/tr-TR.jsonLocalization changed, will be marked as complete. 🔄️
i18n/locales/uk-UA.jsonLocalization changed, will be marked as complete. 🔄️
i18n/locales/vi-VN.jsonLocalization changed, will be marked as complete. 🔄️
i18n/locales/zh-CN.jsonLocalization changed, will be marked as complete. 🔄️
i18n/locales/zh-TW.jsonLocalization changed, will be marked as complete. 🔄️
Warnings reference
IconDescription
🔄️The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

@alex-keyalex-key changed the title Fix/docs page improvementsfix: code page improvementsMar 22, 2026
@codecov

codecovBot commented Mar 22, 2026

Copy link
Copy Markdown

Codecov Report

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

Files with missing linesPatch %Lines
app/components/Code/Header.vue69.86%19 Missing and 3 partials ⚠️
app/composables/useSettings.ts66.66%2 Missing ⚠️
app/components/Code/MobileTreeDrawer.vue50.00%1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@coderabbitai

coderabbitaiBot commented Mar 22, 2026

Copy link
Copy Markdown
Contributor

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This pull request refactors the package code page UI by extracting header logic (breadcrumbs, clipboard actions, markdown view mode toggles, raw file links) into a new CodeHeader component. It introduces CodeSkeletonLoader for pending file-load states, adds fullscreen container toggle functionality via useCodeContainer composable, exposes a toggle method on MobileTreeDrawer for programmatic control, adds a flex-split UnoCSS shortcut, and removes "root" and "raw" localisation keys whilst adding new action-specific labels (copy_content, toggle_container, open_raw_file, open_path_dropdown) across all i18n locales and schema.

Possibly related PRs

Suggested labels

front

Suggested reviewers

  • alexdln
  • ghostdevv
  • graphieros
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check nameStatusExplanationResolution
Out of Scope Changes check❓ InconclusiveThe PR includes extensive i18n locale file changes (removing code.root and code.raw keys) and hi-IN.json with broader restructuring that appear tangential to the primary #1942 objectives, though related to UI label alignment.Clarify whether the widespread i18n changes (especially hi-IN.json restructuring and brand/logo_menu additions) are necessary for #1942 or represent separate refactoring work that should be split into a distinct PR.
✅ Passed checks (2 passed)
Check nameStatusExplanation
Description check✅ PassedThe pull request description is clearly related to the changeset, detailing added components, container toggle, mobile breadcrumb dropdown, loading state fixes, and icon button replacements.
Linked Issues check✅ PassedThe PR addresses all primary objectives from issue #1942: added container toggle (standard/full-width), replaced text buttons with icon buttons, implemented mobile breadcrumb dropdown, fixed loading state to show skeleton loaders instead of empty state, and separated components.

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

✨ 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.

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🧹 Nitpick comments (1)
app/components/Code/Header.vue (1)

212-216: Drop the inline focus-visible utility from these tab buttons.

This override fights the shared button focus treatment the repo already applies globally.

Suggested fix
- class="px-2 py-1.5 font-mono text-xs rounded transition-colors duration-150 focus-visible:outline-accent/70 inline-flex items-center gap-1.5"+ class="px-2 py-1.5 font-mono text-xs rounded transition-colors duration-150 inline-flex items-center gap-1.5"

Based on learnings, focus-visible styling for buttons and selects is applied globally via main.css with button:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3e125d40-6732-4e45-bc29-aec26bc64cb9

📥 Commits

Reviewing files that changed from the base of the PR and between 7f2fc1a and dfd662e.

📒 Files selected for processing (9)
  • app/components/Code/DirectoryListing.vue
  • app/components/Code/Header.vue
  • app/components/Code/MobileTreeDrawer.vue
  • app/components/Code/SkeletonLoader.vue
  • app/components/Code/Viewer.vue
  • app/composables/useSettings.ts
  • app/pages/package-code/[[org]]/[packageName]/v/[version]/[...filePath].vue
  • i18n/locales/en.json
  • uno.config.ts

Comment threadapp/components/Code/Header.vue Outdated
Comment threadapp/components/Code/Header.vue
Comment threadapp/components/Code/Header.vue
Comment threadapp/pages/package-code/[[org]]/[packageName]/v/[version]/[...filePath].vue Outdated
@ghostdevv
ghostdevv marked this pull request as draft March 22, 2026 21:24
@ghostdevv

Copy link
Copy Markdown
Member

(gonna mark as draft as you work on it, feel free to mark as ready when you want a review!)

@alex-keyalex-key changed the title fix: code page improvementsfix: package code page improvementsMar 22, 2026

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 67cb48ea-c1f8-4b52-9336-96c0ac934347

📥 Commits

Reviewing files that changed from the base of the PR and between dfd662e and 40071d0.

📒 Files selected for processing (4)
  • app/components/Code/Header.vue
  • app/composables/useSettings.ts
  • i18n/locales/en.json
  • test/nuxt/a11y.spec.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/components/Code/Header.vue

Comment threadtest/nuxt/a11y.spec.ts Outdated
@alex-key

Copy link
Copy Markdown
ContributorAuthor

@alexdln appreciate a review from you

@coderabbitaicoderabbitaiBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 5

🧹 Nitpick comments (2)
test/nuxt/a11y.spec.ts (1)

1163-1191: Add one loading-state a11y case for CodeHeader.

This test covers the loaded file state well; adding a loading: true scenario would better guard the loading UX changes in this PR.

As per coding guidelines "Write unit tests for core functionality using vitest."

app/pages/package-code/[[org]]/[packageName]/v/[version]/[...filePath].vue (1)

336-336: Consider documenting the height calculation.

The h-[calc(100vh-10.5rem)] relies on a specific header height. If header dimensions change, this could break. A brief comment explaining the calculation basis (e.g., /* 10.5rem = sticky header + tabs */) would aid future maintenance.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 22686175-ed49-465f-a24a-b56f1fdc9dea

📥 Commits

Reviewing files that changed from the base of the PR and between 40071d0 and 1d9e72a.

📒 Files selected for processing (32)
  • app/components/Code/Header.vue
  • app/components/Code/SkeletonLoader.vue
  • app/pages/package-code/[[org]]/[packageName]/v/[version]/[...filePath].vue
  • i18n/locales/ar.json
  • i18n/locales/az-AZ.json
  • i18n/locales/bg-BG.json
  • i18n/locales/bn-IN.json
  • i18n/locales/cs-CZ.json
  • i18n/locales/de-DE.json
  • i18n/locales/en.json
  • i18n/locales/es.json
  • i18n/locales/fr-FR.json
  • i18n/locales/hi-IN.json
  • i18n/locales/hu-HU.json
  • i18n/locales/id-ID.json
  • i18n/locales/it-IT.json
  • i18n/locales/ja-JP.json
  • i18n/locales/kn-IN.json
  • i18n/locales/mr-IN.json
  • i18n/locales/nb-NO.json
  • i18n/locales/ne-NP.json
  • i18n/locales/pl-PL.json
  • i18n/locales/pt-BR.json
  • i18n/locales/ru-RU.json
  • i18n/locales/ta-IN.json
  • i18n/locales/te-IN.json
  • i18n/locales/tr-TR.json
  • i18n/locales/uk-UA.json
  • i18n/locales/zh-CN.json
  • i18n/locales/zh-TW.json
  • i18n/schema.json
  • test/nuxt/a11y.spec.ts
✅ Files skipped from review due to trivial changes (2)
  • i18n/locales/en.json
  • app/components/Code/SkeletonLoader.vue
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/components/Code/Header.vue

Comment threadi18n/locales/ar.json
Comment threadi18n/locales/hu-HU.json
Comment threadi18n/locales/it-IT.json
Comment threadi18n/locales/pl-PL.json
Comment threadi18n/locales/pt-BR.json
@ghostdevv
ghostdevv marked this pull request as draft March 23, 2026 04:47
@alex-key

Copy link
Copy Markdown
ContributorAuthor

@ghostdevv Why is it draft again?

@alex-key

Copy link
Copy Markdown
ContributorAuthor

Screen.Recording.2026-03-28.111509.mp4
the frame rate doesn't show it properly, but it's every time from a narrow container to a wide one (looks like in video it's clear only twice)

Fixed

Comment threadapp/pages/package-code/[[org]]/[packageName]/v/[version]/[...filePath].vue Outdated
Comment threadapp/pages/package-code/[[org]]/[packageName]/v/[version]/[...filePath].vue Outdated
alex-keyand others added 2 commits April 1, 2026 18:14
…ilePath].vue
Co-authored-by: Alex Savelyev <91429106+alexdln@users.noreply.github.com>

@alexdlnalexdln left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm, thanks ❤️

@alexdln
alexdln added this pull request to the merge queueApr 2, 2026
Merged via the queue into npmx-dev:main with commit 95c2aaeApr 2, 2026
20 of 21 checks passed
@github-actionsgithub-actionsBot mentioned this pull request Apr 2, 2026
@serhalpserhalp modified the milestones: v0.8.0, v0.9.0Apr 7, 2026
@serhalpserhalp modified the milestones: v0.9.0, v0.8.0Apr 7, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Released

Development

Successfully merging this pull request may close these issues.

Package code page: mobile version improvements

5 participants

@alex-key@ghostdevv@alexdln@serhalp@gassa-curated