Skip to content

fix: package code page improvements#2217

Open
alex-key wants to merge 12 commits intonpmx-dev:mainfrom
alex-key:fix/docs-page-improvements
Open

fix: package code page improvements#2217
alex-key wants to merge 12 commits intonpmx-dev:mainfrom
alex-key:fix/docs-page-improvements

Conversation

@alex-key
Copy link
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
Screenshots image image image image

@vercel
Copy link

vercel bot commented Mar 22, 2026

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

Project Deployment Actions Updated (UTC)
docs.npmx.dev Ready Ready Preview, Comment Mar 23, 2026 9:40pm
npmx.dev Ready Ready Preview, Comment Mar 23, 2026 9:40pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
npmx-lunaria Ignored Ignored Mar 23, 2026 9:40pm

Request Review

@github-actions
Copy link

github-actions bot commented Mar 22, 2026

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

File Note
i18n/locales/ar.json Localization changed, will be marked as complete. 🔄️
i18n/locales/az-AZ.json Localization changed, will be marked as complete. 🔄️
i18n/locales/bg-BG.json Localization changed, will be marked as complete. 🔄️
i18n/locales/bn-IN.json Localization changed, will be marked as complete. 🔄️
i18n/locales/cs-CZ.json Localization changed, will be marked as complete. 🔄️
i18n/locales/de-DE.json Localization changed, will be marked as complete. 🔄️
i18n/locales/en.json Source changed, localizations will be marked as outdated.
i18n/locales/es.json Localization changed, will be marked as complete. 🔄️
i18n/locales/fr-FR.json Localization changed, will be marked as complete. 🔄️
i18n/locales/hi-IN.json Localization changed, will be marked as complete. 🔄️
i18n/locales/hu-HU.json Localization changed, will be marked as complete. 🔄️
i18n/locales/id-ID.json Localization changed, will be marked as complete. 🔄️
i18n/locales/it-IT.json Localization changed, will be marked as complete. 🔄️
i18n/locales/ja-JP.json Localization changed, will be marked as complete. 🔄️
i18n/locales/kn-IN.json Localization changed, will be marked as complete. 🔄️
i18n/locales/mr-IN.json Localization changed, will be marked as complete. 🔄️
i18n/locales/nb-NO.json Localization changed, will be marked as complete. 🔄️
i18n/locales/ne-NP.json Localization changed, will be marked as complete. 🔄️
i18n/locales/pl-PL.json Localization changed, will be marked as complete. 🔄️
i18n/locales/pt-BR.json Localization changed, will be marked as complete. 🔄️
i18n/locales/ru-RU.json Localization changed, will be marked as complete. 🔄️
i18n/locales/ta-IN.json Localization changed, will be marked as complete. 🔄️
i18n/locales/te-IN.json Localization changed, will be marked as complete. 🔄️
i18n/locales/tr-TR.json Localization changed, will be marked as complete. 🔄️
i18n/locales/uk-UA.json Localization changed, will be marked as complete. 🔄️
i18n/locales/zh-CN.json Localization changed, will be marked as complete. 🔄️
i18n/locales/zh-TW.json Localization changed, will be marked as complete. 🔄️
Warnings reference
Icon Description
🔄️ 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-key alex-key changed the title Fix/docs page improvements fix: code page improvements Mar 22, 2026
@codecov
Copy link

codecov bot commented Mar 22, 2026

Codecov Report

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

Files with missing lines Patch % Lines
app/components/Code/Header.vue 64.78% 23 Missing and 2 partials ⚠️
app/composables/useSettings.ts 71.42% 2 Missing ⚠️
app/components/Code/MobileTreeDrawer.vue 50.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 22, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4ab50fcc-cf21-4976-81d6-f7545dabda46

📥 Commits

Reviewing files that changed from the base of the PR and between 1d9e72a and 282e8bc.

📒 Files selected for processing (5)
  • i18n/locales/de-DE.json
  • i18n/locales/en.json
  • i18n/locales/fr-FR.json
  • i18n/locales/mr-IN.json
  • i18n/schema.json
💤 Files with no reviewable changes (2)
  • i18n/locales/de-DE.json
  • i18n/locales/fr-FR.json
✅ Files skipped from review due to trivial changes (1)
  • i18n/locales/en.json
🚧 Files skipped from review as they are similar to previous changes (2)
  • i18n/schema.json
  • i18n/locales/mr-IN.json

📝 Walkthrough

Walkthrough

This PR adds a sticky Code Header component (breadcrumbs, copy/permalink, markdown view toggles, mobile-tree toggle, expand/collapse), a SkeletonLoader component for code loading state, and exposes a programmatic toggle() on MobileTreeDrawer. It enables horizontal overflow on the code Viewer, introduces a persisted codeContainerFull setting with useCodeContainer(), replaces the inline header and pending-file skeleton with the new components, and adds a folder-open icon to the DirectoryListing empty-state.

Possibly related PRs

Suggested labels

front, i18n

Suggested reviewers

  • ghostdevv
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The PR description clearly relates to the changeset, detailing container toggle button, component separation (CodeHeader, CodeSkeletonLoader), icon button replacements, mobile breadcrumb dropdown, and loading state fixes.
Linked Issues check ✅ Passed The PR successfully addresses all primary coding requirements from issue #1942: added container toggle via useCodeContainer [useSettings.ts], separated CodeHeader and CodeSkeletonLoader components [new files], replaced text buttons with icons throughout [Header.vue, en.json], implemented mobile breadcrumb dropdown [Header.vue], fixed loading state to show skeleton loaders [Viewer.vue, new SkeletonLoader.vue], and improved layout rendering.
Out of Scope Changes check ✅ Passed All changes align with issue #1942 objectives. The PR includes necessary i18n updates across 21 locales and one UnoCSS shortcut addition that directly support the new UI components and features without introducing unrelated functionality.

✏️ 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.

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: 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

@ghostdevv ghostdevv marked this pull request as draft March 22, 2026 21:24
@ghostdevv
Copy link
Contributor

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

@alex-key alex-key changed the title fix: code page improvements fix: package code page improvements Mar 22, 2026
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


ℹ️ 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

@alex-key
Copy link
Contributor Author

@alexdln appreciate a review from you

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: 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

@ghostdevv ghostdevv marked this pull request as draft March 23, 2026 04:47
@alex-key
Copy link
Contributor Author

@ghostdevv Why is it draft again?

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.

Package code page: mobile version improvements

2 participants