Repository navigation
refactor(ui): split new-session page into draft owners - #122413
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
ea8fd49 to
8d94f45
Compare
|
Codex review: needs maintainer review before merge. Reviewed August 12, 2026, 12:04 AM ET / 04:04 UTC. ClawSweeper reviewWhat this changesThis PR splits the lazy new-session web page into gateway, place-browser, place-state, and submission-flow owners while preserving its existing route and UI behavior. Merge readinessKeep open for maintainer review: no blocking regression was found in the refactor, but the protected maintainer label requires an explicit landing decision after exact-head CI completes. Priority: P3 Review scores
Verification
How this fits togetherThe new-session Control UI gathers gateway identity, project or folder selection, and draft content before creating or opening an agent session. Its output is a selected session and navigation into chat, with cloud startup handed to the application owner. flowchart LR
Route[New-session route] --> Shell[Lazy page shell]
Shell --> Gateway[Gateway and preferences]
Shell --> Place[Project and destination state]
Place --> Submit[Session submission]
Submit --> Cloud[Cloud startup when selected]
Submit --> Chat[Selected chat session]
Decision needed
Why: The submitted patch has no concrete blocking defect, but the maintainer label requires a human landing choice for this large behavior-preserving UI ownership change. Before merge
Agent review detailsSecurityNone. PR surfaceSource +566, Tests +150, Other -1. Total +715 across 12 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the slim page shell and the four explicit owners, then land only once the remaining exact-head UI, type, and build checks confirm the behavior-preserving split. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR refactors an existing flow rather than reporting a distinct defect; the relevant route, browsing, and cloud-submission paths were traced in source. Is this the best way to solve the issue? Yes: moving stateful behavior into four focused owners while retaining the lazy route shell is a cleaner long-term boundary than preserving the 2,535-line monolith or adding wrappers around it. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2a1eba771342. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
* refactor(ui): split new-session page into draft owners * refactor(ui): delete duplicated draft plumbing * chore(lint): ratchet max-lines baseline after new-session split
What Problem This Solves
The lazy new-session page had grown to roughly 2,535 lines and owned gateway identity, project/filesystem browsing, destination selection, recovery, and submission in one custom element. That made state ownership and stale-request invalidation difficult to reason about and forced tests through private page-shaped seams.
Why This Change Was Made
This splits the page into four concept owners behind the existing lazy page entry:
DraftGatewayState,DraftPlaceBrowser,DraftPlaceState, andDraftSubmissionFlow. Each mutable field now has one owner, controllers exchange narrow snapshots and callbacks, route-side imports remain unchanged, and CSS/component registration stays in the lazy page module.A follow-up cleanup in the same stack removes the dead page type export, empty recovery branch, duplicate recovery projection, duplicate create-parameter assembly, duplicate browser reset blocks, and the unused three-state folder submission mode. The max-lines baseline is then ratcheted separately.
User Impact
This is behavior-preserving. New-session route ownership, project recents, cloud handoff, attachment recovery, access gating, workspace validation, destination switching, and immediate navigation continue to behave as before. The practical impact is a smaller page shell and explicit ownership boundaries for future changes.
Evidence
pnpm build: passed; the page remains lazy andcatalog-targetremains a separate dynamic asset.pnpm check:max-lines-ratchet --base origin/main: passed, 933 grandfathered entries.pnpm check:import-cycles: passed, 0 runtime value cycles.pnpm lint:tmp:export-name-collisions: passed.pnpm check:wrapper-shadowing: passed, 0 current and 0 baselined.pnpm plugin-sdk:surface:check: passed, 152 public subpaths verified.LOC split from
git diff --numstat origin/main...HEAD:No pathfinder bugs were found, so there are no separate behavior-bearing commits.