Skip to content

emrg: GUI disconnected event per-sid isolation — P3 finalize (GUI multi-session rant P3) - #636

Merged
argszero merged 1 commit into
masterfrom
feature/gui-p3-finalize-disconnect
Aug 10, 2026
Merged

emrg: GUI disconnected event per-sid isolation — P3 finalize (GUI multi-session rant P3)#636
argszero merged 1 commit into
masterfrom
feature/gui-p3-finalize-disconnect

Conversation

@argszero

Copy link
Copy Markdown
Owner

Summary

P3 finalize of the GUI multi-session rant (2026-08-10T15:07:19): make the disconnected event fully per-sid — a background session's connection drop must not disturb the global UI (no banner/red dot), while the active session's disconnect keeps the global banner. Completes the P3 event-routing spec after slices 0-2 (#630 chat isolation, #632 sessionsBySid, #634 per-session containers).

Changes

renderer/js/app.js

  • sidState entries gain disconnected: false (per-sid disconnect flag, cleared on reconnect).
  • disconnected handler: marks the event-sid entry disconnected; global banner + red dot only when the disconnected session is the active one (or sid-less single-session transition — legacy behavior preserved, G89 input restore kept); adds .disconnected to the session's registered container only (guarded by Chat.hasContainer so the fallback chain can't mislabel the active container).
  • status connected: clears all disconnected flags and removes .disconnected classes from containers.
  • switchSession: switching into a disconnected session shows an i18n notice ("connection lost — reconnecting automatically") while keeping input usable (G89).

renderer/js/chat.js — new hasContainer(sid) API (registered-container check distinct from chatContainer's fallback chain).

renderer/js/i18n.jsapp.sessionDisconnected zh/en.

renderer/css/layout.css.session-view.disconnected visual (dimmed + hatch overlay).

test/renderer.smoke.test.js — +3 tests (bg disconnect no global banner + container marked; reconnect clears flags/classes; unregistered-sid disconnect doesn't mislabel + switch-to-disconnected notice). GUI 153→156 (renderer smoke 43→46); README/README.cn/Agent.md counts synced; 680 pytest green; node --check clean.

Verification

  • GUI: 156 tests pass (43+17+22+46+15+7+3+3)
  • Python: 680 pytest pass; doc-count guard passes
  • node --check clean on touched JS

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle 20260810-173604 (author). P3 finalize: disconnected per-sid isolation; 156 GUI + 680 pytest green.

@pm25coder

Copy link
Copy Markdown
Contributor

Tested this PR end-to-end on Windows — P3 finalize (disconnected event per-sid isolation) verified.

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle 20260810-174555

Verified on head b006aed: GUI suite 156/156 (renderer smoke 46 — bg session disconnect no global banner/red dot + container .disconnected marker via hasContainer guard; reconnect clears all disconnected flags + container classes; unregistered-sid disconnect doesn't mislabel active container; switch-to-disconnected shows i18n notice while input stays usable G89), 680 pytest green, CLI OK, node --check clean. Doc-count guard synced (156 = 43+17+22+46+15+7+3+3).

@argszero argszero left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle 20260810-174109

Verified locally on the PR head: GUI suite 156/156 (46 renderer smoke — bg session disconnect no global banner/red dot + container .disconnected marker via hasContainer guard; reconnect clears all disconnected flags + container classes; unregistered-sid disconnect doesn't mislabel the active container (fallback chain guard); switch-to-disconnected shows the i18n notice while keeping input usable), 680 pytest green, doc-count guard passes (156 = 43 dc + 17 cm + 46 renderer smoke + 22 + 15 + 7 + 3 + 3 synced in Agent.md/README/README.cn), node --check clean.

Code review: sidState entries gain disconnected flag (cleared on status connected); global banner + red dot only for active (or sid-less legacy) session; container marked only when Chat.hasContainer(sid) — correctly guards against the chatContainer fallback chain mislabeling; switchSession shows app.sessionDisconnected zh/en notice with G89 input restore; CSS .session-view.disconnected dimmed + hatch overlay. Completes the P3 event-routing spec cleanly on top of #630/#632/#634.

@argszero
argszero merged commit 26964b9 into master Aug 10, 2026
1 check passed
argszero added a commit that referenced this pull request Aug 10, 2026
argszero added a commit that referenced this pull request Aug 10, 2026
…ce 1 entries (#638)

Co-authored-by: EMRG Evolution <emrg@argszero.dev>
@argszero
argszero deleted the feature/gui-p3-finalize-disconnect branch August 10, 2026 12:38
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.

2 participants