Skip to content

refactor: keep chat keyboard admission with surface owners - #176390

Merged
steipete merged 3 commits into
mainfrom
solid2/w-zero-chat-keyboard-owners
Oct 19, 2026
Merged

steipete merged 3 commits into
mainfrom
solid2/w-zero-chat-keyboard-owners

Conversation

@steipete

@steipete steipete commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Chat keyboard handoff and rename discover elements owned by other renderers through selectors. This change passes the composer ref, reads live menu-item registrations, and lets the rename input own focus and selection.

User Impact

Printable input still transfers to the composer, enabled menu shortcuts retain priority, and modal surfaces keep keyboard ownership. Rename opens focused with its text selected and preserves disabled-action and native IME handling. Tags, CSS classes, and routes are unchanged.

Implementation

Menu shortcuts consume the existing focus owner's live items. The legacy model picker publishes its filtered rows to the same reader. Modal surfaces register with the existing overlay owner. Shortcut admission stays shared with New Session; activation stays in the lazy chat bundle and checks the owned surface followed by registered event-path surfaces.

Main #176586 removed the final sharing caller. This change integrates that verified merge and removes the retired CHAT_COMPOSER_TEXTAREA_SELECTOR export.

The branch preserves main's memo-based sidebar status, Solid Portal confirmation rendering, stronger background-refresh focus test, model-picker lazy lookup, and disabled rename guards. Main #177006 now owns the public transcript-reader repair; the two redundant test commits have been dropped.

Evidence

Candidate: 75324743662a1f4b5c4cf555488bb4d249cabdb8; branch merge base: 99f5d0f8e4e0b1f8bee63b631620439069ac3003. Current CI tests merge b876496cdc7adca82d8647af2da73fa87cdaab08, whose ordered parents are protected main acb98dbf5bc37b7ae9598615aed158c4144e640e and this candidate.

The two retained keyboard commits are patch-identical to the independently reviewed 1274cff candidate. Main #176586 merged cleanly; its sentinel/element registrations are preserved. The only additional production edit removes the now-unused selector export. The final linear rebase has the identical source tree (1841a58a7e1508b0f991925635bea1914df561f3) as the tested integrated candidate; git diff --exit-code ffb2b7026dc4 HEAD passed.

Check Result
UI typecheck Passed on final keyboard-only candidate
Keyboard behavior Integrated keyboard-focus file: 30 passed in its configured isolated project; prior 42 focused keyboard/menu/native-link cases passed; nested move-to-group regression is red without event-path lookup and green with it
Model-picker browser cases 15 passed on reconciled keyboard change
Conflict-focused proof Rewind confirmation: 9 passed; retained shell sidebar/outlet drawer case: 1 passed
Formatting and whitespace Retained patches passed formatter; final git diff --check passed
Independent review Retained keyboard patches scoped-clean at P0–P2; whole 1274cff pass correct at 0.85; final range-diff confirms unchanged patches
Production Knip Passed on the integrated candidate, with no findings
Full CI Current-head 39217482613: all three UI unit shards, all nine browser E2E shards, both real-Gateway shards, lint, production types, architecture and guards passed. Only two root failures remain, both with exact baseline evidence below
Lazy boundary Shared registration/admission; activation remains chat-only

Current-head CI 39217482613, performance job 117945118161, built the candidate and base together using Node 24.21.0. The strict budgets are unchanged:

Measurement Result
Startup JS 337,211 B gzip; 7 requests; passed
Startup CSS 38,500 B gzip; 1 request; passed
Chat boot 1,486,474 → 1,486,793 B (+319); passed
New Session boot 1,050,258 → 1,050,523 B (+265); 1,050,000 B absolute limit

The sole performance violation is new boot JS gzip. Latest completed scheduled main 39213328992, job 117931610693, fails that exact metric at 1,050,257 B. An independent strict run on exact CI base acb98dbf5bc3 also fails only this metric at 1,050,568 B (Node 24.22.0; canonical build passed). The PR adds 265 B in the paired CI build; that increment is recorded, not labeled inherited. No budget or exception changed.

Core test-typecheck job 117945717667 fails only src/gateway/server-methods/control-ui.test.ts(485,7): TS2353: 'load' does not exist in type 'SubscriptionDeps'. Running the same gateway-methods type leaf on exact CI base acb98dbf5bc3 reproduces that exact error and exit 2. The failing test and subscription owner have identical Git blobs in the base and tested merge. Latest completed scheduled main predates this error; it is not claimed as matching typecheck evidence.

Assigned keyboard-ref scope (chat-pane-shared.ts, chat-pane-session-menu.ts), counting typed and untyped calls:

Pattern Before After
createEffect 0 0
createRenderEffect 0 0
untrack 0 0
addEventListener 0 0
querySelector(All) 6 0

Across 16 coupled production files, queries fall 29 → 21; two effects and two initial snapshots remain in the menu owner. Direct listeners and render effects are zero. Production LOC is 6,626 → 6,735 (+109); eight test files are 2,104 → 2,148 (+44). The growth publishes and releases renderer-owned references and preserves shortcut admission across two loading boundaries. The simplification pass found no smaller complete cutover.

Unchanged patterns in coupled owners outside the assigned keyboard-ref scope
  • Effects: solid/menu.tsx:180,293.
  • Initial snapshots: solid/menu.tsx:164,415.
  • Direct listeners: none.
  • Queries: solid/menu.tsx:194,220,234,310; chat-model-picker-search.ts:13,28,29,39,51,57,82,88,129,142,148,182,189,203,212,307,318.

These existing patterns remain with their owner lanes. No target pattern survives in the assigned keyboard-ref files.

Synthetic captures verify the unchanged menu and rename layout:

Before: synthetic rename focus and selection

After: synthetic rename focus and selection

Before: synthetic session menu

After: synthetic session menu

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

clawsweeper Bot commented Oct 18, 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 18, 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-19T07:44:00.308962Z 7532474 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.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 18, 2026
@clawsweeper

clawsweeper Bot commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR replaces cross-renderer keyboard and focus queries with composer refs, live menu registrations, and modal-surface registrations.

Example: Rename the session “Synthetic keyboard review” from its header menu.

  • Before: The pane queries the independently rendered input to focus it and select its title.
  • After: The mounted rename input owns focus and selection, preserving the same interaction.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The ownership cutover is coherent and earlier findings are fixed; supplied direct interaction evidence remains limited.
Proof confidence 🦐 gold shrimp (3/6) The ordinary contributor proof gate does not apply to this maintainer-authored PR; inspected Control UI captures support menu presentation, while interaction coverage comes from reported focused tests and verified final-head CI outcomes.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: Typing handoff, menu shortcuts, modal keyboard ownership, and rename focus must remain reliable as renderer ownership becomes explicit.
Reason: The maintainer-authored direction consolidates existing ownership without adding settings or public contracts; the recorded justification supports the necessary code growth.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-directed ownership refactor remains useful, all four earlier findings are repaired, and no new actionable defect was found.

Priority: P2
Reviewed head: b7bbc6f7d3b2859e3b66a9d52fa2bf791f3a9fe0

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The supplied captures do not show dynamic printable-key handoff or modal suppression, and the after-rename image does not show the input.
Agent review details

How this fits together

Control UI document-key handlers consult menu and modal ownership before transferring printable input to the Chat or New Session composer.

flowchart TD
  A[Keyboard event] --> B[Chat or New Session]
  B --> C[Surface registrations]
  C --> D[Menu shortcut admission]
  C --> E[Modal keyboard ownership]
  B --> F[Composer textarea ref]
  D --> G[Lazy menu activation]
Loading

Technical review

Best possible solution:

Retain this owner-based cutover and handle the documented inherited performance failure through the existing landing workflow.

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

This is a behavior-preserving refactor; source inspection verifies the earlier fixture repairs, and no target code was executed during review.

Is this the best way to solve the issue?

The change uses existing composer, menu-binding, and overlay owners, removes their competing query paths, and preserves a still-used selector until its separate consumer cutover.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Printable-key routing keeps the original intent (57c752a: Preserve the first typed character while keeping control and overlay key classes with their owners.)
  • Native menu shortcuts keeps the original intent (dc61fee: Use the shared native Menu while retaining session actions, permission checks, focus, navigation, and dismissal.)
  • Editable-target shortcut exclusion keeps the original intent (209dc0e: Search inputs in session menus must accept typing without triggering menu accelerators.)
  • Header rename focus keeps the original intent (9d77e5c: Expose session management in the header, including rename with focused, selected title text.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit 86abec4 adds ui/src/pages/chat/chat-pane-shared.ts:217 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 86abec416118; files: ui/src/pages/chat/chat-pane-shared.ts)
  • Vyctor H. Brzezowski: Raw commit 57c752a adds ui/src/pages/chat/chat-pane-shared.ts:290 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 57c752a46c04; files: ui/src/pages/chat/chat-pane-shared.ts)

PR surface

Source +110, Tests +44. Total +154 across 24 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 16 218 108 +110
Tests 8 72 28 +44
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 24 290 136 +154

Review metrics

Metric Value Why it matters
Production versus test growth Production +218/-108, net +110; tests +72/-28, net +44 The growth publishes renderer-owned references and registrations while preserving shared admission and lazy activation; the simplification review found no definite unnecessary machinery.

Labels

Label changes:

  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: A focused Control UI ownership refactor with repaired regressions and no demonstrated urgent user-facing failure.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-18T20:26:10.722Z sha 9f5ed2e :: needs changes before merge. :: [P2] Keep popover matching compatible with the JSDOM native-state shim | [P2] Bind retained-pane fixture textareas to their composer owner | [P2] Register the sidebar shortcut fixture's modal surface | [P2] Give the New Session routing fixture a registered overlay

Reviewed October 19, 2026, 3:23 AM ET / 07:23 UTC (Revision 2).

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 829c57b484

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

events?: ReturnType<typeof createRegistryEvents>;
};
const registries = new WeakMap<Document, OverlayRegistry>();
const modalSurfaces = new Set<HTMLElement>();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Reduce production LOC for this Solid refactor

This behavior-preserving refactor adds 149 net production lines, primarily through the new global modal/shortcut registries and per-surface registration plumbing. The required checklist for refactoring existing Solid code explicitly requires production LOC to decrease, so this cutover should be consolidated into the existing overlay/modal owners or otherwise simplified before landing.

AGENTS.md reference: ui/AGENTS.md:L3-L5

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Declining this LOC-only finding under the explicit wave-zero assignment: “LOC: prefer smaller; growth needed for correctness or the idiom is fine — report it, never stop for it.”

The final keyboard-only change is 6,623 → 6,733 production lines (+110), with the assigned cross-renderer queries reduced 6 → 0. The growth publishes and releases renderer-owned references and live menu items while preserving shortcut admission across the chat/New Session loading boundary. The PR body records these counts and the simplification pass. This finding identifies no behavioral defect.

The earlier fixture findings are repaired; final-head run 39212569092 passed every unit, UI E2E, and real-Gateway job. Its only substantive failure is the separately documented New Session bundle threshold, which also fails on the exact paired base.

@steipete steipete closed this Oct 18, 2026
@steipete steipete reopened this Oct 18, 2026
@steipete
steipete force-pushed the solid2/w-zero-chat-keyboard-owners branch 3 times, most recently from 6a3f333 to ada1b9d Compare October 19, 2026 02:21
@steipete
steipete force-pushed the solid2/w-zero-chat-keyboard-owners branch from ada1b9d to b280e78 Compare October 19, 2026 05:09
@steipete
steipete force-pushed the solid2/w-zero-chat-keyboard-owners branch 2 times, most recently from 1274cff to b7bbc6f Compare October 19, 2026 06:53
@steipete

Copy link
Copy Markdown
Contributor Author

The earlier popover-shim and fixture cutover findings are fixed on the current head. Final-head CI 39212569092 passes every unit, UI E2E, and real-Gateway job; the remaining New Session bundle failure and exact-base reproduction are recorded in the body. The LOC-only finding is declined under the explicit wave-zero instruction allowing necessary, reported growth.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Oct 19, 2026
@clawsweeper clawsweeper Bot removed the clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. label Oct 19, 2026
@steipete
steipete force-pushed the solid2/w-zero-chat-keyboard-owners branch from b7bbc6f to 7532474 Compare October 19, 2026 07:40
@steipete
steipete enabled auto-merge (squash) October 19, 2026 07:49
@steipete
steipete disabled auto-merge October 19, 2026 07:59
@steipete
steipete merged commit ae08cd6 into main Oct 19, 2026
109 of 113 checks passed
@steipete
steipete deleted the solid2/w-zero-chat-keyboard-owners branch October 19, 2026 08:08
@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
…176390)

* refactor: keep chat keyboard admission with surface owners

* fix(ui): keep menu shortcut activation behind chat loading

* refactor(ui): remove retired composer selector
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. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant