Skip to content

cmux-tui: centralize frontend focus target mapping - #11861

Merged
lawrencecchen merged 1 commit into
mainfrom
feat-journal-focus-target
Sep 3, 2026
Merged

lawrencecchen merged 1 commit into
mainfrom
feat-journal-focus-target

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Centralize the exhaustive FocusTarget to FrontendJournalTarget mapping.
  • Reuse the pure mapping in both presentation snapshot paths.

Verification

  • Existing presentation behavior test preserved.
  • Rustfmt and diff checks pass.
  • Blacksmith and hosted checks are pending.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Summary by cubic

Centralizes the FocusTarget to FrontendFocusTarget mapping in cmux-tui so both presentation snapshot paths use the same conversion. Replaces the duplicated match statements with a single frontend_journal_target method on FocusTarget; no behavior change.

Written for commit 7efccef. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Refactor
    • Consolidated focus-target mapping logic to improve internal consistency without changing user-visible behavior.

@vercel

vercel Bot commented Sep 3, 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 3, 2026 11:35pm UTC
cmux41 Ready Ready Preview Sep 3, 2026 11:35pm UTC

@coderabbitai

coderabbitai Bot commented Sep 3, 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: 57f4a7f4-46c9-4321-9dbc-311c582b6538

📥 Commits

Reviewing files that changed from the base of the PR and between aaa600a and 7efccef.

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

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


📝 Walkthrough

Walkthrough

The change adds a private FocusTarget mapping method and replaces two duplicate inline mappings with calls to that method. Behavior remains unchanged.

Changes

Focus target mapping

Layer / File(s) Summary
Mapping and journal call sites
cmux-tui/crates/cmux-tui/src/app.rs
frontend_journal_target maps each FocusTarget variant to the corresponding FrontendFocusTarget variant. Two journal-related call sites use the shared method.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Merge Risk: ⚪ Minimal · up to 7efcc

This refactor centralizes existing focus-target journal mapping without changing presentation behavior. The current change is ready to merge.

Suggested reviewers: lawrence703

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: centralizing the frontend focus-target mapping.
Description check ✅ Passed The description explains what changed, why it changed, and how it was verified. It omits the template checklist and explicit review-trigger section, but the core information is complete and the refact…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
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 changes only cmux-tui/crates/cmux-tui/src/app.rs, a Rust file. The diff adds a Rust FocusTarget mapping method and replaces two equivalent Rust match expressions. No Swift p…
Cmux Swift Blocking Runtime ✅ Passed PASS: The pull request changes only cmux-tui/crates/cmux-tui/src/app.rs, a Rust file. The exact diff adds a pure FocusTarget::frontend_journal_target match and replaces two equivalent Rust match e…
Cmux Browser Automation Off-Main ✅ Passed PASS. The pull request changes only cmux-tui/crates/cmux-tui/src/app.rs. It adds a pure FocusTarget::frontend_journal_target mapping and replaces two identical Rust match expressions with calls …
Cmux Expensive Synchronous Load ✅ Passed The custom check applies only to production Swift changes that add or move expensive synchronous agent-history loads. The pull request changes only cmux-tui/crates/cmux-tui/src/app.rs, a Rust file. …
Cmux Cache Substitution Correctness ✅ Passed PASS. The pull request changes only cmux-tui/crates/cmux-tui/src/app.rs, which is Rust, while this check applies only to production Swift, TypeScript, and JavaScript changes. The diff only centraliz…
Cmux No Hacky Sleeps ✅ Passed PASS: The pull request changes only cmux-tui/crates/cmux-tui/src/app.rs, which is Rust and outside this check's TypeScript, JavaScript, shell, and build/runtime-script scope. The diff only extracts …
Cmux Algorithmic Complexity ✅ Passed PASS: The pull-request commit changes only cmux-tui/crates/cmux-tui/src/app.rs, which is Rust. The added method is a direct match over five fixed FocusTarget variants and introduces no collection …
Cmux Swift Concurrency ✅ Passed PASS: The pull request changes only cmux-tui/crates/cmux-tui/src/app.rs, a Rust file. The diff adds a pure FocusTarget mapping method and updates two Rust call sites. It changes no Swift files and…
Cmux Swift @Concurrent ✅ Passed PASS: The pull-request commit changes only cmux-tui/crates/cmux-tui/src/app.rs. The commit diff contains no Swift paths, so the Swift @concurrent check is not applicable. The Rust refactor cannot …
Cmux Swift Package Boundaries ✅ Passed PASS: The pull request changes only cmux-tui/crates/cmux-tui/src/app.rs, a Rust source file. The diff adds a private Rust mapping method and replaces two equivalent Rust match expressions. It contai…
Full details: Description check

Explanation

The description explains what changed, why it changed, and how it was verified. It omits the template checklist and explicit review-trigger section, but the core information is complete and the refactor does not require a demo video.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 too large.)

Full details: Cmux Swift Actor Isolation

Explanation

PASS: The pull request changes only cmux-tui/crates/cmux-tui/src/app.rs, a Rust file. The diff adds a Rust FocusTarget mapping method and replaces two equivalent Rust match expressions. No Swift production code changes are present, so this check is not applicable.

Full details: Cmux Swift Blocking Runtime

Explanation

PASS: The pull request changes only cmux-tui/crates/cmux-tui/src/app.rs, a Rust file. The exact diff adds a pure FocusTarget::frontend_journal_target match and replaces two equivalent Rust match expressions. No .swift files or listed Swift blocking/timing primitives are introduced.

Full details: Cmux Browser Automation Off-Main

Explanation

PASS. The pull request changes only cmux-tui/crates/cmux-tui/src/app.rs. It adds a pure FocusTarget::frontend_journal_target mapping and replaces two identical Rust match expressions with calls to that method. It does not change Sources/TerminalController.swift, ControlCommandExecutionPolicy.swift, socket-worker routing, WebKit waits, or browser command policy tests. The custom check is therefore not triggered.

Full details: Cmux Expensive Synchronous Load

Explanation

The custom check applies only to production Swift changes that add or move expensive synchronous agent-history loads. The pull request changes only cmux-tui/crates/cmux-tui/src/app.rs, a Rust file. The diff only extracts an existing FocusTarget match into frontend_journal_target() and replaces two identical call-site matches. It adds no Swift code, agent-history load, or interactive-path loading behavior.

Full details: Cmux Cache Substitution Correctness

Explanation

PASS. The pull request changes only cmux-tui/crates/cmux-tui/src/app.rs, which is Rust, while this check applies only to production Swift, TypeScript, and JavaScript changes. The diff only centralizes an existing FocusTarget match into a pure method and does not substitute a cache for an authoritative read.

Full details: Cmux No Hacky Sleeps

Explanation

PASS: The pull request changes only cmux-tui/crates/cmux-tui/src/app.rs, which is Rust and outside this check's TypeScript, JavaScript, shell, and build/runtime-script scope. The diff only extracts an existing FocusTarget match into frontend_journal_target; it introduces no sleep, timer, delay, polling, or wall-clock wait.

Full details: Cmux Algorithmic Complexity

Explanation

PASS: The pull-request commit changes only cmux-tui/crates/cmux-tui/src/app.rs, which is Rust. The added method is a direct match over five fixed FocusTarget variants and introduces no collection scan, sorting, filtering, join, or slower scalable algorithm. The custom check applies to production Swift, TypeScript, JavaScript, shell, and runtime code, so it is not triggered.

Full details: Cmux Swift Concurrency

Explanation

PASS: The pull request changes only cmux-tui/crates/cmux-tui/src/app.rs, a Rust file. The diff adds a pure FocusTarget mapping method and updates two Rust call sites. It changes no Swift files and adds no listed Swift concurrency patterns.

Full details: Cmux Swift `@Concurrent`

Explanation

PASS: The pull-request commit changes only cmux-tui/crates/cmux-tui/src/app.rs. The commit diff contains no Swift paths, so the Swift @concurrent check is not applicable. The Rust refactor cannot introduce any listed Swift isolation or actor-hop failure.

Full details: Cmux Swift Package Boundaries

Explanation

PASS: The pull request changes only cmux-tui/crates/cmux-tui/src/app.rs, a Rust source file. The diff adds a private Rust mapping method and replaces two equivalent Rust match expressions. It contains no production Swift changes, so the Swift package-boundary rule does not apply.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat-journal-focus-target

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.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

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

@lawrencecchen
lawrencecchen force-pushed the feat-journal-focus-target branch from 4305137 to 1d4ffdb Compare September 3, 2026 14:29
@cursor

cursor Bot commented Sep 3, 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.

@lawrencecchen
lawrencecchen force-pushed the feat-journal-focus-target branch from 1d4ffdb to 7efccef Compare September 3, 2026 23:32
@lawrencecchen
lawrencecchen merged commit ed5e826 into main Sep 3, 2026
53 checks passed
rustybret pushed a commit to rustybret/bmux that referenced this pull request Sep 4, 2026
3812562 refactor(tui): centralize terminal input classification (manaflow-ai#11855)
7d0385f Axiom: failure rate and latency per third-party endpoint (Freestyle, Stack Auth, Stripe, ...) (manaflow-ai#11779)
ed5e826 refactor(tui): share frontend focus target mapping (manaflow-ai#11861)
7fa300e Revert "Fix terminal text bleed during live window resize (manaflow-ai#11530)" (manaflow-ai#11887)
bace77c perf(cmux-tui): avoid front-shifting layout nodes (manaflow-ai#11860)
9f8a74f cmux-tui: simplify PTY error mapping (manaflow-ai#11864)
2748329 refactor(cmux-tui): share stack row allocation (manaflow-ai#11867)
e7223a5 coderouter: PostHog traces + exceptions keyed by the cmux user, request ids, health endpoint, Slack alerts, upstream header timeout (manaflow-ai#11798)
aerickson pushed a commit to aerickson/cmux that referenced this pull request Sep 13, 2026

This branch was successfully deployed

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