[codex] improve plugin tutorial page actions#593
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe plugin detail page now selects plugins from a stars-enriched list, resolves per-plugin/per-locale docs slugs, normalizes tutorial HTML, formats numeric metrics (k/M or n/a), removes initial zeroing of metrics, and restructures the UI into quick links, stat cards, and a Guide card; LD+JSON payload drops softwareVersion and aggregateRating. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Review rate limit: 0/5 reviews remaining, refill in 48 minutes and 52 seconds. Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
apps/web/src/pages/plugins/[slug].astro (1)
71-73: Avoid duplicate quick-link targets when docs falls back to npm or GitHub.When
docsSlugis missing,docsHrefbecomesnpmHref ?? href, but the aside still renders separate npm/repo buttons. That can leave two CTAs pointing at the same destination with different labels.♻️ One way to keep each CTA distinct
const npmHref = name ? `https://www.npmjs.com/package/${name}` : undefined const docsHref = docsSlug ? getRelativeLocaleUrl(docsLocale, `docs/plugins/${docsSlug}/`) : (npmHref ?? href) const docsIsExternal = !docsSlug +const showRepoLink = href !== docsHref +const showNpmLink = !!npmHref && npmHref !== docsHref- <a - href={href} - target="_blank" - rel="noopener noreferrer" - class="inline-flex items-center justify-center gap-2 rounded-xl border border-white/15 bg-white/[0.03] px-4 py-3 text-sm font-semibold text-white transition hover:border-white/25 hover:bg-white/[0.06] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-400" - > - <span>{m.view_repo({}, { locale })}</span> - <AstroIcon name="heroicons:arrow-up-right-solid" class="size-4 text-gray-300" aria-hidden="true" /> - </a> + { + showRepoLink && ( + <a + href={href} + target="_blank" + rel="noopener noreferrer" + class="inline-flex items-center justify-center gap-2 rounded-xl border border-white/15 bg-white/[0.03] px-4 py-3 text-sm font-semibold text-white transition hover:border-white/25 hover:bg-white/[0.06] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-400" + > + <span>{m.view_repo({}, { locale })}</span> + <AstroIcon name="heroicons:arrow-up-right-solid" class="size-4 text-gray-300" aria-hidden="true" /> + </a> + ) + }- { - npmHref && ( + { + showNpmLink && ( <a href={npmHref}Also applies to: 174-204
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/web/src/pages/plugins/`[slug].astro around lines 71 - 73, The quick-link logic can produce duplicate targets when docsSlug is missing because docsHref is set to npmHref ?? href while npm/repo buttons are still rendered; update the rendering logic to avoid duplicate CTAs by checking equality between docsHref and npmHref/href: only render the docs CTA when docsSlug is present (or when docsHref differs from npmHref and href), and/or skip rendering the npm or repo button when their href equals docsHref. Modify the logic around npmHref, docsHref, docsIsExternal and the component that renders the aside buttons so links with identical destinations are deduplicated and only one labeled CTA is shown.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@apps/web/src/pages/plugins/`[slug].astro:
- Around line 82-96: The LD-JSON currently hardcodes softwareVersion and
repurposes plugin.githubStars as aggregateRating; remove the fabricated fields
by not setting softwareVersion and aggregateRating unless authoritative data
exists (e.g., only include softwareVersion when a verified plugin.version is
present and only build aggregateRating when a vetted rating object exists
instead of using plugin.githubStars). Update the createSoftwareApplicationLdJson
call (referencing content['ldJSON'] and createSoftwareApplicationLdJson) to
conditionally include softwareVersion and aggregateRating based on real-source
checks (e.g., plugin.version !== undefined and plugin.rating &&
plugin.rating.source === 'trusted'), otherwise omit those properties entirely.
- Around line 212-223: The injected tutorial HTML (set:html={tutorial}) can
contain leading <h1> elements which create a second page-level heading; sanitize
the tutorial before rendering by removing or converting any leading h1 to h2.
Implement a small sanitizer (e.g., removeLeadingH1 or normalizeTutorialHeadings)
and apply it to the tutorial variable used in the JSX where set:html={tutorial}
(or adjust the markdown renderer options at the source of tutorial) so the
first-level heading is either stripped or downgraded to h2 while preserving the
rest of the content.
---
Nitpick comments:
In `@apps/web/src/pages/plugins/`[slug].astro:
- Around line 71-73: The quick-link logic can produce duplicate targets when
docsSlug is missing because docsHref is set to npmHref ?? href while npm/repo
buttons are still rendered; update the rendering logic to avoid duplicate CTAs
by checking equality between docsHref and npmHref/href: only render the docs CTA
when docsSlug is present (or when docsHref differs from npmHref and href),
and/or skip rendering the npm or repo button when their href equals docsHref.
Modify the logic around npmHref, docsHref, docsIsExternal and the component that
renders the aside buttons so links with identical destinations are deduplicated
and only one labeled CTA is shown.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 4ed8e105-0489-45a3-bd17-10c677257698
📒 Files selected for processing (1)
apps/web/src/pages/plugins/[slug].astro
riderx
left a comment
There was a problem hiding this comment.
I’m addressing the CodeRabbit findings now and will push a follow-up fix shortly.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|



What changed
Why
Tutorial pages needed consistent direct access to docs and repository links, plus plugin stats, without duplicating that UI in each markdown tutorial file.
Impact
Validation
bun run checkSummary by CodeRabbit
New Features
Bug Fixes / Improvements