Skip to content

Move "Edit this page" link to the right-hand side#929

Draft
BoHristova wants to merge 6 commits intogardener:masterfrom
BoHristova:move-edit-page-link
Draft

Move "Edit this page" link to the right-hand side#929
BoHristova wants to merge 6 commits intogardener:masterfrom
BoHristova:move-edit-page-link

Conversation

@BoHristova
Copy link
Copy Markdown
Contributor

@BoHristova BoHristova commented Apr 7, 2026

How to categorize this PR?

/kind enhancement

What this PR does / why we need it:

  • Adds a custom PageActions Vue component and uses the component for rendering the "Edit this page" link in the top-right corner.
  • Adds a "Report a documentation issue" link.
  • Changes the table-of contents title from "On this page" to "Page Content".
image

Which issue(s) this PR fixes:
Fixes #692

Special notes for your reviewer:
/cc @n-boshnakov @marc1404

Summary by CodeRabbit

Release Notes

  • New Features
    • Documentation pages now display action links in the sidebar for editing content and reporting issues directly from the page.

@BoHristova BoHristova added the kind/enhancement Enhancement, improvement, extension label Apr 7, 2026
@gardener-prow gardener-prow Bot requested review from marc1404 and n-boshnakov April 7, 2026 09:43
@gardener-prow gardener-prow Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 7, 2026
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 7, 2026

Deploy Preview for gardener-docs ready!

Name Link
🔨 Latest commit 604e068
🔍 Latest deploy log https://app.netlify.com/projects/gardener-docs/deploys/69e0923be1e19b000845c63c
😎 Deploy Preview https://deploy-preview-929--gardener-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 64 (🔴 down 4 from production)
Accessibility: 97 (no change from production)
Best Practices: 92 (no change from production)
SEO: 98 (no change from production)
PWA: 90 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 7, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9f2934ef-9a61-4bbc-9df7-b8fd7cf2d0b3

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ 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.

@gardener-prow
Copy link
Copy Markdown

gardener-prow Bot commented Apr 7, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign msohn for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@gardener-prow gardener-prow Bot added cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 7, 2026
@gardener-prow gardener-prow Bot added cla: no Indicates the PR's author has not signed the cla-assistant.io CLA. cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. and removed cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. cla: no Indicates the PR's author has not signed the cla-assistant.io CLA. labels Apr 7, 2026
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.

Actionable comments posted: 2

🧹 Nitpick comments (1)
.vitepress/theme/components/PageActions.vue (1)

51-51: Consider handling index.md for cleaner URLs.

For index pages, the pageUrl will be /docs/getting-started/index instead of /docs/getting-started/. While functional, this may look inconsistent in issue reports.

♻️ Suggested improvement
-  const pageUrl = `${siteHostname}/${page.value.relativePath.replace(/\.md$/, '')}`
+  const pageUrl = `${siteHostname}/${page.value.relativePath.replace(/\.md$/, '').replace(/\/index$/, '/')}`
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.vitepress/theme/components/PageActions.vue at line 51, The constructed
pageUrl uses page.value.relativePath directly, which yields URLs like
/docs/getting-started/index for index.md; update the logic that builds pageUrl
(using siteHostname and page.value.relativePath) to strip any trailing '/index'
segment after removing the .md extension and ensure a trailing slash for index
pages (so '/.../index' becomes '/.../' and a top-level 'index' becomes '/'),
keeping other pages unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.vitepress/config.mts:
- Around line 238-241: The URL builder function url({filePath, frontmatter}) is
emitting malformed links when required frontmatter fields are missing; update
the function (the url arrow function that computes fileName from
frontmatter?.path_base_for_github_subdir and builds
`${frontmatter['github_repo']}/tree/master/${frontmatter['github_subdir']}/${fileName}`)
to first validate that frontmatter.github_repo and frontmatter.github_subdir are
present and non-empty (and compute fileName as before), and if either is missing
return undefined instead of constructing the string; ensure you use the existing
frontmatter fields (path_base_for_github_subdir, github_repo, github_subdir) to
gate the return value.

In @.vitepress/theme/components/PageActions.vue:
- Around line 104-108: The .vpi-report-issue rule defines --icon but never
applies it; update the .vpi-report-issue CSS to use the --icon as a mask and
fill it by setting -webkit-mask-image: var(--icon) and mask-image: var(--icon)
and set background-color: currentColor (and ensure width/height remain), so the
SVG data URL stored in --icon is actually rendered as an icon.

---

Nitpick comments:
In @.vitepress/theme/components/PageActions.vue:
- Line 51: The constructed pageUrl uses page.value.relativePath directly, which
yields URLs like /docs/getting-started/index for index.md; update the logic that
builds pageUrl (using siteHostname and page.value.relativePath) to strip any
trailing '/index' segment after removing the .md extension and ensure a trailing
slash for index pages (so '/.../index' becomes '/.../' and a top-level 'index'
becomes '/'), keeping other pages unchanged.
🪄 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: 6830cbbf-0e30-412b-b041-9bf27c40d2fe

📥 Commits

Reviewing files that changed from the base of the PR and between 06fa9ed and 3852cc5.

📒 Files selected for processing (4)
  • .vitepress/config.mts
  • .vitepress/theme/components/PageActions.vue
  • .vitepress/theme/index.ts
  • .vitepress/theme/style.css

Comment thread .vitepress/config.mts
Comment thread .vitepress/theme/components/PageActions.vue
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 16, 2026

Niklas Klocke left a comment:

screenshot

on firefox there is a linebreak 👀

Browser metadata
Path:      /docs/proposals/0004-core-gardener-cloud-api/
Browser:   Firefox 149.0 on Mac OS 10.15
Viewport:  2502 x 1317 @1x
Language:  en
Cookies:   Enabled

Open in BrowserStack

Open Deploy Preview · Mark as Resolved

Copy link
Copy Markdown
Member

@klocke-io klocke-io left a comment

Choose a reason for hiding this comment

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

Nice, I really love where we are going here.

  • check if we can integrate the report an issue button with Netlify Forms
  • if we can package this new component into a reusable component.

Comment thread .vitepress/theme/style.css Outdated
The editLink config was removed in PR gardener#929, so the .VPDocFooter .edit-link
rule was hiding an element that no longer renders.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/enhancement Enhancement, improvement, extension size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider moving "Edit this page" link to the righthand aside

2 participants