perf(cmux-tui): avoid cloning projection specs per frame
Merged
LA
1mo ago+35+35+01234567890123456789-3-3-0123456789
Summary
- extract the
SidebarResourceKindleaf before mutable projection rendering - preserve empty-projection and missing-view behavior
- add a behavior test for the configured leaf label
This replaces https://github.com/manaflow-ai/cmux/pull/11485 under the matching opener and commit-author identity. The source head is unchanged. The scalar extraction removes per-frame SidebarViewSpec heap copies without changing row order, selection, hit targets, or labels.
Verification
rustfmt --edition 2024 --checkgit diff --check- exact hosted Linux, macOS, MSRV, and aarch64 proof: https://github.com/manaflow-ai/cmux/actions/runs/33546180678
- exact stable Codex 0.151,
gpt-5.6-sol, high review: clean, correctness 0.98
Summary by cubic
Avoids cloning the projection spec on every frame, cutting per-frame heap allocations in the sidebar without changing row order, selection, hit targets, or labels.
- Derives the empty-projection resource label from a borrowed view spec instead of a cloned one.
- Adds a regression test that ensures an empty projection uses its configured leaf resource label.
Summary by CodeRabbit
-
Bug Fixes
- Empty sidebar views now display the correct message for the configured resource, such as “no tabs,” instead of incorrectly referring to workspaces.
-
Tests
- Added coverage to verify empty-state messaging when a sidebar view is configured with multiple levels.