fix(app): group sidebar sessions by opened directory - #810
Conversation
📝 WalkthroughWalkthroughThis PR resolves issue ChangesSidebar subfolder grouping and project rename resolution
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Suggested priority: P2 (includes user-path files (packages/app/src/pages/layout.tsx, packages/app/src/pages/layout/pawwork-session-source.ts, packages/app/src/pages/layout/pawwork-sidebar-session-rows.test.ts)).
P1/P0 are reserved for maintainer confirmation. Please relabel manually if this is a release blocker, security issue, data-loss risk, or updater/runtime failure.
There was a problem hiding this comment.
Code Review
This pull request refactors session project key and label resolution into centralized helper functions and updates the layout to use them. It also adjusts the logic for renaming project groups and opening the home directory to focus on the specific directory rather than the repository root. A reviewer noted that some logic in the project renaming function is redundant and potentially contradicts the PR's goal regarding sandbox renames, suggesting that this logic be centralized to ensure consistency.
Perf delta summaryComparator: pass
|
Summary
Why
Git subfolder sessions currently appear under the parent repository in the PawWork sidebar, even though the user opened the subfolder as the working directory. This keeps Git root metadata available for technical Git behavior while aligning the sidebar with the user's selected workspace.
Related Issue
Closes #806
Human Review Status
Approved by @Astro-Han
Review Focus
Please check that root project sessions still keep their project names, while Git subfolder sessions use the opened directory as their group identity.
Risk Notes
workspaceKey; no native shell, packaging, updater, or permission code changed.How To Verify
Screenshots or Recordings
Visual check:
bun run snap sidebargenerated and revieweddocs/design/preview/screenshots/sidebar.png.Checklist
bug,enhancement,task,documentation. Type labels are author-added; the labeler bot does NOT assign them. Add the label in the GitHub UI, then tick this.app,ui,platform,harness,ci. The labeler bot assigns these on PR open based on changed paths. Confirm the bot's choice (or override if wrong), then tick this.P0,P1,P2,P3. The priority-triage bot suggests one on PR open. Confirm or override, then tick this.Pending,Approved by @<reviewer>, orNot required: <reason>(default isPending; "not required" is restricted to bot-authored low-risk PRs).dev, and my PR title and commit messages use Conventional Commits in English.Summary by CodeRabbit
Release Notes
Improvements
Tests