Skip to content

feat: improve i18n (lunaria) status page#2064

Draft
alex-key wants to merge 5 commits intonpmx-dev:mainfrom
alex-key:feat/improve-lunaria-status-page
Draft

feat: improve i18n (lunaria) status page#2064
alex-key wants to merge 5 commits intonpmx-dev:mainfrom
alex-key:feat/improve-lunaria-status-page

Conversation

@alex-key
Copy link
Contributor

@alex-key alex-key commented Mar 13, 2026

🧭 Context

i18n status page was designed to track multiple files. Since we are using a single file for each location - it could be improved

📚 Description

The following changes were done:

  • use processed and optimized jsonStatus object instead of lunaria-generated status object
  • removed "Translation status by file" section on the bottom as it's not needed when we use a single file per location
  • replaced same file output in each locale ("i18n/locales/en.json") with correct locale filename
  • replaced redundant report per file "0 done, 1 outdated,0 missing" with missing keys count
  • improved progress bar render based on competion %
  • added progress bar color scheme based on completion %
  • general visual improvements: paddings, margins, borders, link hover state
Before

i18n-npmx-old

After

i18n-nuxt-new

@vercel
Copy link

vercel bot commented Mar 13, 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 18, 2026 7:09am
npmx.dev Ready Ready Preview, Comment Mar 18, 2026 7:09am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
npmx-lunaria Ignored Ignored Mar 18, 2026 7:09am

Request Review

@codecov
Copy link

codecov bot commented Mar 13, 2026

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
2190 1 2189 6
View the top 1 failed test(s) by shortest run time
test/unit/a11y-component-coverage.spec.ts > a11y component test coverage > should have accessibility tests for all components (or be explicitly skipped)
Stack Traces | 0.0103s run time
AssertionError: Missing a11y tests for 2 component(s):
  - ProgressBar.vue
  - Translation/StatusByFile.unused.vue

To fix: Add tests in test/nuxt/a11y.spec.ts or add to SKIPPED_COMPONENTS in test/unit/a11y-component-coverage.spec.ts with justification.: expected 2 to equal +0

- Expected
+ Received

- 0
+ 2

 ❯ test/unit/a11y-component-coverage.spec.ts:167:12
 ❯ node_modules/.pnpm/@voidzero-dev+vite-plus-test@0.0.0-g52709db6.20260226-1136_@opentelemetry+api@1.9.0_@ty_bb345341c28e9d2b29c1797600c0d1bd/node_modules/@voidzero-dev/vite-plus-test/dist/@vitest/runner/index.js:145:14
 ❯ node_modules/.pnpm/@voidzero-dev+vite-plus-test@0.0.0-g52709db6.20260226-1136_@opentelemetry+api@1.9.0_@ty_bb345341c28e9d2b29c1797600c0d1bd/node_modules/@voidzero-dev/vite-plus-test/dist/@vitest/runner/index.js:915:28
 ❯ node_modules/.pnpm/@voidzero-dev+vite-plus-test@0.0.0-g52709db6.20260226-1136_@opentelemetry+api@1.9.0_@ty_bb345341c28e9d2b29c1797600c0d1bd/node_modules/@voidzero-dev/vite-plus-test/dist/@vitest/runner/index.js:1243:24
 ❯ runWithTimeout node_modules/.pnpm/@voidzero-dev+vite-plus-test@0.0.0-g52709db6.20260226-1136_@opentelemetry+api@1.9.0_@ty_bb345341c28e9d2b29c1797600c0d1bd/node_modules/@voidzero-dev/vite-plus-test/dist/@vitest/runner/index.js:1209:12
 ❯ node_modules/.pnpm/@voidzero-dev+vite-plus-test@0.0.0-g52709db6.20260226-1136_@opentelemetry+api@1.9.0_@ty_bb345341c28e9d2b29c1797600c0d1bd/node_modules/@voidzero-dev/vite-plus-test/dist/@vitest/runner/index.js:1653:42
 ❯ Traces.$ node_modules/.pnpm/@voidzero-dev+vite-plus-test@0.0.0-g52709db6.20260226-1136_@opentelemetry+api@1.9.0_@ty_bb345341c28e9d2b29c1797600c0d1bd/node_modules/@.../dist/chunks/traces.CCmnQaNT.js:142:29
 ❯ trace node_modules/.pnpm/@voidzero-dev+vite-plus-test@0.0.0-g52709db6.20260226-1136_@opentelemetry+api@1.9.0_@ty_bb345341c28e9d2b29c1797600c0d1bd/node_modules/@.../dist/chunks/test.B8ej_ZHS.js:239:23
 ❯ runTest node_modules/.pnpm/@voidzero-dev+vite-plus-test@0.0.0-g52709db6.20260226-1136_@opentelemetry+api@1.9.0_@ty_bb345341c28e9d2b29c1797600c0d1bd/node_modules/@voidzero-dev/vite-plus-test/dist/@vitest/runner/index.js:1653:17

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@alex-key alex-key marked this pull request as ready for review March 13, 2026 18:00
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 14, 2026

📝 Walkthrough

Walkthrough

This pull request refactors the Lunaria components to use an I18nStatus type instead of LunariaStatus, removing dependencies on the LunariaInstance parameter from public component signatures. The changes include introducing new helper components (MissingKeysList, ContentDetailsLinks, ProgressBar, Link, TitleParagraph), updating the rendering logic to display locale-specific progress metrics, and deferring HTML dashboard generation to after jsonStatus construction. Stylesheet updates introduce new colour tokens and comprehensive progress-related styling to support the updated UI structure.

Possibly related PRs

  • style: fix i18n lunaria style #1737: Both PRs modify the lunaria styles, introducing and adjusting progress bar styling and colour tokens that directly overlap in implementation.

Suggested reviewers

  • danielroe
  • graphieros
🚥 Pre-merge checks | ✅ 1
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The PR description clearly relates to the changeset, detailing specific improvements to the i18n status page including using jsonStatus, removing file-based reporting, improving progress bars, and visual enhancements.

✏️ 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
📝 Coding Plan
  • Generate coding plan for human review comments

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

🧹 Nitpick comments (1)
lunaria/components.ts (1)

260-261: Avoid ! after find().

If localizations does not contain lang, this throws before any fallback status can be rendered. A small guard keeps this exported helper safe if the per-file view is brought back.

Safer fallback
-  const localization = localizations.find(l => l.lang === lang)!
+  const localization = localizations.find(l => l.lang === lang)
+  if (!localization) {
+    return html`<td>${EmojiFileLink(null, 'missing')}</td>`
+  }
As per coding guidelines, "Ensure you write strictly type-safe code, for example by ensuring you always check when accessing an array value by index".

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8dd22553-934d-4d27-9362-b2a69b3d653e

📥 Commits

Reviewing files that changed from the base of the PR and between a170292 and 326dc61.

📒 Files selected for processing (3)
  • lunaria/components.ts
  • lunaria/lunaria.ts
  • lunaria/styles.ts

</summary>
${outdatedFiles.length > 0 ? OutdatedFiles(outdatedFiles, lang, lunaria) : ''}
<br />
${ContentDetailsLinks({ text: `i18n/locales/${lang}.json`, url: githubEditUrl }, githubHistoryUrl)}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Render the resolved locale filename here.

The edit/history URLs are already built from the resolved path, but this label is reconstructed from lang. For locales whose primary edit target is a base file, the page will still say i18n/locales/ar-EG.json or i18n/locales/es-ES.json even though the link opens ar.json or es.json. Please carry the resolved file path through I18nStatus and render that instead.

@userquin
Copy link
Member

We want that page at npmx.dev, check #1485

@alex-key
Copy link
Contributor Author

We want that page at npmx.dev, check #1485

So we keep both i18n.npmx.dev and /translation-status? I can't check new Vue component precisely: did you change design much?

@alex-key alex-key marked this pull request as draft March 14, 2026 23:05
@alex-key
Copy link
Contributor Author

I'll work to include changes from #1485

@github-actions
Copy link

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/en.json Source changed, localizations will be marked as outdated.
i18n/locales/uk-UA.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.

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.

2 participants