Fix Merge Conflict - Add collapsible sidebar with persistent state and responsive grid
Addressed Issues:
Fixes Issue
#942
Fixes Conflicted PR
#1116
Screenshots/Recordings:
NA
Additional Notes:
NA
AI Usage Disclosure:
We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact. AI slop is strongly discouraged and may lead to banning and blocking. Do not spam our repos with AI slop.
Check one of the checkboxes below:
- [ ] This PR does not contain AI-generated code at all.
- [x] This PR contains AI-generated code. I have read the AI Usage Policy and this PR complies with this policy. I have tested the code locally and I am responsible for it.
I have used the following AI models and tools: Claude
Checklist
- [x] My PR addresses a single issue, fixes a single bug or makes a single improvement.
- [x] My code follows the project's code style and conventions
- [x] If applicable, I have made corresponding changes or additions to the documentation
- [x] If applicable, I have made corresponding changes or additions to tests
- [x] My changes generate no new warnings or errors
- [x] I have joined the Discord server and I will share a link to this PR with the project maintainers there
- [x] I have read the Contribution Guidelines
- [x] Once I submit my PR, CodeRabbit AI will automatically review it and I will address CodeRabbit's comments.
- [x] I have filled this PR template completely and carefully, and I understand that my PR may be closed without review otherwise.
Summary by CodeRabbit
-
New Features
- Sidebar state now persists across sessions
- Added collapse/expand button with tooltip to the sidebar
- Gallery grid dynamically adjusts when the sidebar is expanded or collapsed
- App title updated to "PictoPy - AI-Powered Photo Manager"
-
Bug Fixes
- Fixed favorite image filtering logic to include truthy favorites
-
UI Improvements
- Enhanced sidebar footer with version info and smooth animations
- Improved sidebar interaction transitions
Walkthrough
Sidebar state is now persisted via a browser cookie and consumed by AppSidebar and ChronologicalGallery to drive animated footer behavior, chevron rotation, menu transitions, and a responsive image grid. Small independent edits update favorites filtering and the document title.
Changes
Sidebar state persistence and responsive layout
| Layer / File(s) | Summary |
|---|---|
Sidebar state cookie persistence frontend/src/components/ui/sidebar.tsx |
SidebarProvider reads sidebar_state cookie on mount to restore collapsed/expanded state, and writes the state back to the cookie on changes; cookie read/write errors are caught; some non-runtime comments were removed. |
Sidebar UI animations and footer redesign frontend/src/components/Navigation/Sidebar/AppSidebar.tsx |
AppSidebar uses useSidebar() to access open/toggleSidebar, animates the footer text and chevron, adds transition classes to menu buttons, and exposes a tooltip-wrapped toggle button whose label switches between "Collapse sidebar" and "Expand sidebar". |
Gallery responsive grid layout frontend/src/components/Media/ChronologicalGallery.tsx |
ChronologicalGallery imports useSidebar(), derives a gridMinSize from sidebar state, and applies it via inline gridTemplateColumns: repeat(auto-fill, minmax(gridMinSize, 1fr)) for responsive layout. |
Independent fixes and branding
| Layer / File(s) | Summary |
|---|---|
Favorites filtering logic frontend/src/pages/Home/MyFav.tsx |
MyFav now uses a truthy check (image.isFavourite) instead of strict equality (image.isFavourite === true) when filtering favorite images. |
Product branding frontend/index.html |
Document <title> updated to "PictoPy - AI-Powered Photo Manager". |
Estimated code review effort
🎯 2 (Simple) | ⏱️ ~12 minutes
Possibly related PRs
- AOSSIE-Org/PictoPy#634: Introduces
isFavouritefield from backend; this PR updates the frontend truthy check for filtering favorites, aligning with that change.
Suggested labels
TypeScript/JavaScript, Linter
Suggested reviewers
- rahulharpal1603
Poem
🐰 A sidebar keeps its secret in a bite, Cookies whisper open through the night, The gallery shifts to fit the view just right, Favorites find their stars, branding shines bright.
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| 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. |
| Title check | ✅ Passed | The title accurately describes the main changes: adding a collapsible sidebar with persistent state and making the grid responsive. |
✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ 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.
Comment @coderabbitai help to get the list of available commands and usage tips.
Hi @akshajtiwari, a collapsible sidebar is not on priority, let's add this in a future minor release. Until then, let's prioritize patches and bugs in the current v1.1.0 release
Thank you for the clarification Rohan,I’ll focus on patches and bug fixes right now.