Skip to content

Conversation

@aka-sacci-ccr
Copy link
Contributor

@aka-sacci-ccr aka-sacci-ccr commented Oct 17, 2025

What is this contribution about?

Describe your changes and why they're needed.

Screenshots/Demonstration

Add screenshots or a Loom video if your changes affect the UI.

Review Checklist

  • PR title is clear and descriptive
  • Changes are tested and working
  • Documentation is updated (if needed)
  • No breaking changes

Summary by CodeRabbit

  • Bug Fixes
    • Sidebar navigation no longer shows the "bounties" section, resulting in a cleaner, more focused navigation. Other sidebar ordering and grouping behavior remains unchanged.

@aka-sacci-ccr aka-sacci-ccr self-assigned this Oct 17, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 17, 2025

Walkthrough

The Sidebar's sortTree function was changed to remove nodes named "bounties" from the tree before applying the existing sort rules (files-before-folders and per-file canonical ordering), so bounty nodes no longer appear in the sorted output.

Changes

Cohort / File(s) Summary
Sidebar tree filtering
docs/view/src/components/ui/Sidebar.astro
Updated sortTree to filter out nodes with name "bounties" before performing the existing sorting (files before folders, canonical file ordering).

Sequence Diagram(s)

sequenceDiagram
    participant Sidebar
    participant sortTree
    participant Sorter
    Note over sortTree,Sorter #D6EAF8: New step: filter out "bounties"
    Sidebar->>sortTree: provide raw tree
    sortTree-->>sortTree: filter nodes where name == "bounties" (removed)
    sortTree->>Sorter: pass filtered tree
    Sorter->>Sorter: apply files-before-folders + canonical ordering
    Sorter-->>Sidebar: return sorted tree (no bounties)
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • guitavano
  • rafavalls

Poem

🐰
I hopped through trees with nimble feet,
Searched for "bounties" in each seat,
Whispered gently, "Go away,"
Now the sidebar skips their play,
Hooray — a tidier, hop-filled beat! 🥕✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The PR description contains only the template skeleton with no actual content filled in. The "What is this contribution about?" section lacks any description of the changes or their purpose, the "Screenshots/Demonstration" section is empty, and the Review Checklist items remain unchecked with no commentary. The description is entirely unfilled except for the template prompts, making it largely incomplete and providing no meaningful information to reviewers about why these changes were made or what was tested.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The PR title "hide bounties from docs sidebar" is concise, specific, and directly aligned with the main change described in the summary. The title clearly communicates that this PR removes or hides bounties from the documentation sidebar, which matches exactly what the sortTree function now does by filtering out nodes named "bounties". A teammate scanning the repository history would immediately understand the primary intent of this change. The title avoids vague language and noise, making it suitable for version control history.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/docs/bounties

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.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Oct 17, 2025

Deploying chat with  Cloudflare Pages  Cloudflare Pages

Latest commit: d4fbee3
Status: ✅  Deploy successful!
Preview URL: https://022c7b7b.chat-46r.pages.dev
Branch Preview URL: https://fix-docs-bounties.chat-46r.pages.dev

View logs

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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a6ab68b and d4fbee3.

📒 Files selected for processing (1)
  • docs/view/src/components/ui/Sidebar.astro (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
docs/**

📄 CodeRabbit inference engine (AGENTS.md)

Store long-form documentation under docs/

Files:

  • docs/view/src/components/ui/Sidebar.astro

Comment on lines +53 to +86
const sorted = nodes
.filter((node) => node.name !== "bounties")
.sort((a, b) => {
// First sort by type: files before folders
if (a.type !== b.type) {
return a.type === "file" ? -1 : 1;
}
// For files only - custom ordering
if (a.type === "file" && b.type === "file") {
// Force introduction to be first regardless of filename
if (a.name.includes("introduction")) return -1;
if (b.name.includes("introduction")) return 1;
// For files only - custom ordering
if (a.type === "file" && b.type === "file") {
// Force introduction to be first regardless of filename
if (a.name.includes("introduction")) return -1;
if (b.name.includes("introduction")) return 1;
// Then getting-started
if (a.name.includes("getting-started")) return -1;
if (b.name.includes("getting-started")) return 1;
// Then getting-started
if (a.name.includes("getting-started")) return -1;
if (b.name.includes("getting-started")) return 1;
// Then project-structure
if (a.name.includes("project-structure")) return -1;
if (b.name.includes("project-structure")) return 1;
// Then project-structure
if (a.name.includes("project-structure")) return -1;
if (b.name.includes("project-structure")) return 1;
// Then cli-reference
if (a.name.includes("cli-reference")) return -1;
if (b.name.includes("cli-reference")) return 1;
// Then cli-reference
if (a.name.includes("cli-reference")) return -1;
if (b.name.includes("cli-reference")) return 1;
// Then bounties (last)
if (a.name.includes("bounties")) return -1;
if (b.name.includes("bounties")) return 1;
}
// Then bounties (last)
if (a.name.includes("bounties")) return -1;
if (b.name.includes("bounties")) return 1;
}
// Default alphabetical
return a.name.localeCompare(b.name);
});
// Default alphabetical
return a.name.localeCompare(b.name);
});
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

Remove dead code on lines 79-81.

The filtering approach on line 54 correctly removes bounties from the sidebar. However, lines 79-81 contain sorting logic for bounties that will never execute since all "bounties" nodes are already filtered out before sorting begins.

Apply this diff to remove the dead code:

         // Then cli-reference
         if (a.name.includes("cli-reference")) return -1;
         if (b.name.includes("cli-reference")) return 1;
-
-        // Then bounties (last)
-        if (a.name.includes("bounties")) return -1;
-        if (b.name.includes("bounties")) return 1;
       }

       // Default alphabetical
📝 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
const sorted = nodes
.filter((node) => node.name !== "bounties")
.sort((a, b) => {
// First sort by type: files before folders
if (a.type !== b.type) {
return a.type === "file" ? -1 : 1;
}
// For files only - custom ordering
if (a.type === "file" && b.type === "file") {
// Force introduction to be first regardless of filename
if (a.name.includes("introduction")) return -1;
if (b.name.includes("introduction")) return 1;
// For files only - custom ordering
if (a.type === "file" && b.type === "file") {
// Force introduction to be first regardless of filename
if (a.name.includes("introduction")) return -1;
if (b.name.includes("introduction")) return 1;
// Then getting-started
if (a.name.includes("getting-started")) return -1;
if (b.name.includes("getting-started")) return 1;
// Then getting-started
if (a.name.includes("getting-started")) return -1;
if (b.name.includes("getting-started")) return 1;
// Then project-structure
if (a.name.includes("project-structure")) return -1;
if (b.name.includes("project-structure")) return 1;
// Then project-structure
if (a.name.includes("project-structure")) return -1;
if (b.name.includes("project-structure")) return 1;
// Then cli-reference
if (a.name.includes("cli-reference")) return -1;
if (b.name.includes("cli-reference")) return 1;
// Then cli-reference
if (a.name.includes("cli-reference")) return -1;
if (b.name.includes("cli-reference")) return 1;
// Then bounties (last)
if (a.name.includes("bounties")) return -1;
if (b.name.includes("bounties")) return 1;
}
// Then bounties (last)
if (a.name.includes("bounties")) return -1;
if (b.name.includes("bounties")) return 1;
}
// Default alphabetical
return a.name.localeCompare(b.name);
});
// Default alphabetical
return a.name.localeCompare(b.name);
});
const sorted = nodes
.filter((node) => node.name !== "bounties")
.sort((a, b) => {
// First sort by type: files before folders
if (a.type !== b.type) {
return a.type === "file" ? -1 : 1;
}
// For files only - custom ordering
if (a.type === "file" && b.type === "file") {
// Force introduction to be first regardless of filename
if (a.name.includes("introduction")) return -1;
if (b.name.includes("introduction")) return 1;
// Then getting-started
if (a.name.includes("getting-started")) return -1;
if (b.name.includes("getting-started")) return 1;
// Then project-structure
if (a.name.includes("project-structure")) return -1;
if (b.name.includes("project-structure")) return 1;
// Then cli-reference
if (a.name.includes("cli-reference")) return -1;
if (b.name.includes("cli-reference")) return 1;
}
// Default alphabetical
return a.name.localeCompare(b.name);
});
🤖 Prompt for AI Agents
In docs/view/src/components/ui/Sidebar.astro around lines 53 to 86, the sorting
block includes an unreachable check for "bounties" at lines 79-81 because nodes
with name "bounties" are filtered out earlier; remove the two lines that test
for a.name.includes("bounties") and b.name.includes("bounties") (the "Then
bounties (last)" branch) so the custom file-ordering logic no longer contains
dead code and the default alphabetical fallback remains intact.

@viktormarinho
Copy link
Contributor

@aka-sacci-ccr wanna merge?

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.

4 participants