Theme scrollbars + global broadcast toggle

Two small QoL additions:

- styles.css: WebKit pseudo-element styling for .xterm-viewport
  scrollbars (8px wide, dark thumb #2a2a2a on transparent track,
  hover lighten). Matches the rest of the dark theme so the right
  edge of each terminal stops looking like default OS chrome.

- tree.ts: setAllBroadcast(root, on) helper that flips every leaf's
  broadcast flag to the given value, preserving object identity
  where nothing changed.

- App.tsx: titlebar 📡 button showing global broadcast state
  ("all off" / "all on" / "N/M"). Click toggles every pane between
  all-broadcasting and all-off. Orange when any panes are
  broadcasting; darker orange when partial.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
megaproxy 2026-05-22 18:18:56 +01:00
parent 774b8633dc
commit 369ec8e2fd
4 changed files with 86 additions and 0 deletions

View file

@ -198,6 +198,19 @@ export function toggleBroadcast(root: TreeNode, leafId: NodeId): TreeNode {
});
}
/** Force every leaf's broadcast flag to `on`. Returns the same root reference
* when nothing actually changed, so callers can skip a state update if so. */
export function setAllBroadcast(root: TreeNode, on: boolean): TreeNode {
if (root.kind === "leaf") {
if (!!root.broadcast === on) return root;
return { ...root, broadcast: on };
}
const a = setAllBroadcast(root.a, on);
const b = setAllBroadcast(root.b, on);
if (a === root.a && b === root.b) return root;
return { ...root, a, b };
}
export function serialize(root: TreeNode): string {
return JSON.stringify(root);
}