Skip to content

perf(cmux-tui): avoid cloning projection specs per frame - #11487

Merged
lawrencecchen merged 2 commits into
mainfrom
fix/sidebar-empty-resource-wave201
Sep 1, 2026
Merged

lawrencecchen merged 2 commits into
mainfrom
fix/sidebar-empty-resource-wave201

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • extract the SidebarResourceKind leaf before mutable projection rendering
  • preserve empty-projection and missing-view behavior
  • add a behavior test for the configured leaf label

This replaces #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


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.

Written for commit 52eba4a. Summary will update on new commits.

Review in cubic

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.

@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@coderabbitai

coderabbitai Bot commented Sep 1, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: a1bb1e15-1e96-4a63-8d3b-7f2ae5447c94

📥 Commits

Reviewing files that changed from the base of the PR and between 2ead477 and b357092.

📒 Files selected for processing (2)
  • cmux-tui/crates/cmux-tui/src/app.rs
  • cmux-tui/crates/cmux-tui/src/ui/sidebar.rs

Included review availability: Your plan provides up to 10 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

Changes

Sidebar empty-state rendering

Layer / File(s) Summary
Resolve leaf resource labels and validate rendering
cmux-tui/crates/cmux-tui/src/ui/sidebar.rs, cmux-tui/crates/cmux-tui/src/app.rs
draw_projection uses the final configured resource kind for empty-state text without cloning the full view specification. The test verifies that a workspace-tabs projection renders "no tabs" and not "no workspaces".

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to b3570

The change removes per-frame projection-spec cloning while preserving sidebar labels and behavior; no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: avoiding per-frame cloning of projection specifications in cmux-tui.
Description check ✅ Passed The description clearly explains what changed, why it changed, behavior preservation, the added regression test, and verification performed. It is mostly complete, although it does not include the tem…
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (1 skipped: 1 …
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Cmux Swift Actor Isolation ✅ Passed PASS. The pull-request diff contains only two Rust files: cmux-tui/crates/cmux-tui/src/app.rs and cmux-tui/crates/cmux-tui/src/ui/sidebar.rs. It contains no Swift paths or Swift diff content. Ther…
Cmux Swift Blocking Runtime ✅ Passed PASS. The PR diff contains only cmux-tui/crates/cmux-tui/src/app.rs and cmux-tui/crates/cmux-tui/src/ui/sidebar.rs, both Rust files. It adds a Rust test and changes Rust rendering code. It introdu…
Cmux Browser Automation Off-Main ✅ Passed PASS: The PR diff contains only cmux-tui/crates/cmux-tui/src/app.rs and cmux-tui/crates/cmux-tui/src/ui/sidebar.rs. The changes add a Rust TUI test and change sidebar projection rendering. They do…
Cmux Expensive Synchronous Load ✅ Passed PASS: The complete pull-request diff from merge base 2ead47750 changes only cmux-tui Rust files (app.rs and ui/sidebar.rs). It adds a Rust test and changes sidebar projection rendering. No Swi…
Cmux Cache Substitution Correctness ✅ Passed PASS: The pull request changes only Rust files (cmux-tui/crates/cmux-tui/src/app.rs and cmux-tui/crates/cmux-tui/src/ui/sidebar.rs). The custom check applies only to production Swift, TypeScript, …
Cmux No Hacky Sleeps ✅ Passed PASS. The pull request changes only Rust files: cmux-tui/crates/cmux-tui/src/app.rs and cmux-tui/crates/cmux-tui/src/ui/sidebar.rs. The production change extracts a sidebar resource value and adds…
Cmux Algorithmic Complexity ✅ Passed PASS: The PR changes only Rust files (cmux-tui/.../app.rs and ui/sidebar.rs), so the stated Swift/TypeScript/JavaScript/shell scope does not identify a failure. The production change replaces a fu…
Cmux Swift Concurrency ✅ Passed PASS. The exact diff against origin/main changes only cmux-tui/crates/cmux-tui/src/app.rs and cmux-tui/crates/cmux-tui/src/ui/sidebar.rs, both Rust files. It adds a Rust test and changes Rust si…
Cmux Swift @Concurrent ✅ Passed PASS. The pull-request diff from origin/main changes only cmux-tui/crates/cmux-tui/src/app.rs and cmux-tui/crates/cmux-tui/src/ui/sidebar.rs. It contains no Swift files or Swift concurrency anno…
Cmux Swift Package Boundaries ✅ Passed PASS: The PR diff contains only two Rust files under cmux-tui (app.rs and ui/sidebar.rs). It introduces no production Swift changes and does not alter a SwiftPM package boundary. The Swift packa…
Full details: Description check

Explanation

The description clearly explains what changed, why it changed, behavior preservation, the added regression test, and verification performed. It is mostly complete, although it does not include the template's Demo Video, Review Trigger, or Checklist sections.

Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (1 skipped: 1 too large.)

Full details: Cmux Swift Actor Isolation

Explanation

PASS. The pull-request diff contains only two Rust files: cmux-tui/crates/cmux-tui/src/app.rs and cmux-tui/crates/cmux-tui/src/ui/sidebar.rs. It contains no Swift paths or Swift diff content. Therefore, it cannot introduce or worsen the specified Swift 6 actor-isolation issues.

Full details: Cmux Swift Blocking Runtime

Explanation

PASS. The PR diff contains only cmux-tui/crates/cmux-tui/src/app.rs and cmux-tui/crates/cmux-tui/src/ui/sidebar.rs, both Rust files. It adds a Rust test and changes Rust rendering code. It introduces no production Swift changes and no Swift blocking or timing primitive covered by the check.

Full details: Cmux Browser Automation Off-Main

Explanation

PASS: The PR diff contains only cmux-tui/crates/cmux-tui/src/app.rs and cmux-tui/crates/cmux-tui/src/ui/sidebar.rs. The changes add a Rust TUI test and change sidebar projection rendering. They do not modify browser socket commands, WebKit/AppKit routing, processV2Command, socketWorkerMethods, or policy tests. The browser automation check is therefore not applicable.

Full details: Cmux Expensive Synchronous Load

Explanation

PASS: The complete pull-request diff from merge base 2ead47750 changes only cmux-tui Rust files (app.rs and ui/sidebar.rs). It adds a Rust test and changes sidebar projection rendering. No Swift or Objective-C production files changed, and no prohibited agent-history load symbols or paths appear in the changed files. Therefore this Swift-specific synchronous-load check is not applicable.

Full details: Cmux Cache Substitution Correctness

Explanation

PASS: The pull request changes only Rust files (cmux-tui/crates/cmux-tui/src/app.rs and cmux-tui/crates/cmux-tui/src/ui/sidebar.rs). The custom check applies only to production Swift, TypeScript, and JavaScript changes. The diff does not replace an authoritative persistence, history, undo, or snapshot read in any covered language.

Full details: Cmux No Hacky Sleeps

Explanation

PASS. The pull request changes only Rust files: cmux-tui/crates/cmux-tui/src/app.rs and cmux-tui/crates/cmux-tui/src/ui/sidebar.rs. The production change extracts a sidebar resource value and adds no sleep, timer, polling, delay, or wall-clock wait. The added test uses deterministic rendering only. The rule applies to TypeScript, JavaScript, shell, and non-Swift build/runtime scripts, so it is not applicable here.

Full details: Cmux Algorithmic Complexity

Explanation

PASS: The PR changes only Rust files (cmux-tui/.../app.rs and ui/sidebar.rs), so the stated Swift/TypeScript/JavaScript/shell scope does not identify a failure. The production change replaces a full SidebarViewSpec clone with one .last() lookup before rendering. It adds no nested collection scan, repeated sorting/filtering, batch rescan, join, or slower algorithm. The added collection setup and assertions are test-only.

Full details: Cmux Swift Concurrency

Explanation

PASS. The exact diff against origin/main changes only cmux-tui/crates/cmux-tui/src/app.rs and cmux-tui/crates/cmux-tui/src/ui/sidebar.rs, both Rust files. It adds a Rust test and changes Rust sidebar rendering. No cmux-owned Swift code or listed Swift concurrency pattern changed.

Full details: Cmux Swift `@Concurrent`

Explanation

PASS. The pull-request diff from origin/main changes only cmux-tui/crates/cmux-tui/src/app.rs and cmux-tui/crates/cmux-tui/src/ui/sidebar.rs. It contains no Swift files or Swift concurrency annotations, so the @concurrent check is not applicable.

Full details: Cmux Swift Package Boundaries

Explanation

PASS: The PR diff contains only two Rust files under cmux-tui (app.rs and ui/sidebar.rs). It introduces no production Swift changes and does not alter a SwiftPM package boundary. The Swift package boundary check is therefore inapplicable.

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/sidebar-empty-resource-wave201

Warning

Some tools did not complete. Review the errors below.

🔧 ast-grep (0.45.2)
cmux-tui/crates/cmux-tui/src/app.rs

ast-grep timed out on this file


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@lawrencecchen
lawrencecchen force-pushed the fix/sidebar-empty-resource-wave201 branch from b357092 to 52eba4a Compare September 1, 2026 19:42
@cursor

cursor Bot commented Sep 1, 2026

Copy link
Copy Markdown

Bugbot is paused — on-demand spend limit reached

Bugbot uses usage-based billing for this team and has hit its on-demand spend limit.

A team admin can raise the spend limit in the Cursor dashboard, or wait for the next billing cycle to continue.

@vercel

vercel Bot commented Sep 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
cmux166 Ready Ready Preview Sep 2, 2026 3:10am UTC
cmux41 Ready Ready Preview Sep 2, 2026 3:10am UTC

@lawrencecchen
lawrencecchen merged commit 56457e4 into main Sep 1, 2026
38 of 40 checks passed
@lawrencecchen
lawrencecchen deleted the fix/sidebar-empty-resource-wave201 branch September 1, 2026 19:56
rustybret pushed a commit to rustybret/bmux that referenced this pull request Sep 1, 2026
6044a8b docs(tui): align frontend protocol references (manaflow-ai#10246)
56457e4 perf(cmux-tui): avoid cloning projection specs per frame (manaflow-ai#11487)
9503718 ci: guard focused filters that match only ignored tests

This branch was successfully deployed

2 active deployments
Preview – cmux166 — 52eba4ad Deployed Sep 2, 2026 by vercel[bot]
Preview – cmux41 — 52eba4ad Deployed Sep 2, 2026 by vercel[bot]
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.

1 participant