Skip to content

refactor(ui): let session chips consume their place owner - #177641

Merged
steipete merged 3 commits into
mainfrom
solid2/w-new-session-chip-owners
Oct 19, 2026
Merged

steipete merged 3 commits into
mainfrom
solid2/w-new-session-chip-owners

Conversation

@steipete

@steipete steipete commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

New Session chips copy existing draft-place state and operations into three one-producer prop objects, duplicating data ownership and callback plumbing.

User Impact

No user-visible change. Target, project and checkout chips keep the same controls, keys, draft state, and placement behavior.

Why This Change Was Made

Read the existing place owner from chip renderers and remove the intermediate DTOs and assembly memos. Parent selection memos still resolve each input once. No new state owner or abstraction.

Production LOC: 2,095 → 1,926 (−169) across eight files. Test fixtures now use the existing owner contract. No markup/class/selector or styling changes; the before/after static class and id attribute multisets are identical.

Evidence

Check Result
UI typecheck (tsrs) Pass
where-chip / checkout-chip / placement-invalidation 17 / 27 / 2 tests pass
Independent Codex P0–P2 review Scoped-clean
Targeted lint/format Pass; two existing parent reactivity warnings unchanged
Production Knip Pass
Solid controller/effect/untrack/listener/query/flush/owner counts All 0 → 0

Proof captured before branch separation with the same code; only mechanical lint fixes followed. Relevant input files and dependency pins are unchanged on the new base. Broad proof runs in PR CI with ci:full for the shared picker/overlay behavior. No startup import or lazy-boundary change.

CI fixture repair

The initial head left the browser placement fixture on the retired chip props. All six viewport/direction cases failed with cloudSelection undefined, and the UI test typecheck found the same stale contract. The fixture now shares the existing owner-backed params and keeps its viewport, accessibility and folder-selection assertions. The repair removes 31 test lines; production remains −169 lines.

Proof: the six browser cases pass on the pinned Bun runner, pnpm tsgo:ui and the UI-page test typecheck pass, type-aware lint passes, and independent review found no actionable issue. A final type-aware lint correction uses vi.spyOn directly without changing behavior.

Full final PR accounting: production −169, tests/fixtures +113, whole PR −56 lines. Fresh lane scope baseline: 222,085 production lines (217,240 handwritten + 4,845 generated); target 4,442 removed.

Completed CI attribution

CI run 39320330189 completed for this exact head. Every selected runtime suite, including all Control UI and real-Gateway shards, passed. Only core typecheck and lint fail: missing createDeferredCore at src/gateway/local-http-probe.test.ts:154, resulting implicit-any at line 178, and typescript(prefer-promise-reject-errors) at line 178.

The actual tested merge f37a1cce56656e8eb4bbfb598c4b07a71c7e35f1 has main baseline 0548086d6a95525d7bad7f1905d2ae8c8d2de3ef and this exact PR head as ordered parents. Its failing test is byte-identical to that baseline and the literal main reproduction at 2cc639d70234, where the exact type and lint diagnostics reproduce. Main now contains the one-line import repair 08e32fdb4df0. Landing uses the documented inherited-failure route; no claim that failed CI was green.

@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 19, 2026
@clawsweeper

clawsweeper Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-19T20:47:07.070311Z 567691f New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@steipete
steipete enabled auto-merge (squash) October 19, 2026 19:34
@clawsweeper

clawsweeper Bot commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

The New Session chips consume the existing place owner directly instead of receiving three intermediate prop objects.

Example: Choose New worktree and enter release/next as the starting branch.

  • Before: The checkout chip forwards the edit through an assembled callback prop.
  • After: The checkout chip calls the existing place owner directly, with the same intended selection and focus behavior.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The production simplification is coherent, but the consumer cutover is incomplete and its layout and focus validation currently fails.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored refactor is outside the ordinary contributor-proof gate; supplied evidence covers focused component tests rather than a shipped Gateway UI run.
Patch quality 🦪 silver shellfish (2/6) 2 actionable review findings remain.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
Reason: The maintainer-directed change removes redundant prop assembly without adding a state owner, public API, configuration option, or intended behavior change.

Merge readiness

⛔ Needs changes before merge - 3 items remain

Keep this useful maintainer-directed refactor open; two missed test-consumer migrations cause confirmed CI failures.

Priority: P3
Reviewed head: 555fd206d9669f6b7ea68bb60c0c880832a8a622

Before merge

  • [P2] Migrate the picker focus tests to the new params contract (P2) - SessionPicker now requires params and dereferences params.place, but new-session-runtime.test.tsx still supplies the removed state prop. All three focus-return cases consequently throw before exercising their assertions, as confirmed by checks-ui (2/3). Update that caller to use the existing place/browser fixture with reactive open state, preserving the inside, body, and outside focus assertions.
  • [P2] Migrate the placement layout fixtures with the chips (P2) - pickerParams now returns complete chip props, but placement-controls.browser.test.ts still passes that result as params and supplies an old ProjectChip DTO. Its six viewport/direction cases therefore crash on missing place before testing layout or folder selection, matching checks-ui (1/3). Pass the new WhereChip props directly, construct ProjectChip from the existing owner fixture, and preserve the closed-popover setup and all layout/accessibility/selection assertions.
  • Complete next step - Have a maintainer inspect the unavailable check-test-types-core-5 diagnostic and classify its failure before landing; no PR causation is established.

Findings

  • [P2] [P2] Migrate the picker focus tests to the new params contract — ui/src/pages/new-session/picker.tsx:18
  • [P2] [P2] Migrate the placement layout fixtures with the chips — ui/src/pages/new-session/where-chip.test-support.ts:126

Tests

  • Missing end-to-end proof: No shipped New Session picker interaction is shown after this refactor.
Agent review details

How this fits together

The Control UI’s New Session page projects draft placement into Where, Project, and Checkout controls; selections return to the existing draft-place and browser owners.

flowchart LR
  A[New Session page] --> B[Place controls projection]
  B --> C[Where Project Checkout chips]
  C --> D[Shared session picker]
  C --> E[Draft place owner]
  D --> F[Draft browser owner]
  E --> F
Loading

Technical review

Best possible solution:

Keep the direct-owner refactor and complete the remaining chip and picker test-consumer migrations.

Do we have a high-confidence way to reproduce the issue?

No product bug is claimed; source inspection and exact-head CI independently establish the stale test-consumer failures.

Is this the best way to solve the issue?

The smallest complete refactor removes the intermediate DTOs while retaining the existing state owners, memoized selection facts, and all consumer assertions.

Full review comments:

  • [P2] [P2] Migrate the picker focus tests to the new params contract — ui/src/pages/new-session/picker.tsx:18
    SessionPicker now requires params and dereferences params.place, but new-session-runtime.test.tsx still supplies the removed state prop. All three focus-return cases consequently throw before exercising their assertions, as confirmed by checks-ui (2/3). Update that caller to use the existing place/browser fixture with reactive open state, preserving the inside, body, and outside focus assertions.
    Confidence: 1
  • [P2] [P2] Migrate the placement layout fixtures with the chips — ui/src/pages/new-session/where-chip.test-support.ts:126
    pickerParams now returns complete chip props, but placement-controls.browser.test.ts still passes that result as params and supplies an old ProjectChip DTO. Its six viewport/direction cases therefore crash on missing place before testing layout or folder selection, matching checks-ui (1/3). Pass the new WhereChip props directly, construct ProjectChip from the existing owner fixture, and preserve the closed-popover setup and all layout/accessibility/selection assertions.
    Confidence: 1

Overall correctness: patch is incorrect
Overall confidence: 0.99

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against d9bee70655af.

Provenance checked

Testing

Proof path: unit tests only.

Security

None.

Evidence

Acceptance criteria:

  • pnpm --dir ui test src/pages/new-session/new-session-runtime.test.tsx
  • pnpm --dir ui test src/pages/new-session/placement-controls.browser.test.ts
  • pnpm --dir ui test src/pages/new-session/where-chip.test.ts src/pages/new-session/checkout-chip.test.ts src/pages/new-session/placement-invalidation.test.tsx
  • pnpm tsgo:test:ui
  • pnpm tsgo:ui

What I checked:

PR surface

Source -169, Tests +147. Total -22 across 12 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 8 361 530 -169
Tests 4 217 70 +147
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 12 578 600 -22

Review metrics

Metric Value Why it matters
Production versus test LOC Production −169 LOC; tests and fixtures +147 LOC Removing intermediary production contracts is useful; fixture adaptation preserves existing coverage but currently misses two consumer suites.

Labels

Label changes:

  • add P3: This is an internal UI cleanup with no intended user-facing behavior change; the confirmed defects affect its validation.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P3: This is an internal UI cleanup with no intended user-facing behavior change; the confirmed defects affect its validation.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 19, 2026, 3:35 PM ET / 19:35 UTC.

@steipete
steipete disabled auto-merge October 19, 2026 19:53
@steipete
steipete merged commit 0931284 into main Oct 19, 2026
113 of 118 checks passed
@steipete
steipete deleted the solid2/w-new-session-chip-owners branch October 19, 2026 22:22
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 20, 2026
…77641)

* refactor(ui): let session chips consume their place owner

* test(ui): mount placement controls with canonical owners

* test(ui): update new-session focus fixture
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui ci:full Keep ordinary native-locale CI selection on the next PR run. size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant