Skip to content

refactor(ui): name Talk media owners and share listener cleanup - #174105

Merged
steipete merged 1 commit into
mainfrom
solid2/w-idiom-chat-c-talk-owners
Oct 16, 2026
Merged

steipete merged 1 commit into
mainfrom
solid2/w-idiom-chat-c-talk-owners

Conversation

@steipete

Copy link
Copy Markdown
Contributor

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.ts with 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

Check Result
pnpm tsgo:ui Passed
talk/input.test.ts 27 passed
chat-composer.test.ts 20 passed
talk/webrtc-video.test.ts 7 passed
Focused lint / formatting Passed
Production Knip Passed
Independent review No actionable P0–P2 findings; caller inventory and shared helper additionally inspected locally
Codemod dry-run Done; cancellation diagnostics remain with the plain TypeScript owners
Broad UI proof ci:full requested

No 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.

Touched production metric Before After
LOC 3,478 3,475
Controller-pattern lines 2 0
createEffect / createRenderEffect / untrack 0 0
addEventListener 18 16
DOM queries / flush / owner capture 0 0
Class-string regex 1 1

The 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.

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

clawsweeper Bot commented Oct 16, 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 16, 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-16T10:23:12.053111Z 8e2a32d PR opened
ℹ️ 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 P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 16, 2026
@clawsweeper

clawsweeper Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR renames Talk media acquisition classes as owners, reuses listener cleanup, and simplifies translated media errors.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is focused and source-consistent; validation is reported and supported by CI, but no supplied runtime demonstration exercises the refactored media paths.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored internal refactor is outside the ordinary contributor proof gate; supplied evidence consists of reported focused tests and static checks, with no browser Talk or dictation runtime capture.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes · Fix scope: Complete
User problem: No user-visible problem is claimed; media acquisition names and repeated subscription cleanup obscure existing ownership.
Reason: Maintainer-authored direction is established, and the patch makes a complete internal naming cutover while preserving the existing behavior.

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
Reviewed head: 8e2a32dcf39844caa292babc4e90222a315e8200

Before merge

None.

Findings

None.

Agent review details

How this fits together

Chat 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]
Loading

Technical review

Best 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

Testing

Proof path: unit tests only.

Security

None.

Evidence

What I checked:

  • Pinned PR changes: The introduced diff contains internal renames, equivalent listener teardown, and an equivalent translated-error throw; the camera implementation changes only identifiers. (ui/src/pages/chat/talk/camera-owner.ts:12, 8e2a32dcf398)
  • Complete caller cutover: Repository-wide search found no remaining references to the retired microphone class, camera class, or camera module; Talk transports, session startup, dictation, and test support use the renamed owners. (ui/src/pages/chat/composer-dictation-session.ts:58, 8e2a32dcf398)
  • Shared listener contract: The existing helper adds and removes the same listener arguments without reactive imports or lifecycle machinery, preserving picker unsubscribe and video-readiness cleanup. (ui/src/lib/reactive/listener.ts:1, 8e2a32dcf398)
  • Current-main comparison: The relevant Talk and dictation production paths match the introduction base on fetched main; the proposed owner naming has not already landed there. (ui/src/pages/chat/talk/input.ts, 527f9d1a1306)
  • Preserved original intent: The merged discussion at refactor(ui): deslop UI pages fourth pass #159549 explicitly retained translated media failures without a DOMException cause to avoid changing visible error text; this PR preserves that choice. (ui/src/pages/chat/talk/input.ts:257, 620d02a70e3e)
  • Discussion and validation: The full PR body reports focused tests, UI types, lint, formatting, and Knip, and explicitly supplies no browser runtime capture; current checks show no failed job, with two real-Gateway E2E jobs and the aggregate gate still pending. (8e2a32dcf398)

Likely related people:

  • Vincent Koc: Raw commit 5394bb1 adds ui/src/pages/chat/realtime-talk-input.ts:194 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 5394bb1069a7; files: ui/src/pages/chat/realtime-talk-input.ts)
  • Vyctor H. Brzezowski: Raw commit 3f4564f adds ui/src/pages/chat/realtime-talk-input.ts:87 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 3f4564f56fb7; files: ui/src/pages/chat/realtime-talk-input.ts)

PR surface

Source -3, Tests 0. Total -3 across 11 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 8 25 28 -3
Tests 3 7 7 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 11 32 35 -3

Labels

Label changes:

  • add P3: This is a small internal cleanup with no intended user-visible behavior or persisted-contract change.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This is a small internal cleanup with no intended user-visible behavior or persisted-contract change.
  • 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.

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 16, 2026, 6:35 AM ET / 10:35 UTC.

@steipete
steipete merged commit 19a4ee3 into main Oct 16, 2026
102 of 103 checks passed
@steipete
steipete deleted the solid2/w-idiom-chat-c-talk-owners branch October 16, 2026 11:15
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Oct 16, 2026
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.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 17, 2026
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 17, 2026
…#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.
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. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S 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