Skip to content

Feat/remove persona filter#872

Closed
klocke-io wants to merge 2 commits intogardener:masterfrom
klocke-io:feat/remove-persona-filter
Closed

Feat/remove persona filter#872
klocke-io wants to merge 2 commits intogardener:masterfrom
klocke-io:feat/remove-persona-filter

Conversation

@klocke-io
Copy link
Member

@klocke-io klocke-io commented Feb 27, 2026

How to categorize this PR?

/kind cleanup

What this PR does / why we need it:

#867

To reduce technical complexity and provide an easier ground for reasoning about the content structure, the persona filter should be removed from the documentation landing page

Which issue(s) this PR fixes:
Fixes #
#691
#858
#758

Special notes for your reviewer:

Summary by CodeRabbit

  • Refactor

    • Simplified navigation structure with direct links instead of nested menus
    • Removed persona-based sidebar filtering and customization
    • Streamlined documentation index layout for cleaner presentation
  • Documentation

    • Removed persona switching guidance from documentation

@klocke-io klocke-io requested a review from a team as a code owner February 27, 2026 07:55
@gardener-prow gardener-prow bot added kind/cleanup Something that is not needed anymore and can be cleaned up size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Feb 27, 2026
@federated-github-access federated-github-access bot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Feb 27, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 27, 2026

📝 Walkthrough

Walkthrough

This change removes persona-based sidebar filtering and custom navigation components, consolidating sidebar computation into the main Vitepress configuration. It replaces complex Vue component-driven menus with simplified, taxonomy-focused layouts and eliminates associated debug utilities, test infrastructure, and persona documentation.

Changes

Cohort / File(s) Summary
Core Configuration Refactoring
.vitepress/config.mts, .vitepress/data/sidebar.data.ts
Moved sidebar precomputation from data module into main config via allSidebars constant; added transformPageData hook to populate taxonomy children in frontmatter; simplified nav structure with direct links instead of nested components; updated path resolution with fileURLToPath; tightened editLink.pattern typing with explicit parameter annotations.
Component Architecture Cleanup
.vitepress/theme/components/VPMenu.vue, VPNavBarMenuLink.vue, VPNavbarMenuGroupWrapper.vue, CustomVPMenuLink.vue, VPSidebarGroup.vue
Removed five Vue components that managed persona-driven menu/sidebar filtering, localStorage state, cross-tab synchronization, and custom click event dispatching; eliminates 569 lines of component logic.
Sidebar and Taxonomy Logic
.vitepress/theme/docs-sidebar.ts, .vitepress/theme/utils/sidebar.ts, .vitepress/theme/community-sidebar.ts
Removed personaSidebar() function and leaf-map-based persona filtering; added new taxonomy utilities (getTaxonomyChildren, hasMarkdownContent, normalizeSidebarPath, findSidebarChildren); cleaned up debug instrumentation.
Layout and Theme Integration
.vitepress/theme/layouts/EmptyIndexLayout.vue, .vitepress/theme/index.ts
Simplified EmptyIndexLayout to taxonomy-focused rendering; removed 203 lines of dynamic sidebar computation, router hooks, and localStorage state management; removed 404 tracking and component registration from app enhancement.
Utility and Debug Cleanup
.vitepress/theme/utils/debug-json.ts, .vitepress/theme/utils/personaMapping.json
Deleted debug JSON writer utility and static persona-to-route mapping file (265 lines); removes debug output capability and hardcoded persona routing data.
Build and Development Setup
Makefile, package.json, post-processing/part-3.js, vitest.config.ts
Extended local-preview target with full workflow steps; removed --add-empty-metadata flag from post-processing; deleted vitest configuration (59 lines); adjusted dependencies (removed PostCSS/Tailwind/vitest, added type definitions, reintroduced vitepress-sidebar).
Documentation
website/documentation/_index.md
Removed "Understanding the Documentation Personas" section with user/operator/developer persona descriptions (41 lines); streamlines documentation flow by eliminating persona guidance.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Poem

🐰 A hop toward simplicity,
Personas fade, taxonomies bloom,
Where menus once danced with clever tricks,
Now sidebars sing in cleaner rooms.
Debug files gone, the path shines bright!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 63.64% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Feat/remove persona filter' accurately summarizes the main change—removing the persona filter feature from the documentation.
Description check ✅ Passed The description includes categorization (/kind cleanup), references to related issues, and explains the rationale, but lacks detail on what the PR actually does.

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

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 gardener-prow bot added the cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. label Feb 27, 2026
@github-actions github-actions bot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. and removed ok-to-test Indicates a non-member PR verified by an org member that is safe to test. labels Feb 27, 2026
@gardener-prow
Copy link

gardener-prow bot commented Feb 27, 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

@federated-github-access federated-github-access bot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Feb 27, 2026
@klocke-io klocke-io added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. labels Feb 27, 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

🧹 Nitpick comments (4)
package.json (1)

6-8: Move type packages and ts-node to devDependencies.

The @types/* packages at lines 6–8 and ts-node at line 13 are development-time only. Type definitions are never imported in source code and only consumed during TypeScript compilation by VitePress. The ts-node package is not used anywhere in the codebase (no scripts section exists, and VitePress handles TypeScript transpilation internally). Keeping them in dependencies unnecessarily bloats production installs.

♻️ Proposed `package.json` adjustment
 {
   "name": "documentation",
   "type": "module",
   "dependencies": {
     "@types/js-yaml": "4.0.9",
-    "@types/lodash-es": "4.17.12",
-    "@types/markdown-it": "12.2.3",
-    "@types/node": "20.11.27",
     "autoprefixer": "10.4.0",
     "gray-matter": "4.0.3",
     "js-yaml": "4.1.1",
     "lodash-es": "4.17.23",
-    "ts-node": "10.9.2",
     "vitepress": "1.6.3",
     "vitepress-sidebar": "1.31.1",
     "vue": "3.5.16"
+  },
+  "devDependencies": {
+    "@types/lodash-es": "4.17.12",
+    "@types/markdown-it": "12.2.3",
+    "@types/node": "20.11.27",
+    "ts-node": "10.9.2"
   }
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@package.json` around lines 6 - 8, Move the runtime-irrelevant type packages
and ts-node into devDependencies: remove "@types/lodash-es",
"@types/markdown-it", "@types/node" and "ts-node" from dependencies and add them
under devDependencies instead; update the package.json entries so only runtime
packages remain in "dependencies" and all TypeScript-only tools/types (the three
"@types/*" packages and "ts-node") are declared under "devDependencies".
.vitepress/config.mts (2)

2-2: Remove unused import pathToFileURL.

The pathToFileURL function is imported but not used anywhere in the visible code.

🧹 Proposed fix
-import { fileURLToPath, URL, pathToFileURL } from 'node:url'
+import { fileURLToPath, URL } from 'node:url'
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.vitepress/config.mts at line 2, The import statement includes an unused
symbol pathToFileURL; remove pathToFileURL from the import list (leaving
fileURLToPath and URL) in the top-level import declaration so the module no
longer imports an unused identifier and satisfies the linter.

23-39: Synchronous file I/O in transformPageData may impact build performance.

hasMarkdownContent performs synchronous file reads via readFileSync. For large documentation sites with many index pages, this could slow down builds. Consider whether async alternatives are feasible or if caching would help.

However, given this only runs for index.md files and the early return when content exists, the impact is likely minimal for most use cases.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.vitepress/config.mts around lines 23 - 39, transformPageData is doing
synchronous file I/O by calling hasMarkdownContent (which uses readFileSync);
change this to avoid blocking the build by either (A) converting
hasMarkdownContent to an async version (e.g., hasMarkdownContentAsync using
fs.promises.readFile) and making transformPageData async so you await the check,
or (B) add a simple in-memory cache keyed by the resolved filePath
(Map<string,boolean>) so repeated calls return cached results and eliminate
repeated readFileSync; update the call site in transformPageData to use the new
async helper or the cache lookup and ensure
pageData.frontmatter.taxonomyChildren logic remains unchanged.
.vitepress/theme/layouts/EmptyIndexLayout.vue (1)

22-24: Consider using VitePress's router-aware links for SPA navigation.

Using native <a> tags causes full page reloads instead of client-side navigation. VitePress provides router-aware components that maintain SPA behavior.

♻️ Proposed fix using VPLink or router-link
+<script setup lang="ts">
+import { useData } from 'vitepress'
+import { computed } from 'vue'
+import DefaultTheme from 'vitepress/theme'
+import { useRouter } from 'vitepress'
+
+const { Layout } = DefaultTheme
+const { frontmatter, page } = useData()
+const router = useRouter()

Then in the template:

-            <a :href="child.link">{{ child.text }}</a>
+            <a :href="child.link" `@click.prevent`="router.go(child.link)">{{ child.text }}</a>

Alternatively, use VitePress's built-in link handling by wrapping links with the withBase utility if using absolute paths.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.vitepress/theme/layouts/EmptyIndexLayout.vue around lines 22 - 24, The
template currently renders plain anchor tags inside the v-for (li v-for="child
in children" :key="child.link") which causes full page reloads; replace the
native <a :href="child.link"> usage with VitePress router-aware links (e.g.,
VPLink or <RouterLink> / router-link) so navigation is client-side and
SPA-preserved, ensuring you bind the same child.link and child.text properties
and preserve the :key on child.link (or use withBase for absolute paths if you
must keep hrefs).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@Makefile`:
- Around line 114-117: The cleanup step currently checks for a "hugo" directory
but then deletes the entire "hugo" tree (rm -rf hugo) which is broader than
intended; change the check and removal to target the content dir only (e.g.,
check for "hugo/content" and run rm -rf hugo/content) so only the site content
is removed, not the whole hugo workspace, and keep the echo message aligned to
"Removing existing hugo/content directory..." to avoid misleading logs.

---

Nitpick comments:
In @.vitepress/config.mts:
- Line 2: The import statement includes an unused symbol pathToFileURL; remove
pathToFileURL from the import list (leaving fileURLToPath and URL) in the
top-level import declaration so the module no longer imports an unused
identifier and satisfies the linter.
- Around line 23-39: transformPageData is doing synchronous file I/O by calling
hasMarkdownContent (which uses readFileSync); change this to avoid blocking the
build by either (A) converting hasMarkdownContent to an async version (e.g.,
hasMarkdownContentAsync using fs.promises.readFile) and making transformPageData
async so you await the check, or (B) add a simple in-memory cache keyed by the
resolved filePath (Map<string,boolean>) so repeated calls return cached results
and eliminate repeated readFileSync; update the call site in transformPageData
to use the new async helper or the cache lookup and ensure
pageData.frontmatter.taxonomyChildren logic remains unchanged.

In @.vitepress/theme/layouts/EmptyIndexLayout.vue:
- Around line 22-24: The template currently renders plain anchor tags inside the
v-for (li v-for="child in children" :key="child.link") which causes full page
reloads; replace the native <a :href="child.link"> usage with VitePress
router-aware links (e.g., VPLink or <RouterLink> / router-link) so navigation is
client-side and SPA-preserved, ensuring you bind the same child.link and
child.text properties and preserve the :key on child.link (or use withBase for
absolute paths if you must keep hrefs).

In `@package.json`:
- Around line 6-8: Move the runtime-irrelevant type packages and ts-node into
devDependencies: remove "@types/lodash-es", "@types/markdown-it", "@types/node"
and "ts-node" from dependencies and add them under devDependencies instead;
update the package.json entries so only runtime packages remain in
"dependencies" and all TypeScript-only tools/types (the three "@types/*"
packages and "ts-node") are declared under "devDependencies".

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ce2a636 and c84034d.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (19)
  • .vitepress/config.mts
  • .vitepress/data/sidebar.data.ts
  • .vitepress/theme/community-sidebar.ts
  • .vitepress/theme/components/CustomVPMenuLink.vue
  • .vitepress/theme/components/VPMenu.vue
  • .vitepress/theme/components/VPNavBarMenuLink.vue
  • .vitepress/theme/components/VPNavbarMenuGroupWrapper.vue
  • .vitepress/theme/components/VPSidebarGroup.vue
  • .vitepress/theme/docs-sidebar.ts
  • .vitepress/theme/index.ts
  • .vitepress/theme/layouts/EmptyIndexLayout.vue
  • .vitepress/theme/utils/debug-json.ts
  • .vitepress/theme/utils/personaMapping.json
  • .vitepress/theme/utils/sidebar.ts
  • Makefile
  • package.json
  • post-processing/part-3.js
  • vitest.config.ts
  • website/documentation/_index.md
💤 Files with no reviewable changes (13)
  • .vitepress/data/sidebar.data.ts
  • .vitepress/theme/components/VPNavbarMenuGroupWrapper.vue
  • .vitepress/theme/utils/debug-json.ts
  • website/documentation/_index.md
  • vitest.config.ts
  • .vitepress/theme/community-sidebar.ts
  • .vitepress/theme/index.ts
  • .vitepress/theme/components/VPNavBarMenuLink.vue
  • .vitepress/theme/utils/personaMapping.json
  • .vitepress/theme/docs-sidebar.ts
  • .vitepress/theme/components/VPSidebarGroup.vue
  • .vitepress/theme/components/CustomVPMenuLink.vue
  • .vitepress/theme/components/VPMenu.vue

Comment on lines +114 to +117
@if [ -d "hugo" ]; then \
echo "Removing existing hugo/content directory..."; \
rm -rf hugo; \
fi
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 | 🟠 Major

Avoid deleting the entire hugo directory when the intent says hugo/content.

Line 115 says hugo/content, but Line 116 removes hugo recursively. That is a wider, potentially destructive cleanup scope.

Proposed safer cleanup diff
 	`@if` [ -d "hugo" ]; then \
 		echo "Removing existing hugo/content directory..."; \
-		rm -rf hugo; \
+		rm -rf hugo/content; \
 	fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
@if [ -d "hugo" ]; then \
echo "Removing existing hugo/content directory..."; \
rm -rf hugo; \
fi
`@if` [ -d "hugo" ]; then \
echo "Removing existing hugo/content directory..."; \
rm -rf hugo/content; \
fi
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Makefile` around lines 114 - 117, The cleanup step currently checks for a
"hugo" directory but then deletes the entire "hugo" tree (rm -rf hugo) which is
broader than intended; change the check and removal to target the content dir
only (e.g., check for "hugo/content" and run rm -rf hugo/content) so only the
site content is removed, not the whole hugo workspace, and keep the echo message
aligned to "Removing existing hugo/content directory..." to avoid misleading
logs.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 27, 2026

🧹 Preview Removed

The preview for this PR is no longer available since the PR has been closed.

@github-actions github-actions bot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. and removed ok-to-test Indicates a non-member PR verified by an org member that is safe to test. labels Feb 27, 2026
@klocke-io klocke-io closed this Feb 27, 2026
@klocke-io klocke-io reopened this Feb 27, 2026
@klocke-io klocke-io added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 27, 2026
@klocke-io klocke-io closed this Feb 27, 2026
@klocke-io klocke-io reopened this Feb 27, 2026
@klocke-io klocke-io added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed ok-to-test Indicates a non-member PR verified by an org member that is safe to test. labels Feb 27, 2026
@BoHristova
Copy link
Contributor

For some reason, sidebar navigation categories that consist of only one file (Gardenctl V2, Glossary) are not displayed in bold anymore:

Screenshot 2026-02-27 at 11 28 13

@klocke-io
Copy link
Member Author

For some reason, sidebar navigation categories that consist of only one file (Gardenctl V2, Glossary) are not displayed in bold anymore:
Screenshot 2026-02-27 at 11 28 13

@BoHristova fair point, would this be an issue for you, It would have the benefit of clearly indicating what is a Dir and what a file is. What do you think?

@klocke-io klocke-io closed this Feb 27, 2026
@klocke-io klocke-io reopened this Feb 27, 2026
@klocke-io klocke-io closed this Feb 27, 2026
@klocke-io
Copy link
Member Author

Closed fork pull request to test netlify preview deployment

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. kind/cleanup Something that is not needed anymore and can be cleaned up needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. reviewed/ok-to-test Has approval for testing (check PR in detail before setting this label because PR is run on CI/CD) size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants