layout and remote fix
🏗️ Build and Test JellyTau / Run Tests (push) Successful in 4m31s
Traceability Validation / Check Requirement Traces (push) Successful in 20s
Build & Release / Run Tests (push) Successful in 5m24s
🏗️ Build and Test JellyTau / Android Compile Check (push) Successful in 4m29s
Build & Release / Build Linux (push) Successful in 17m27s
Build & Release / Build Android (push) Successful in 22m14s
Build & Release / Create Release (push) Successful in 12s

This commit is contained in:
2026-07-16 22:53:03 +02:00
parent 532ffa661a
commit 1992a8187d
10 changed files with 272 additions and 192 deletions
+23 -2
View File
@@ -316,10 +316,31 @@ function createPlaybackModeStore() {
const mode = event.payload.mode as PlaybackMode;
const remoteSessionId =
mode === "remote" ? event.payload.session_id ?? null : null;
// Ignore no-op re-broadcasts. The backend re-emits on every set_mode, and
// local playback drives set_mode("local") from BOTH the frontend
// (handleStateChanged) and Rust, so the same mode arrives repeatedly. If
// we reconciled unconditionally we'd re-run selectSession(null) on each
// one, deselecting the remote session mid-cast and tripping the
// disconnect-to-idle watchdog (breaking the lockscreen card, remote
// volume, and — via the resulting mode flap — local audio).
if (
currentState.mode === mode &&
currentState.remoteSessionId === remoteSessionId
) {
return;
}
console.log("[PlaybackMode] Backend mode changed →", mode, remoteSessionId);
update((s) => ({ ...s, mode, remoteSessionId }));
// Keep the selected session in step so the merged UI stores follow.
sessions.selectSession(remoteSessionId);
// Keep the selected session in step so the merged UI stores follow, but
// only touch the selection when it actually differs — re-selecting the
// same id (or clearing on a non-remote emit that isn't a real change)
// would needlessly churn the session watchdog.
const selected = get(selectedSession);
if ((selected?.id ?? null) !== remoteSessionId) {
sessions.selectSession(remoteSessionId);
}
}
});