feat(webcam): app-default gate slice — per-scene offer, Add places default directly, identity survives removal

Chat's camera no longer greys Web Cam in Live (per-scene max, not app-wide);
TASK 26 superseded by creator directive (app-level resource model). Add Webcam
now places the existing app default without the picker; the picker runs only
for the initial selection. Removing the last placement keeps the identity
(_webcam never nulled) so Add stays offered. Startup pass adopts a solo camera
as the app default, so a clean layout offers the layer in Live/Chat at once.
Dynamic WebcamAddToolTip names the why (incl. the 'graduated to OBS' line).

Good Dog: WebcamMenuGateTests rewritten (real app + temp DB + camera seams) —
identity in Chat does not gray Live; Add in Live places same wc-1 no picker;
scene-with-placement stays gray; identity survives both removals (DB row 1).
WebcamStartupResourceTests single-lock fact asserts CanAddWebcam after adoption.
Docs same commit (ai.md supersession, TASKS.md, HANDOFF.md). 304/304, 0 warnings.
This commit is contained in:
2026-09-17 08:56:04 -07:00
parent 1e4017df03
commit 9d00955004
9 changed files with 210 additions and 114 deletions
@@ -52,6 +52,7 @@ public sealed class WebcamStartupResourceTests
Assert.Single(harness.Started);
Assert.Equal("dev1", harness.Started[0]);
Assert.NotNull(vm.StagedScene);
Assert.True(vm.CanAddWebcam, "the single camera becomes the app default — the Web Cam layer is offered");
});
private void RunZero() => RunWith(sceneBoilerplate: true, cameraCount: 0, failOnStart: false,
@@ -149,7 +150,9 @@ public sealed class WebcamStartupResourceTests
public string DeviceId { get; }
private readonly Harness _harness;
public event Action<VideoFrame>? FrameAvailable;
#pragma warning disable CS0067
public event Action<string>? SourceFailed;
#pragma warning restore CS0067
public FakeWebcamSource(string deviceId, Harness harness)
{