Skip to content

fix: avoid showing "No README is available" during README load#2473

Open
akadotsh wants to merge 4 commits intonpmx-dev:mainfrom
akadotsh:fix/no-readme-visible-when-readme-is-loading
Open

fix: avoid showing "No README is available" during README load#2473
akadotsh wants to merge 4 commits intonpmx-dev:mainfrom
akadotsh:fix/no-readme-visible-when-readme-is-loading

Conversation

@akadotsh
Copy link
Copy Markdown
Contributor

🔗 Linked issue

Closes #2467

🧭 Context

📚 Description

Updated README rendering logic to use fetch status and only show the no-README message after a successful fetch with empty content.

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 11, 2026

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

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Apr 14, 2026 6:44pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Apr 14, 2026 6:44pm
npmx-lunaria Ignored Ignored Apr 14, 2026 6:44pm

Request Review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 11, 2026

📝 Walkthrough

Summary by CodeRabbit

Release Notes

  • New Features
    • Enhanced README section with improved loading state indicators and error message display when README details fail to load.

Walkthrough

This PR resolves a UI issue where "No README is available" displays while the README is loading. The fix updates the package page component to distinguish between pending, error, and success states for README fetching, and migrates provenance error handling translations whilst introducing dedicated README error messaging.

Changes

Cohort / File(s) Summary
README Loading State
app/pages/package/[[org]]/[name].vue
Updated lazy fetch to capture readmeStatus alongside readmeData. Modified conditional rendering to show loading indicator when pending, error message when failed, and "no README" only when successful with no content. Changes render logic from single fallback to explicit state-based conditions.
i18n Schema
i18n/schema.json
Added new property readme.error_loading to the i18n schema as a string type, formalising support for the new README error message key.
English Locale
i18n/locales/en.json
Added new translation key package.readme.error_loading with message "Failed to load README details".
Provenance Error Removal (All Locales)
i18n/locales/ar.json, az-AZ.json, bg-BG.json, cs-CZ.json, de.json, es.json, fr-FR.json, hi-IN.json, hu-HU.json, id-ID.json, it-IT.json, ja-JP.json, mr-IN.json, nb-NO.json, pl-PL.json, pt-BR.json, ru-RU.json, sr-Latn-RS.json, ta-IN.json, tr-TR.json, uk-UA.json, vi-VN.json, zh-CN.json, zh-TW.json
Removed the translation key package.provenance_section.error_loading from all non-English locales, consolidating error handling strategy across the application.

Possibly related PRs

Suggested reviewers

  • alexdln
  • danielroe
🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The PR includes out-of-scope translation changes. Whilst the comments indicate the author later reverted non-English translations per reviewer feedback, the current changeset still removes provenance_section.error_loading from 21 locale files and adds readme.error_loading to en.json and schema.json without corresponding implementation in the main component. Verify that translation changes are necessary for the linked issue objective and ensure consistency between translated keys and actual component usage. Remove unnecessary translation removals or clarify their necessity.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: updating README rendering logic to avoid showing 'No README available' during the loading state.
Description check ✅ Passed The description is directly related to the changeset, mentioning the core objective of updating README rendering logic to use fetch status.
Linked Issues check ✅ Passed The PR successfully addresses #2467 by updating README component logic to check fetch status ('pending', 'error', 'success') before displaying messages, preventing 'No README available' from appearing during loading.

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

@akadotsh akadotsh changed the title Fix: "No README is available" appearing while README is still loading fix: avoid showing "No README is available" during README load Apr 11, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 11, 2026

Codecov Report

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

Files with missing lines Patch % Lines
app/pages/package/[[org]]/[name].vue 40.00% 2 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@serhalp
Copy link
Copy Markdown
Member

serhalp commented Apr 11, 2026

🙌🏼 Thank you @akadotsh!

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 13, 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/en.json Source changed, localizations will be marked as outdated.
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.

@serhalp
Copy link
Copy Markdown
Member

serhalp commented Apr 14, 2026

@akadotsh looks great! but please only include translations for languages you are comfortable translating yourself; don't use AI or online translators for others please. You can just leave the other json files unchanged, and other people will translate the new key eventually! 🙏🏼

Copy link
Copy Markdown
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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
i18n/locales/az-AZ.json (1)

329-338: ⚠️ Potential issue | 🟡 Minor

Restore package.provenance_section.error_loading to prevent a localisation regression.

The provenance error UI still calls package.provenance_section.error_loading, but this key was removed from az-AZ.json in this block. On provenance fetch failures, Azerbaijani users will get a fallback/missing translation instead of the existing localised copy.

Suggested fix
     "transparency_log_entry": "Şəffaflıq jurnalı qeydi",
-    "view_more_details": "Daha çox detala bax"
+    "view_more_details": "Daha çox detala bax",
+    "error_loading": "Mənşə detalları yüklənə bilmədi"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@i18n/locales/az-AZ.json` around lines 329 - 338, Restore the missing
translation key package.provenance_section.error_loading in az-AZ.json under the
provenance_section object: add the error_loading property with the appropriate
Azerbaijani message (matching the original localization used elsewhere) so code
referencing package.provenance_section.error_loading finds a valid string;
update the provenance_section block in az-AZ.json to include "error_loading":
"<localized message>" alongside the existing keys like title,
built_and_signed_on, and view_more_details.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@i18n/locales/az-AZ.json`:
- Around line 329-338: Restore the missing translation key
package.provenance_section.error_loading in az-AZ.json under the
provenance_section object: add the error_loading property with the appropriate
Azerbaijani message (matching the original localization used elsewhere) so code
referencing package.provenance_section.error_loading finds a valid string;
update the provenance_section block in az-AZ.json to include "error_loading":
"<localized message>" alongside the existing keys like title,
built_and_signed_on, and view_more_details.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b4c0d795-de21-46ad-a9d8-2a4ffac68214

📥 Commits

Reviewing files that changed from the base of the PR and between 8133aa6 and 1b02d78.

📒 Files selected for processing (24)
  • i18n/locales/ar.json
  • i18n/locales/az-AZ.json
  • i18n/locales/bg-BG.json
  • i18n/locales/cs-CZ.json
  • i18n/locales/de.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/mr-IN.json
  • i18n/locales/nb-NO.json
  • i18n/locales/pl-PL.json
  • i18n/locales/pt-BR.json
  • i18n/locales/ru-RU.json
  • i18n/locales/sr-Latn-RS.json
  • i18n/locales/ta-IN.json
  • i18n/locales/tr-TR.json
  • i18n/locales/uk-UA.json
  • i18n/locales/vi-VN.json
  • i18n/locales/zh-CN.json
  • i18n/locales/zh-TW.json
✅ Files skipped from review due to trivial changes (3)
  • i18n/locales/it-IT.json
  • i18n/locales/uk-UA.json
  • i18n/locales/de.json
🚧 Files skipped from review as they are similar to previous changes (12)
  • i18n/locales/ar.json
  • i18n/locales/ja-JP.json
  • i18n/locales/pt-BR.json
  • i18n/locales/id-ID.json
  • i18n/locales/ta-IN.json
  • i18n/locales/tr-TR.json
  • i18n/locales/zh-CN.json
  • i18n/locales/bg-BG.json
  • i18n/locales/ru-RU.json
  • i18n/locales/hu-HU.json
  • i18n/locales/fr-FR.json
  • i18n/locales/vi-VN.json

@akadotsh
Copy link
Copy Markdown
Contributor Author

Got it, kept the new key only in en.json and reverted other locales 👍

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.

"No README is available" can show while readme is loading

2 participants