Skip to content

feat: add collapsible sidebar categories with persistent state - #662

Open
manikanta-tamminana wants to merge 6 commits into
AditthyaSS:mainfrom
manikanta-tamminana:feat/run-again-different-model
Open

feat: add collapsible sidebar categories with persistent state#662
manikanta-tamminana wants to merge 6 commits into
AditthyaSS:mainfrom
manikanta-tamminana:feat/run-again-different-model

Conversation

@manikanta-tamminana

@manikanta-tamminana manikanta-tamminana commented Jun 30, 2026

Copy link
Copy Markdown

What does this PR do?

This PR adds collapsible sidebar categories to improve navigation when the sidebar contains many agent categories.

Changes made

  • Made each category header clickable to collapse/expand its agent list.
  • Persisted the expanded/collapsed state using localStorage.
  • Ensured all categories are expanded by default on the first visit.
  • Added a smooth expand/collapse animation for better user experience.
  • Updated chevron icons to indicate the current expand/collapse state.
  • Preserved the existing sidebar search functionality and agent navigation behavior.

Type of change

  • New agent
  • Bug fix
  • UI improvement
  • Documentation
  • Other

Checklist

  • I ran npm run build locally and it passed ✅
  • I tested my changes in the browser ✅
  • I did not break any existing agents ✅
  • I did not use import agents from '../agents/registry'
  • My PR has a clear description above ✅

Screenshots (if UI change)

Summary by CodeRabbit

  • Enhancements

    • Sidebar category expanded/collapsed preferences are consistently preserved between visits.
    • Category panel expand/collapse transitions have been slightly smoothed.
  • Bug Fixes

    • Reinforced consistency in how sidebar expansion state is saved and restored, including cases where prior saved data is missing or invalid.

@vercel

vercel Bot commented Jun 30, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the aditthyass' projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@manikanta-tamminana, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 30 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b4715a63-d049-4e0c-a332-d36eddd40cd5

📥 Commits

Reviewing files that changed from the base of the PR and between 1181f10 and f894087.

📒 Files selected for processing (1)
  • src/components/Sidebar.jsx

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key: "issues"
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Walkthrough

Sidebar.jsx adds a category storage key and makes nearby formatting-only adjustments around category toggle, expansion, and collapsible panel JSX.

Changes

Sidebar Category State

Layer / File(s) Summary
Storage key and sidebar formatting
src/components/Sidebar.jsx
Adds STORAGE_KEY and adjusts nearby whitespace, toggleCategory formatting, isCategoryExpanded formatting, and the collapsible container’s grid transition markup.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Possibly related issues

Possibly related PRs

Suggested labels: level:beginner

Suggested reviewers: AditthyaSS

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: collapsible sidebar categories with persisted state.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ 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.

@mergify

mergify Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Hey @manikanta-tamminana! 👋
Wow — your first contribution to iloveAgents! This is a big deal and I want you to know it means a lot. 🎊
Every agent on this platform started exactly like this — someone like you deciding to spend their time building something useful for everyone. That is something to be proud of.
A few things while you wait for the review:

  • Star the repo if you haven't already. Star it here
  • 📖 Check the Contributing Guide
  • 💬 Drop a comment if you get stuck — I reply within 24 hours
    Can't wait to ship this with you. 🚀
    Welcome to the iloveAgents family. 🙏
    @AditthyaSS

@mergify

mergify Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

hey @manikanta-tamminana! 👋
Your PR doesn't seem to be linked to an issue.
Please add this line to your PR description:
Closes #issue_number
Replace issue_number with the actual issue number you are solving.
This helps us track what each PR is fixing! 🔗
@AditthyaSS

@mergify mergify Bot added the needs-fix label Jun 30, 2026
@mergify

mergify Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

⚠️ Hey @manikanta-tamminana! This PR has a merge conflict that needs to be resolved before we can review or merge it.
Please sync your branch with the latest main and fix the conflicts.
Need help? Check out resolving merge conflicts.
@AditthyaSS

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/Sidebar.jsx`:
- Around line 255-260: The expanded category wrapper in Sidebar.jsx is using a
fixed max-h-screen cap, which clips tall categories and keeps overflow hidden.
Update the isCategoryExpanded transition block to use a content-driven open
height instead of the viewport-based limit, so the category container can grow
to fit all agents without cutting off items.
- Around line 255-262: In Sidebar’s category expand/collapse block, the
collapsed agent links are still mounted and reachable by keyboard even when
hidden. Update the logic around isCategoryExpanded so the NavLink subtree is
removed from the tab order while closed, either by conditionally unmounting the
list or by disabling focusability for the collapsed state after the transition
completes.
- Around line 7-16: The Sidebar state persistence currently guards the read path
in the `useState` initializer, but the write path in the `useEffect` that saves
`openCategories` still calls `localStorage` unguarded and can throw in
blocked/quota-exhausted cases. Update the persistence logic in `Sidebar.jsx` so
the write-side `localStorage.setItem` is wrapped in the same kind of try/catch
handling used by the initializer, and simply skip saving on failure. Use the
`STORAGE_KEY`, `openCategories`, and the effect that mirrors them to storage as
the main touchpoints.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: fd3fe238-ae06-4bd0-b1cb-243fc1ecfd71

📥 Commits

Reviewing files that changed from the base of the PR and between 165a201 and 61270ac.

📒 Files selected for processing (1)
  • src/components/Sidebar.jsx

Comment thread src/components/Sidebar.jsx Outdated
Comment thread src/components/Sidebar.jsx Outdated
Comment thread src/components/Sidebar.jsx Outdated
Comment on lines +255 to +262
<div
className={`overflow-hidden transition-all duration-300 ease-in-out ${
isCategoryExpanded
? "max-h-screen opacity-100"
: "max-h-0 opacity-0"
}`}
>
<div className="mt-0.5">

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Collapsed links stay in the tab order.

This only hides the subtree visually. The NavLinks remain mounted, so keyboard users can still tab into invisible agents while a category is collapsed. Remove the subtree from the focus order while closed, or unmount it after the collapse animation completes.

Also applies to: 263-295

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/Sidebar.jsx` around lines 255 - 262, In Sidebar’s category
expand/collapse block, the collapsed agent links are still mounted and reachable
by keyboard even when hidden. Update the logic around isCategoryExpanded so the
NavLink subtree is removed from the tab order while closed, either by
conditionally unmounting the list or by disabling focusability for the collapsed
state after the transition completes.

@AditthyaSS

Copy link
Copy Markdown
Owner

@manikanta-tamminana Please resolve conflicts

@mergify

mergify Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

⚠️ This branch is out of date with main.
Please click "Update branch" to sync before merging.

@mergify mergify Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

❌ Build is failing on this PR.
Please fix before merging:

  1. Run npm run build locally
  2. Fix any errors shown
  3. Push your fix — the check will re-run automatically
    Most common issue: broken registry import.
    Replace:
    import agents from '../agents/registry'
    With:
    import { useAgents } from '../lib/useAgents'
    const { agents } = useAgents()
    See CONTRIBUTING.md for help. 🙏

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/Sidebar.jsx`:
- Line 10: Remove the unused duplicate storage key constant from Sidebar so
there is only one source of truth for localStorage in this component. The issue
is the stray STORAGE_KEY declaration that is never referenced while the code
uses SIDEBAR_CATEGORY_STORAGE_KEY elsewhere; delete STORAGE_KEY and keep the
existing SIDEBAR_CATEGORY_STORAGE_KEY references in Sidebar to avoid the
conflicting leftover merge artifact.
- Around line 82-96: The Sidebar component has an extra closing brace after
toggleCategory that prematurely ends the enclosing function and causes the JSX
return to parse outside the component. Remove the stray brace/semicolon pair in
Sidebar.jsx so the toggleCategory function remains the last closed block before
the rest of Sidebar’s logic, preserving the component structure and resolving
the syntax error.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 585f310e-2e1d-4abe-8e94-579dbe7d2432

📥 Commits

Reviewing files that changed from the base of the PR and between 61270ac and 311e0cf.

📒 Files selected for processing (1)
  • src/components/Sidebar.jsx

const SIDEBAR_CATEGORY_STORAGE_KEY = 'sidebar-category-collapsed-state'

export default function Sidebar({ open, onClose }) {
const STORAGE_KEY = "sidebar-category-state";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Unused, conflicting storage-key constant.

STORAGE_KEY is defined here but never referenced — all localStorage reads/writes in this file use SIDEBAR_CATEGORY_STORAGE_KEY (Line 7). This duplicate constant with a different string value looks like leftover unresolved-merge-conflict code and should be removed.

🐛 Proposed fix
 export default function Sidebar({ open, onClose }) {
-  const STORAGE_KEY = "sidebar-category-state";
   const [sidebarSearchQuery, setSidebarSearchQuery] = useState('')
📝 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 STORAGE_KEY = "sidebar-category-state";
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/Sidebar.jsx` at line 10, Remove the unused duplicate storage
key constant from Sidebar so there is only one source of truth for localStorage
in this component. The issue is the stray STORAGE_KEY declaration that is never
referenced while the code uses SIDEBAR_CATEGORY_STORAGE_KEY elsewhere; delete
STORAGE_KEY and keep the existing SIDEBAR_CATEGORY_STORAGE_KEY references in
Sidebar to avoid the conflicting leftover merge artifact.

Comment thread src/components/Sidebar.jsx Outdated
@vercel

vercel Bot commented Jul 1, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
iloveagents Error Error Jul 1, 2026 3:21pm

@manikanta-tamminana

Copy link
Copy Markdown
Author

I've addressed the requested changes:

Removed the stray closing brace causing the build failure.
Cleaned up the sidebar changes and ensured the project builds successfully (npm run build passes).

Could you please re-review the PR? Thanks!

@mergify

mergify Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

⚠️ Hey @manikanta-tamminana! This PR has a merge conflict that needs to be resolved before we can review or merge it.
Please sync your branch with the latest main and fix the conflicts.
Need help? Check out resolving merge conflicts.
@AditthyaSS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants