Repository navigation
refactor(chat): own transcript DOM and async lifetimes - #176468
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7005f33679
ℹ️ 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".
| // Keep disclosure JSX in its chat partition instead of splitting | ||
| // compression dictionaries. Shipped byte/request budgets still apply. | ||
| minSize: 128 * 1024, | ||
| maxSize: (route === "shared" ? 1280 : 1408) * 1024, | ||
| maxSize: (route === "shared" ? 1280 : route === "chat" ? 1440 : 1408) * 1024, |
There was a problem hiding this comment.
Regenerate the boot manifest for the renamed chat modules
The chunk-size adjustment relies on controlUiBootModules, but this commit renames chat-selection-popup.ts to .tsx and adds three boot-path modules without regenerating ui/config/control-ui-boot-modules.json; the manifest still lists the deleted .ts path and none of the new modules. Consequently these modules do not match the measured chat group, so this limit change cannot reliably preserve the claimed chat partition/request layout. Run pnpm ui:boot-manifest:gen and commit its output before validating the build.
AGENTS.md reference: ui/AGENTS.md:L76-L77
Useful? React with 👍 / 👎.
|
Codex review: needs maintainer review before merge. What this changesThis PR replaces transcript DOM scans and imperative controls with shared element refs, Solid rendering, and owned asynchronous cleanup. Example: A video preview is parked when its chat pane becomes hidden.
Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-directed refactor remains useful, the four prior findings are repaired, and no actionable code defect was verified. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Control UI transcript turns session projections into retained message rows, navigation markers, media previews, and message controls. flowchart TD
A[Session projections] --> B[Retained transcript owner]
B --> C[Message rows]
C --> D[Shared element refs]
D --> E[Position rail and interactions]
C --> F[Owned media and comment reads]
E --> G[Solid menus and dialogs]
Technical reviewBest possible solution: Retain the refactor's existing transcript and resource owners, then land once the required checks and mergeability are settled. Do we have a high-confidence way to reproduce the issue? This refactor claims preserved behavior; source inspection disproved the proposed workspace-conflict regression, and no target code was executed during this read-only review. Is this the best way to solve the issue? The change reuses the transcript session, media owners, shared observer, and Solid disposal boundaries without introducing competing domain state or public configuration. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against c8c8e886daae. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +406, Tests +108, Other -1. Total +513 across 47 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 18, 2026, 6:57 PM ET / 22:57 UTC (Revision 2). |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 860d3f19f4
ℹ️ 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".
| element?: HTMLButtonElement; | ||
| }; | ||
|
|
||
| export function mountThreadMenu( |
There was a problem hiding this comment.
Inline the single-consumer menu helper
Repository-wide search finds mountThreadMenu used only by chat-thread-interactions.ts, so this separate 65-line module is a single-consumer wrapper introduced by a refactor that already grows touched production code by 387 net lines. The required Solid refactor guidance says new helpers need two callers and net production LOC must decrease; inline this JSX/lifecycle into its sole owner or consolidate it with an existing shared overlay implementation.
AGENTS.md reference: ui/AGENTS.md:L3-L5
Useful? React with 👍 / 👎.
|
The boot inventory is regenerated in The observer, image-listener, and connected-table fixture findings are fixed without dropping behavior assertions. The preceding fixture-repair head passed all three UI unit shards, all nine Control UI E2E shards, both real-Gateway shards, lint, types, and strict performance. The inline-menu suggestion is declined: the TSX module renders the menu and owns its Solid teardown, keeping the interaction owner in plain TypeScript. Inlining would change that owner's compilation contract without changing behavior. The production LOC tradeoff is recorded in the PR body. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
🦞👀 Re-review progress:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: eccb97babc
ℹ️ 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".
| <> | ||
| <div | ||
| class={state().bubbleClasses} | ||
| ref={(element) => entryRef?.(element)} |
There was a problem hiding this comment.
Register workspace-conflict bubbles with the transcript owner
When a workspace-conflict message is rendered, this registration ref exists only inside the normal-message fallback; WorkspaceConflictTranscriptMessage still emits a .chat-bubble with message IDs but never registers it. createPositionRail now obtains all observation targets exclusively from session.messageElements, while projectChatPositions still creates a marker for the visible conflict message, so its marker never receives IntersectionObserver visibility tracking or the data-visible state. Pass the registration ref through the conflict branch as part of the DOM-ref cutover.
AGENTS.md reference: AGENTS.md:L50-L51
Useful? React with 👍 / 👎.
d8ccdf4 to
2e9f95a
Compare
This comment has been minimized.
This comment has been minimized.
a6e092c to
f4615cc
Compare
b5e4353 to
3c4519c
Compare
|
Merged via squash.
|
* refactor(chat): own transcript DOM refs and popup lifecycles * refactor(chat): derive comment reads and bind message lifetimes * refactor(chat): use owned listener cleanup for selection cancellation * refactor(chat): share disclosure observation lifecycle * fix(ui): align transcript observation proof and simplify refs * test(ui): align transcript fixtures with owned lifetimes * build(ui): refresh transcript boot inventory * test(chat): retire comment editor before clearing fixture DOM * refactor(chat): streamline retained transcript bindings * refactor(ui): trim static transcript menu bindings * fix(ui): preserve transcript copy failure feedback * fix(chat): retain equivalent disclosure measurements * test(chat): dispatch bubbling composition key release * build(ui): regenerate transcript boot inventory after main refresh * build(ui): refresh transcript inventory after conflict repair * test(qa-lab): decode compressed transcript rows in media replay
What Problem This Solves
Transcript navigation and selection repeatedly searched their own DOM, while menus, comment previews, and video resources had separate imperative lifetimes. Mounted refs now serve navigation and actions; Solid owns the selection toolbar, annotation editor, menu, and confirmation. Async derivation cancels retired comment reads, parked videos release resources, and shared observer/listener primitives replace local wiring. Tags, classes, routes, selectors, domain owners, and lazy boundaries stay intact.
Equal parent redraws retain disclosure observers without layout reads. Changed HTML, expansion, presentation, size, and fonts still invalidate measurement. Copy failures remain visible and retryable. Seven geometry/focus queries remain for a separate focused follow-up; markdown owns the other query. No dependency, budget, ignore, or user migration is added.
The last full CI run exposed a directly coupled test reader that assumed plain JSON transcript storage. Valid compressed rows store
event_json = NULLand payload bytes inevent_zstd. This PR now decodes that existing representation while keeping every replay assertion unchanged; independent P0–P2 review found no actionable issue.Evidence
Base
aba4ede1e9fff6ea552d72aaba7cc0bc68e5b682; candidate3c4519c52960aa552094ab94be52b140d042062d. The latest rebase preserves the reviewed rendering patches unchanged. Earlier conflict resolution retained main's viewport cleanup and stronger selection-readiness helper.createEffectcreateRenderEffectuntrackSupplemental counts: controller patterns 0; manual-class regex 1 (announcement text);
flush4 (three local buffer methods and virtual-rail keyboard DOM commitment); owner captures 3 (markdown/media and retained render roots).Four intentional initial snapshots: keyed message identity (
chat-message-bubble-view.tsx:100), preview dimensions (chat-message-images-solid.tsx:654), rail identity (chat-position-rail-view.tsx:196), and attachment identity (chat-selection-annotations.tsx:55). The sole effect synchronizes QR expiry with its media owner (chat-message-bubble-view.tsx:103). Markdown retains its foreign-DOM query (chat-message-overflow.ts:130); the other seven queries are in the prepared geometry follow-up.pnpm tsgo:ui(tsrs)pnpm tsgo:extensions:test(tsrs)--maxWorkers=1; inputs unchanged by rebaseci:fullretainedThe local base replay attempt did not reach Vitest: private runtime preparation failed resolving built-plugin SDK modules. This is a setup gap, not evidence that the failing replay test is inherited. Current-head full CI passed the repaired reader and both real-Gateway shards.
Changed-file LOC: production 9,696 → 10,075 (+379); tests/helpers 10,465 → 10,638 (+173); inventories +2. Growth replaces imperative DOM construction with owned JSX, refs, and explicit cancellation/cleanup; no parallel renderer remains.
Both sides were built on this machine using Node 24.22.0. Strict performance fails both route caps on the base; the candidate passes chat and exceeds the unchanged new-session cap by 455 B. Startup and every request budget pass. The small startup increase accompanies inventory/chunk regrouping, while route totals drop by about 51 KB and 40 KB. The chat partition hint changes 1408→1440 KiB to retain the request layout. No budget, ignore, or dependency changed, and the new bindings remain in chat's lazy group.
Before/after captures use a synthetic local mock at 1440×1000. The menu follows its real context-menu path; confirmation uses the real component with a synthetic trigger. Full frames were inspected before upload. Rendering patches remain identical after the rebase.