Draw the microphone level without re-rendering

- The level state carries a Behavior, so the state changes only when its kind
  does.
- The meter renders its bars once and an effect draws the level into them.
- The render-counting test now counts every commit, and asserts none while the
  level moves.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
fkwpandClaude Opus 5.5 committed 2026-09-24 11:00:53 +02:00
1 parent 02a49928b0
commit 2aa7ff6ccc
8 files changed
+101 -59

No files matched your search

+2 -1
View File
@@ -35,6 +35,7 @@ describe("useMicrophoneLevel", () => {
rerender({ id: "mic2" });
// No level carried over from the previous device.
expect(result.current).toEqual({ type: "level", level: 0 });
const state = result.current;
expect(state.type === "level" ? state.level.value : state.type).toBe(0);
});
});