Skip to content

refactor(room): deduplicate room and controls helpers - #76

Merged
kixelated merged 7 commits into
mainfrom
quest/m1/dedupe-room-helpers
Nov 27, 2026
Merged

kixelated merged 7 commits into
mainfrom
quest/m1/dedupe-room-helpers

Conversation

@kixelated

@kixelated kixelated commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

Finishes quest/m1/dedupe-room-helpers.md.

Problem

Room overlays, renderers, settings, and controls each wrote the same logic several times, and the tile sources carried placeholder signals that only existed to satisfy the BroadcastSource union.

Approach

Duplicate counts were re-checked against current main (after #63, #64, #68, #74):

Plan item Count on main Change
Canvas-to-page positioning (chat, debug, name, locator) 4, scroll follow in 3 Canvas.page(bounds) plus Broadcast.overlay(effect, root, place), which also owns the z-index each overlay set. Name, Chat, Debug (and Cursor) read broadcast.canvas.
space.ts hover swap, z bump, point-in-bounds already one helper each (#hover, Gesture.Stack.raise, Bounds.contains) since #63 Only merged the mouse/touch release bodies into #release.
Fade opacity (broadcast, video x2) 3 fade(active, since, now) in canvas.ts.
Deformation uniforms (border, audio, broadcast renderers) 3 x 5 uniforms Deformation in gl/shader.ts; createAttribute returns the location number.
index.ts camera/screen and locator effects 2 + 2 One loop; space.add is generic, so no casts.
BroadcastSource placeholders Debug's publish branch was already removed by #64 Dropped catalog/target/active from HangLocalSource and FakeBroadcast, source from WatchBroadcast and FakeBroadcast; the share's sources are computeds instead of a cast-and-set.
room/preview/ 3 files Deleted; preview.tsx uses @moq/room's Room directly.
Click outside 4 in controls.tsx + 1 in meme-selector.tsx onClickOutside(inside, close) in util/solid.ts; the meme selector's 100 ms timer is gone.
Visualize RMS meter 1 copy of room/audio.ts Both call level(previous, magnitudes) from room/audio.ts; the meter still reads the microphone capture.
Settings persistence 18 effect.subscribe blocks persisted(key, parse); gain reuses Speaker.validVolume.
Pan ramps (Audio, PannedSound) 2, different curves steer(effect, panner, pan) in sound.ts.

Net: about 430 fewer lines.

Decisions

Taken while the maintainer was away; each is easy to flip.

  • Click outside listens in the capture phase everywhere, and the meme selector counts its toggle button as inside. The quest suggested stopping the opening click's propagation instead, but Solid delegates onClick to document, so stopPropagation cannot stop a document listener; a capture listener added during the opening click never sees it, and checks the target before a handler re-renders it away (the reason the mobile collapse already used capture).
  • One pan curve: the voice's (on-screen tiles pan within about +-0.5). Memes and notifications on a tile used to pan twice as far; they now match the tile's voice. Alternative: double both, which hard-pans voices at the screen edges.
  • The mic meter shares the tile's level math rather than reading the tile's level, unlike the quest's plan: the tile's level includes its memes and notifications, which lit the mic button with the mic off, and the profile card has no tile without WebGL2. Review round 1 found this.
  • Leaving the room fades both of our own tiles; the screen share's tile used to be closed at once. Remote tiles still close at once.
  • The locator now follows page scroll like the other overlays, and a touch release resets the body cursor like a mouse release (invisible on touch).
  • Without WebGPU, the stored captions-capture choice is removed once at load, as the old subscription did on its first run.
  • feat(room): stream into and out of a hang from OBS or the CLI #69's stream dialog keeps its own close handling. It is a modal whose backdrop onClick closes it and whose panel stops propagation, plus an Escape key handler; that is not the document-level click-outside onClickOutside replaces, and it persists nothing, so folding it in would not remove code. Merging main only moved its OBS fallback name into Name's shared overlay placement and passed the tile's path through the generic Space.add.
  • Of the post-merge review's notes, took the stale quest/m2/e2ee-rooms.md pointer (now PreviewRoom in app/src/preview.tsx); left the mobile section staying collapsed after a narrow-wide-narrow resize with an outside click in between (rare, and collapsing is harmless) and deriving the gain slider's bounds from Speaker.VOLUME_RANGE (the bounds match today).

Impact

No public API or wire change: everything touched is app-internal. Stored settings keep the same keys and formats, so older and newer tabs read each other's values.

Validation

Follow-ups

None.

Models

Size: M
Implementer: Claude Code, claude-opus-5-5, high
Implementer: Claude Code, claude-opus-5-5, high effort (iterate, S)

🤖 Generated with Claude Code

(Written by Claude Opus 5.5 with high effort)

Review

Rewritten by quest review after each round.

  • Head: d79025d

  • Base: origin/main at 6a46972

  • Risk: medium, it adds to plans under quest/, which agents start without a person reading them

  • Classified: medium by default

  • Risk file: none

  • Reviewer: Codex, gpt-6.2-sol, high effort

  • Session: 01a21b17-230e-7253-a29f-08faf6ee0157, round 2

  • Score: 10/10, The only change since the last review updates the encrypted-room plan to point to `PreviewRoom` in `app/src/preview.tsx`, and the head is ready to land.

  • Rounds: 4; first round 1 (medium 1); findings 1 (medium 1): fixed 1, refuted 0, open 0

  • Findings: none

kixelated and others added 4 commits November 26, 2026 18:12
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title Deduplicate room and controls helpers refactor(room): deduplicate room and controls helpers Nov 27, 2026
… math

Reading the camera tile's level lit the mic button for memes and
notifications with the mic off, and left no meter without WebGL2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated marked this pull request as ready for review November 27, 2026 02:42
@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 32 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0f40c471-bf31-478a-bd2e-8ab83c1c8322
Commits

Reviewing files that changed from the base of the PR and between 6a46972 and d79025d.

Files selected for processing: 31

  • app/src/components/meme-selector.tsx
  • app/src/controls.tsx
  • app/src/preview.tsx
  • app/src/room/audio.ts
  • app/src/room/broadcast.ts
  • app/src/room/canvas.ts
  • app/src/room/chat.ts
  • app/src/room/cursor.ts
  • app/src/room/debug.ts
  • app/src/room/fake.ts
  • app/src/room/gl/audio.ts
  • app/src/room/gl/background.ts
  • app/src/room/gl/border.ts
  • app/src/room/gl/broadcast.ts
  • app/src/room/gl/shader.ts
  • app/src/room/index.ts
  • app/src/room/local.ts
  • app/src/room/locator.ts
  • app/src/room/name.ts
  • app/src/room/preview/index.ts
  • app/src/room/preview/member.ts
  • app/src/room/preview/room.ts
  • app/src/room/sound.ts
  • app/src/room/space.ts
  • app/src/room/video.ts
  • app/src/room/watch.ts
  • app/src/settings.tsx
  • app/src/speaker.ts
  • app/src/util/solid.ts
  • quest/m1/dedupe-room-helpers.md
  • quest/m2/e2ee-rooms.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

kixelated and others added 2 commits November 26, 2026 19:40
Keeps #69's OBS fallback name inside the shared overlay placement and
passes the broadcast path through the generic Space.add.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated
kixelated merged commit 21509af into main Nov 27, 2026
3 checks passed
@kixelated
kixelated deleted the quest/m1/dedupe-room-helpers branch November 27, 2026 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant