openclaw/ui
Peter Steinberger 6ac5e0f205
perf(ui): pause session run rings outside the sidebar viewport (#162905)
* perf(ui): pause session run rings outside the sidebar viewport

Problem: Running sessions kept 11 ring elements in per-frame restyles,
including rows outside the sidebar viewport.

Fix: Use one sidebar-owned IntersectionObserver to toggle a paused class
on ring and paired-avatar trace indicators. Preserve queued and
reduced-motion behavior, and release observations on row removal or
sidebar disconnection.

Proof:
- Native browser regression: 1 passed, 0 failed; 4.05s wall with
  --maxWorkers=1. Covers scrolling, zero-ratio edge contact, queued state,
  indicator replacement, run completion, and reconnection.
- Full ui/src/components and ui/src/pages/chat/components suites under
  ui/vitest.config.ts: 449 files, 7276 passed, 0 failed; 53.20s wall.
- chat-composer and chat-composer-microphone suites: 35 passed, 0 failed;
  11.06s wall with --maxWorkers=1.
- UI E2E: mobile-chat-session-menu, chat-flow.streaming,
  sidebar-interactions, chat-composer-focus, sidebar-session-stability,
  sidebar-cached-list-stability, and sidebar-restart-recovery:
  7 files, 38 passed, 0 failed; 77.68s wall.
- pnpm tsgo:ui passed in 10.80s; node scripts/check-changed.mjs passed
  in 427.82s; git diff --check passed.
- Coordinator Codex autoreview of the uncommitted tree: scoped-clean at P2.

* fix(ui): register session run rings for visibility from the row render

Problem: The sidebar host scanned before its roster child committed new
rows. The real-roster regression rendered 11 running rows, but the
host-level registration observed only 1, leaving offscreen rings active.

Fix: Register actual ring and trace elements through a Lit directive
supplied by the native and catalog row renderers. Share one lazy
IntersectionObserver per scroll root through a WeakMap, unobserve on
directive disconnection, and disconnect empty groups. Only observer
callbacks toggle the paused class. Remove the host scanner and retain
the existing CSS, queued state, and reduced-motion behavior.

Proof:
- Real-roster regression fails on b0c90ed56391 with 1 of 11 rows observed;
  the correction observes all 11, pauses ten offscreen indicators, and
  resumes them after scrolling into view.
- Updated browser file: 2 passed, 0 failed; 4.19s wall with --maxWorkers=1.
  Retains edge-contact, indicator replacement, completion, and
  reconnection coverage.
- Owner suites: 126 passed across 4 files; 42.66s wall.
- Full ui/src/components and ui/src/pages/chat/components suites under
  ui/vitest.config.ts: 449 files, 7277 passed; 45.28s wall.
- chat-composer and chat-composer-microphone suites: 35 passed;
  11.56s wall with --maxWorkers=1.
- UI E2E: mobile-chat-session-menu, chat-flow.streaming,
  sidebar-interactions, chat-composer-focus, sidebar-session-stability,
  sidebar-cached-list-stability, and sidebar-restart-recovery:
  7 files, 38 passed; 54.47s wall.
- pnpm tsgo:ui passed in 9.90s; node scripts/check-changed.mjs passed
  in 717.19s; git diff --check passed in 0.13s. The initial changed-check
  source scanner exited with SIGILL before selecting checks; the
  unchanged replay passed without a tooling or gate change.
- Coordinator Codex autoreview at P2 confirms the working-tree correction
  resolves the INDEX-only host-registration finding, with no further
  P0-P2 findings.
2026-10-01 18:25:16 +00:00
..
config improve(ui): chat opens faster on slow links by dropping empty boot requests (#161648) 2026-09-30 23:24:16 -07:00
docs/design-system refactor: delete unreferenced production code (#159847) 2026-09-29 21:47:06 -07:00
public
scripts perf(ui): record only route-reachable modules in the boot manifest (#162382) 2026-09-30 22:00:49 -07:00
src perf(ui): pause session run rings outside the sidebar viewport (#162905) 2026-10-01 18:25:16 +00:00
test
.gitignore
AGENTS.md perf(ui): record only route-reachable modules in the boot manifest (#162382) 2026-09-30 22:00:49 -07:00
index.html
package.json chore(deps): refresh UI rendering dependencies (#162575) 2026-10-01 18:14:28 +07:00
tsconfig.json
vite.config.ts chore(ui): update Mermaid to 12.0.0 (#162618) 2026-10-01 19:22:10 +07:00
vitest.config.ts chore(ui): update Mermaid to 12.0.0 (#162618) 2026-10-01 19:22:10 +07:00
vitest.node.config.ts