Skip to content

perf(desktop): lazy-mount sidebar session trees - #2021

Merged
jackwener merged 3 commits into
apache:mainfrom
likun666661:fix/sidebar-session-tree-lazy-mount
Aug 4, 2026
Merged

perf(desktop): lazy-mount sidebar session trees#2021
jackwener merged 3 commits into
apache:mainfrom
likun666661:fix/sidebar-session-tree-lazy-mount

Conversation

@likun666661

Copy link
Copy Markdown
Member

Summary

  • lazy-mount linked child-session trees instead of recursively mounting every Swarm descendant
  • keep only the active session ancestor chain expanded so externally selected child sessions remain visible
  • preserve Astryx disclosure chrome with a zero-layout sentinel while collapsed
  • add regression coverage for collapsed descendants, active-child expansion, and stale-session presentation

Why

The sidebar recursively rendered every linked child session even when its parent appeared collapsed. On a real workspace with 36 root sessions and 118 Swarm child sessions, the expanded rail kept roughly 10,000-12,000 DOM nodes and thousands of listeners alive. Any navigation or selection then paid React, style, and layout costs across that tree.

Local CDP evidence

Metric Before After
Rendered session rows 154 36
DOM elements about 10,000-12,000 3,884
Event listeners about 3,572-4,600 1,293
Renderer JS heap about 33 MB 18.8 MB
Navigation click input delay - about 0.3 ms

The 118 child rows are now absent from the DOM until their parent is expanded. Eighteen roots retain disclosure controls.

Validation

  • npm --workspace @maka/ui run typecheck
  • npm --workspace @maka/desktop run typecheck
  • npm --workspace @maka/desktop run build
  • targeted sidebar suites: 27 tests passed
  • rebuilt and installed the arm64 Desktop app; verified the real user workspace through CDP

@jackwener
jackwener merged commit 12f5423 into apache:main Aug 4, 2026
11 checks passed
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