Repository navigation
refactor(ui): name Talk media owners and share listener cleanup - #174105
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. |
|
Codex review: needs maintainer review before merge. What this changesThis PR renames Talk media acquisition classes as owners, reuses listener cleanup, and simplifies translated media errors. Review scores
ProductKind: Refactor · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: the maintainer-directed refactor preserves the existing media lifecycle contracts, completes the caller migration, and introduces no actionable defect found in this review. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherChat Talk and dictation acquire browser media through shared owners, then transfer streams to transports that publish audio, video, and lifecycle events. flowchart LR
A[Chat and dictation] --> B[Microphone owner]
B --> C[Browser media devices]
B --> D[Talk transports]
D --> E[Camera owner]
E --> C
D --> F[Provider and Gateway]
Technical reviewBest possible solution: Retain the focused refactor with its existing media owners, cancellation rules, and translated errors. Do we have a high-confidence way to reproduce the issue? This PR claims a behavior-preserving refactor rather than a user bug; source comparison supports equivalence, and no target code was executed. Is this the best way to solve the issue? The implementation is appropriately small: it reuses the existing listener helper, migrates callers together, and retains media lifecycle ownership without compatibility wrappers. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 527f9d1a1306. Provenance checked
TestingProof path: unit tests only. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource -3, Tests 0. Total -3 across 11 files. Added test files: 0. View PR surface stats
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 Reviewed October 16, 2026, 6:35 AM ET / 10:35 UTC. |
|
Merged via squash.
|
The Talk media-owner refactor in 19a4ee3 (#174105) kept dropping DOMException causes so the UI formatter would not append native details to translated guidance. Moving that throw inside catch required a new preserve-caught-error suppression and broke the fixed inventory on main. Add UserFacingError to the existing UI formatter owner: its message is complete presentation text, still redacted, while its cause is retained for diagnostics. Talk supplies the native cause. Ordinary Error formatting, localized messages, cancellation, and device selection remain unchanged. Remove the suppression without changing any allowlist or ratchet baseline. The camera boundary regression fails before the fix because cause is undefined (6.43s). All 41 focused tests pass (20.55s), with the existing assertions retained; corrected input test passes again (3.37s). UI build, production and test types, type-aware/boundary lint, formatting, full architecture checks, assertion safety, and isolated P2 review pass. The two unrelated full-tree deadcode findings are covered by #174173 and #174181. The earlier media-facts assertion allowance was already corrected by d8a406e; this commit changes no baseline.
…#174200) The Talk media-owner refactor in a4fdc0c (openclaw#174105) kept dropping DOMException causes so the UI formatter would not append native details to translated guidance. Moving that throw inside catch required a new preserve-caught-error suppression and broke the fixed inventory on main. Add UserFacingError to the existing UI formatter owner: its message is complete presentation text, still redacted, while its cause is retained for diagnostics. Talk supplies the native cause. Ordinary Error formatting, localized messages, cancellation, and device selection remain unchanged. Remove the suppression without changing any allowlist or ratchet baseline. The camera boundary regression fails before the fix because cause is undefined (6.43s). All 41 focused tests pass (20.55s), with the existing assertions retained; corrected input test passes again (3.37s). UI build, production and test types, type-aware/boundary lint, formatting, full architecture checks, assertion safety, and isolated P2 review pass. The two unrelated full-tree deadcode findings are covered by openclaw#174173 and openclaw#174181. The earlier media-facts assertion allowance was already corrected by ac578b3; this commit changes no baseline.
What Problem This Solves
Talk's microphone and camera acquisition classes still used controller names despite owning synchronous media state rather than a view lifecycle.
User Impact
No user-visible change. Device selection, permission cancellation, camera switching, and transport handoff keep their existing behavior.
Why This Change Was Made
Name the two classes as domain owners and migrate every caller, including dictation. Keep their synchronous mutation/read contract in plain TypeScript. The camera module moves to
camera-owner.tswith no compatibility facade.Device-change and video-readiness subscriptions use the shared listener teardown helper. Media acquisition throws its translated error directly instead of carrying a string-or-stream union outside the catch. The existing omission of a DOMException cause is retained because the shared formatter would append its legacy numeric code.
Evidence
pnpm tsgo:uitalk/input.test.tschat-composer.test.tstalk/webrtc-video.test.tsci:fullrequestedNo boot imports, rendered output, tags, selectors, or styles changed. No local build/E2E or screenshots were run for this nonvisual refactor; startup bytes were not remeasured.
createEffect/createRenderEffect/untrackaddEventListenerflush/ owner captureThe class-string regex match is dictation transcript text joined with spaces, not a CSS class. Remaining native subscriptions belong to media tracks, sockets/peers, or Gateway transport lifetimes; those owners release resources, pair subscriptions with cancellation/teardown, and guard retired asynchronous work. Tests change only their owner references; no additional test scaffolding.