perf(cmux-tui): avoid cloning projection specs per frame
Closed
LA
1mo ago+35+35+01234567890123456789-3-3-0123456789
Summary
- extract the
SidebarResourceKindleaf value before mutable projection rendering - preserve the empty projection label and missing-view return behavior
- add a render behavior test for the configured leaf label
SidebarViewSpec::clone copied the view id, levels, actions, and optional labels on every visible projection render. The scalar extraction removes those per-frame heap copies without changing row ordering, selection, hit targets, or labels. The behavior test guards the rendered semantics. Allocation behavior was reviewed statically because this change has no observable UI difference and local Rust/Cargo execution is prohibited by the worktree instructions.
Verification
rustfmt --edition 2024 --check cmux-tui/crates/cmux-tui/src/ui/sidebar.rs cmux-tui/crates/cmux-tui/src/app.rsgit diff --check- hosted focused test pending
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.
Summary by cubic
Draws the sidebar projection without cloning the whole view spec each frame, removing per-frame heap copies while keeping row ordering, selection, hit targets, and labels unchanged.
- Extracts only the leaf resource kind before mutable rendering.
- Adds a render test covering the empty projection's leaf label.
Summary by CodeRabbit
- Bug Fixes
- Corrected the empty sidebar state to display the appropriate “no tabs” label instead of “no workspaces.”
- Improved consistency when showing empty workspace and tab projections.