feat(v0.4): multi-device discovery + share link (frontend)

- tabs.ts: on open, syncLiveSessions() fetches /live-sessions and adds a tab for
  each host session not already open → any device sees & mirrors everything
  running on the host. Empty storage + no live sessions → one fresh tab.
  activeSessionId() + openSession(id) helpers.
- share.ts: 🔗 toolbar button → QR + <origin>/?join=<id> for the active session.
- main.ts: ?join=<id> on load opens/focuses that shared session, then strips the
  param. Mount share button (toolbar: 🔍 ⚙ ▦ 🕘🔗 📱).
- style.css: #sharemodal reuses the QR card/backdrop.

Verified in-browser: fresh device auto-discovered the host session and replayed
its scrollback; two concurrent clients (browser + ws) both received live output
(clientCount=2); share modal shows the join URL/QR.
This commit is contained in:
Yaojia Wang
2026-06-19 10:30:40 +02:00
parent 0718b92267
commit 24b3cbd507
4 changed files with 153 additions and 4 deletions

View File

@@ -368,8 +368,9 @@ body {
background: var(--accent-soft);
}
/* QR modal */
#qrmodal {
/* QR + share modals */
#qrmodal,
#sharemodal {
position: fixed;
inset: 0;
z-index: 1200;