refactor(app): extract pawwork project/pinned controls from layout.tsx - #1060
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR refactors pawwork sidebar controls by extracting pinned session, project visibility, sorting, and rename handlers from ChangesPawwork Project Controls Extraction
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
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-project-controls.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 the Layout component by extracting several project-related control functions (such as pinning sessions, dragging sessions, collapsing/hiding/renaming projects) into a new helper function createPawworkProjectControls in a separate file. This improves code modularity and readability. There are no review comments, and I have no additional feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Summary
Pure extraction (layout governance slice 3, refs #1056) of the pawwork project/pinned organization actions out of
packages/app/src/pages/layout.tsxinto a dedicated controller,packages/app/src/pages/layout/pawwork-project-controls.ts.What moved (verbatim, no behavior change)
togglePinnedSession,dragPawworkSession(cross-zone All<->Pinned drag + intra-pinned reorder),movePinnedSessionByOne(menu-driven reorder)setPawworkSortMode,toggleProjectCollapsed,expandPawworkProjectGrouphideProject,unhideProject,handleRenameProjectExposed as
createPawworkProjectControls(input)taking reactive accessors (projects,sessions) plus the layout-ownedrenameProject/setWorkspaceNameas injected deps, andstore/setStore/language. All 9 functions are returned and destructured back into layout.tsx with identical names, so every call site (sidebar render props, keyboard-navnavigateSessionByOffset/navigateSessionByUnseencallingexpandPawworkProjectGroup, and the navigation helpers callingunhideProject) is byte-unchanged.dragPawworkSession/movePinnedSessionByOnehad a param literally namedinput; renamed toargsto avoid shadowing the controller'sinput— local rename only, no contract change.Scope boundary
Navigation wrappers (
navigateToSession,navigateToProject,openPawworkHome,syncSessionRoute) stay in layout.tsx: they are thin shells over the already-extractedshellNavigation+projectRootrouting infra and belong with the routing slice (4), not here. Slice 3 narrows to the cohesive project/pinned organization subset (the tracking issue allows order/scope to shift with real dependencies).Touched files
packages/app/src/pages/layout.tsx(+23 / -129; 1704->1598 lines; removed 9 fn defs + 4 now-unused imports:reconcile,resolvePawworkProjectRenameTarget,reorderPawworkPinnedByVisible,unpinPawworkSession)packages/app/src/pages/layout/pawwork-project-controls.ts(new, ~165 lines)Verification
bun turbo typecheck: 8/8 passcd packages/app && bun test src/pages/layout: 158 pass / 0 failreorderPawworkPinnedByVisible/unpinPawworkSession/resolvePawworkProjectRenameTarget) are unchanged and already unit-tested. Sidebar interaction is identical (same-name destructure, render props unchanged) — relying on CIe2e-artifactsfor the rendered sidebar path.Risk
Low — mechanical extraction.
pages/layout.tsxis also touched by open PR #1053 (automation); changed regions do not overlap (this PR: mid-file fn block; #1053: imports + command region + render tail). Per repo owner, #1053 rebases after this merges.Refs #1056, follow-up to #875.
Summary by CodeRabbit