Skip to content

cmux-tui: TUI dead-band dimming for foreign-sized surfaces; move CmuxLite out of tree - #8305

Merged
lawrencecchen merged 21 commits into
mainfrom
feat-tui-foreign-dim
Jul 19, 2026
Merged

lawrencecchen merged 21 commits into
mainfrom
feat-tui-foreign-dim

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

Two pieces, one per commit:

  1. TUI foreign-viewport treatment (https://github.com/manaflow-ai/cmux/issues — user request from the cmux-lite arc: "for TUI mode as well we should draw visible area, or just grey out the non usable area"): when a surface's effective grid is smaller than the pane, the TUI clips content to the live area, dims the dead right/bottom bands (theme-aware + DIM), draws the boundary with │ ─ ┘, and puts the sized-by hint at the boundary corner. Hint copy is EN/JA locale-selected via the pairing overlay's mechanism, resolved once per process. Tests: foreign_viewport_dims_bands_draws_boundaries_and_places_hint_at_corner, foreign_viewport_dead_space_adapts_to_light_and_dark_chrome, matching_viewport_draws_no_dead_space_boundary_or_hint, plus locale-copy tests.

  2. CmuxLite removal: the Swift demo app moved to the private https://github.com/manaflow-ai/cmux-lite (122 files removed; history stays reachable here pre-move). Bilingual cmux-tui/frontends/README pointer added; dead swift-frontend lockfile exception removed from scripts/check-package-resolved-policy.py.

Also verified live (no change needed): render-mode clients that claim via resize-surface are attributed in list-clients (sizes=N:CxR); null for clients that never claim is intentional.

Note: local Rust 1.94 clippy flags a pre-existing collapsible_if at cmux-tui-core/src/mux.rs:638 on unchanged code; CI's toolchain is the gate.


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.


Summary by cubic

Adds TUI dead-band dimming with a clear live-area boundary and a localized, allocation-free size hint when a surface grid is smaller than its pane. Centralizes localization and moves the cmux-lite Swift demo to a separate repo; fixes a rendering artifact and hardens input handling for foreign-sized viewports.

  • New Features

    • Clip to the live area; dim dead right/bottom bands; draw a boundary; corner hint (EN/JA). Verified JA hint fits and asserts full-width glyph cells.
    • Theme-aware colors via new ChromeTheme fields: foreign_viewport_bg, foreign_viewport_boundary_fg, foreign_viewport_hint_fg.
    • draw_render_frame now takes chrome and a shared localization catalog; pane/sidebar callers updated.
  • Bug Fixes

    • Reset dead cells before restyling to prevent stale attributes.
    • Make the sizing hint neutral and allocation-free; tests lock copy via the injected catalog.
    • Track the rendered viewport and bound terminal input to it: reject mouse presses and clamp selection outside; fail closed without bounds; preserve pane actions in dimmed padding.

Written for commit a5ea9b1. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features
    • Improved terminal rendering when the available viewport is smaller than the displayed area, including clearer boundaries and localized sizing guidance.
    • Added theme controls for foreign viewport backgrounds, boundaries, and hints.
  • Documentation
    • Added an English and Japanese frontend overview.
  • Refactor
    • Removed the legacy Swift macOS frontend and its associated project, runtime, and test assets.
  • Chores
    • Tightened validation for expected package lockfile locations.

…sized surfaces

When a surface's effective grid is smaller than the pane, the TUI now
clips content to the live area, dims the unusable right/bottom bands
(theme-aware grey + DIM), draws the boundary with box-drawing glyphs
on the first dead column/row, and places the sized-by hint at the
boundary corner. Hint copy is locale-selected (EN/JA) via the same
env-based mechanism as the pairing overlay, resolved once. Matches the
cmux-lite client treatment.
…ux-lite)

The demo app now lives in the private manaflow-ai/cmux-lite repo (its
pre-move history stays reachable here). Adds a bilingual
frontends/README pointer and drops the now-dead swift-frontend
Xcode-lockfile exception from check-package-resolved-policy.py.
@coderabbitai

coderabbitai Bot commented Jul 17, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The change adds localized foreign-viewport rendering to cmux-tui, including theme colors, dead-area clearing, boundary hints, and tests. It also removes the in-tree Swift CmuxLite frontend, updates frontend documentation, and narrows accepted SwiftPM lockfile paths.

Changes

Foreign viewport rendering

Layer / File(s) Summary
Theme and rendering flow
cmux-tui/crates/cmux-tui/src/config.rs, cmux-tui/crates/cmux-tui/src/ui/terminal_grid.rs, cmux-tui/crates/cmux-tui/src/ui/pane.rs, cmux-tui/crates/cmux-tui/src/ui/sidebar.rs
ChromeTheme gains foreign-viewport colors. draw_render_frame renders snapped live dimensions, clears dead cells, filters cursor coordinates, and draws localized boundary and size hints.
Foreign viewport validation
cmux-tui/crates/cmux-tui/src/ui/terminal_grid.rs
Tests render frames through TestBackend and verify locale text, boundaries, theme colors, and exact-size behavior.

Swift frontend retirement and policy updates

Layer / File(s) Summary
Remove CmuxLite contracts and supporting references
cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteApp/CmuxWindowMutation.swift, cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/{CmuxProtocolClientFactory,CmuxResponseEnvelope}.swift, cmux-tui/frontends/README*
Swift frontend mutation, protocol factory, and response envelope definitions are removed. Frontend indexes document the web reference frontend and separately maintained native macOS frontend.
Restrict expected SwiftPM lockfiles
scripts/check-package-resolved-policy.py
Lockfile validation adds explicit Xcode and iOS paths and removes the broad Swift frontend path exemption.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Pane as draw_content
  participant Grid as draw_render_frame
  participant Theme as ChromeTheme
  participant Backend as TestBackend
  Pane->>Grid: pass render frame and ChromeTheme
  Grid->>Theme: read foreign viewport colors
  Grid->>Grid: draw live cells and clear dead regions
  Grid->>Backend: write boundary bands and localized hint
  Backend-->>Grid: expose rendered rows for assertions
Loading

Possibly related PRs


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (2 errors, 1 warning)

Check name Status Explanation Resolution
Cmux Algorithmic Complexity ❌ Error terminal_grid.rs:75-84 and 131-139 add repeated O(max_cols*max_rows) scans in the hot render path, with no bound/benchmark. Iterate the right/bottom dead bands directly in one pass, or add an explicit bound plus benchmark if the full-scan shape is intentional.
Cmux Full Internationalization ❌ Error terminal_grid.rs hardcodes EN/JA hint copy via env-based branching instead of a localized API, and no matching catalog entries were added. Move the hint copy into the localization system (or equivalent locale-specific source) and add translated entries for every supported locale; keep tests aligned to the catalog-backed locales.
Description check ⚠️ Warning The description covers the summary and testing, but it omits required template sections like Demo Video, Review Trigger, and the Checklist. Add the missing template sections: a demo video link, the review-trigger comment block, and the checklist items with completion status.
✅ Passed checks (22 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 No production Swift files were added or modified; the Swift changes are deletions/tests/docs, so no actor-isolation regression was introduced.
Cmux Swift Blocking Runtime ✅ Passed Swift diff contains 122 deletions and no added/modified Swift files or added lines, so no new blocking waits/sleeps/locks were introduced.
Cmux Browser Automation Off-Main ✅ Passed PR only changes TUI/docs/Swift-removal files; the rule-scope browser router files weren’t touched, so no off-main browser wait routing issue is introduced.
Cmux Expensive Synchronous Load ✅ Passed The diff only adds READMEs and updates a policy script; the Swift frontend tree is removed, so no new synchronous agent-history load was introduced.
Cmux Cache Substitution Correctness ✅ Passed Only cache use is OnceLock for locale hint text in draw_render_frame, a transient UI hint; no persistence/history/snapshot consumer or stale-cache trust path changed.
Cmux No Hacky Sleeps ✅ Passed No new fixed sleeps, timers, polling, or retries were added; the only runtime script change just removes a lockfile allowlist branch.
Cmux Swift Concurrency ✅ Passed Swift changes are deletion-only; no added Swift lines introduce DispatchQueue/Task/completion-handler/Combine patterns.
Cmux Swift @Concurrent ✅ Passed HEAD diff touches only two README files and a policy script; no Swift files changed, so the concurrent-annotation rule isn’t implicated.
Cmux Swift Package Boundaries ✅ Passed PASS: The only Swift changes are deletions of the CmuxLite app/package; no new reusable logic was added to an app target, and no Swift files remain in the diff.
Cmux Swiftpm Lockfiles ✅ Passed The PR deletes the Swift demo package; no cmux-owned .gitignore still ignores Package.resolved, no Package.swift pin change is present, and no cmux.xcodeproj package-reference change requires a roo...
Cmux Swift Logging ✅ Passed The PR removes the Swift frontend and adds only docs/policy; no production Swift logging statements are added or expanded.
Cmux User-Facing Error Privacy ✅ Passed The only new user-visible copy is generic locale text; docs/cleanup changes are exempt, and no leaked vendor, internal, secret, or raw upstream details appear.
Cmux Swiftui State Layout ✅ Passed PASS: the Swift diff only deletes CmuxLite sources/tests; no new @Observable/@Published/GeometryReader/list-row/store patterns or render-time state writes were introduced.
Cmux Architecture Rethink ✅ Passed PASS: No banned Swift architectural patterns were introduced; the PR mostly removes the Swift frontend, and the new TUI locale cache is a read-only helper, not split ownership.
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed No Swift NSWindow/NSPanel/NSWindowController/WindowGroup changes appear in the diff; only README and policy script files changed.
Cmux Source Artifacts ✅ Passed No changed path adds source artifacts; the PR only adds docs/policy cleanup and removes the moved Swift frontend plus its ignore exception, which the rule allows.
Cmux No Test Or Debug Seam In Production Source ✅ Passed Changed production files only add normal helpers/theme fields; the only test-guarded code is #[cfg(test)] modules, with no DEBUG guards or test-only accessors.
Cmux No Ambient Global State ✅ Passed No new production Swift ambient state was added; the Swift-side changes are deletions only. The new Rust OnceLock cache is private and not an exported singleton/API.
Title check ✅ Passed The title is clear and matches the two main changes: TUI foreign-viewport rendering and CmuxLite removal.
✨ 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-tui-foreign-dim

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@cmux-tui/crates/cmux-tui/src/ui/terminal_grid.rs`:
- Around line 75-84: Remove the dead-cell reset loops near the start of the
terminal-grid rendering flow, then update draw_foreign_viewport to iterate and
style only the right and bottom dead rectangles directly. Ensure live cells are
not rescanned for dead-region cleanup, preserving the existing rendering
behavior while avoiding repeated max_rows × max_cols traversal.
- Around line 28-53: Replace the hardcoded locale dispatch in
foreign_viewport_copy and foreign_viewport_copy_for_locale with the existing
localization API and catalog entries for every supported locale, preserving the
required ForeignViewportCopy fields and separator behavior. Update draw_grid and
related callers to use the localized copy without assuming English, and adjust
tests to inject explicit catalog locales and assert the corresponding
translations.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 76e15f70-cf6e-4b97-b962-f8911d7bd9f3

📥 Commits

Reviewing files that changed from the base of the PR and between 673ee6f and b59f892.

⛔ Files ignored due to path filters (1)
  • cmux-tui/frontends/swift/CmuxLite/CmuxLite.xcodeproj/project.xcworkspace/contents.xcworkspacedata is excluded by !**/*.xcworkspace/contents.xcworkspacedata
📒 Files selected for processing (128)
  • cmux-tui/crates/cmux-tui/src/config.rs
  • cmux-tui/crates/cmux-tui/src/ui/pane.rs
  • cmux-tui/crates/cmux-tui/src/ui/sidebar.rs
  • cmux-tui/crates/cmux-tui/src/ui/terminal_grid.rs
  • cmux-tui/frontends/README.ja.md
  • cmux-tui/frontends/README.md
  • cmux-tui/frontends/swift/CmuxLite/.gitignore
  • cmux-tui/frontends/swift/CmuxLite/CmuxLite.xcodeproj/project.pbxproj
  • cmux-tui/frontends/swift/CmuxLite/CmuxLite.xcodeproj/xcshareddata/xcschemes/CmuxLite.xcscheme
  • cmux-tui/frontends/swift/CmuxLite/Package.swift
  • cmux-tui/frontends/swift/CmuxLite/README.ja.md
  • cmux-tui/frontends/swift/CmuxLite/README.md
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteApp/CmuxGhosttyConfigurationResolver.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteApp/CmuxHoverButton.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteApp/CmuxLiteApp.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteApp/CmuxLiteWindowController.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteApp/CmuxPalette.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteApp/CmuxPaneViewController.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteApp/CmuxPendingRatio.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteApp/CmuxRenderColor.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteApp/CmuxRenderFontMetrics.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteApp/CmuxRenderView.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteApp/CmuxSplitDividerView.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteApp/CmuxSplitView.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteApp/CmuxStateDump.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteApp/CmuxTabButton.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteApp/CmuxTerminalGridContainerView.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteApp/CmuxTerminalHostViewController.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteApp/CmuxWindowMutation.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteApp/CmuxWorkspaceRowView.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteApp/NSEvent+CmuxShortcutInput.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteApp/NSEvent+CmuxTerminalKeyEvent.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteApp/Resources/Localizable.xcstrings
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxAttachEvent.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxCommandRequest.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxConnectionConfiguration.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxConnectionEndpoint.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxEmptyResponse.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxFrontendEvent.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxFrontendSession.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxFrontendStartup.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxGhosttyViewConfiguration.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxGhosttyViewConfigurationParser.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxIdentifyResponse.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxInboundHeader.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxLayout.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxLayoutRect.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxLocalSelection.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxPane.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxPaneAttachment.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxPaneDirection.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxPaneGeometry.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxPaneLayoutView+Actions.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxPaneLayoutView.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxPaneSnapshot.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxProtocolClient.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxProtocolClientFactory.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxProtocolError.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxRatioNudge.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxReadScrollbackResponse.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxRenderAttributes.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxRenderCursor.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxRenderCursorStyle.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxRenderDeltaEvent.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxRenderModel.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxRenderRow.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxRenderRun.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxRenderStateEvent.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxRenderStyle.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxRenderUnderline.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxResizeAction.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxResizePolicy.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxResponseEnvelope.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxScreen.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxScreenSnapshot.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxScrollbackDirection.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxScrollbackReconciliation.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxScrollbackRequest.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxScrollbackWindow.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxShortcutAction.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxShortcutInput.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxShortcutKey.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxShortcutModifiers.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxShortcutTable.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxSplitDirection.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxSplitRatio.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxSplitTarget.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxSurface.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxSurfaceResponse.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxSurfaceSize.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxTabSnapshot.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxTerminalGridGeometry.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxTerminalKeyAction.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxTerminalKeyEvent.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxTerminalMeasurement.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxTransport.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxWorkspace.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxWorkspaceSnapshot.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxWorkspaceTree.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/ConfiguredCmuxProtocolClientFactory.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/FallbackCmuxProtocolClientFactory.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/FallbackWebSocketTransport.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/NetworkCmuxProtocolClientFactory.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/NetworkWebSocketTransport.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/Resources/Localizable.xcstrings
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/URLSessionCmuxProtocolClientFactory.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/URLSessionWebSocketTransport.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/UnixSocketTransport.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteSmoke/CmuxLiteSmoke.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteSmoke/Resources/Localizable.xcstrings
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteSmoke/SmokeRunner.swift
  • cmux-tui/frontends/swift/CmuxLite/Tests/CmuxLiteCoreTests/CmuxAttachEventTests.swift
  • cmux-tui/frontends/swift/CmuxLite/Tests/CmuxLiteCoreTests/CmuxConnectionConfigurationTests.swift
  • cmux-tui/frontends/swift/CmuxLite/Tests/CmuxLiteCoreTests/CmuxFrontendSessionTests.swift
  • cmux-tui/frontends/swift/CmuxLite/Tests/CmuxLiteCoreTests/CmuxGhosttyViewConfigurationTests.swift
  • cmux-tui/frontends/swift/CmuxLite/Tests/CmuxLiteCoreTests/CmuxPaneLayoutLogicTests.swift
  • cmux-tui/frontends/swift/CmuxLite/Tests/CmuxLiteCoreTests/CmuxRenderModelTests.swift
  • cmux-tui/frontends/swift/CmuxLite/Tests/CmuxLiteCoreTests/CmuxRenderStyleTests.swift
  • cmux-tui/frontends/swift/CmuxLite/Tests/CmuxLiteCoreTests/CmuxResizePolicyTests.swift
  • cmux-tui/frontends/swift/CmuxLite/Tests/CmuxLiteCoreTests/CmuxScrollbackWindowTests.swift
  • cmux-tui/frontends/swift/CmuxLite/Tests/CmuxLiteCoreTests/CmuxShortcutTableTests.swift
  • cmux-tui/frontends/swift/CmuxLite/Tests/CmuxLiteCoreTests/CmuxTerminalGridGeometryTests.swift
  • cmux-tui/frontends/swift/CmuxLite/Tests/CmuxLiteCoreTests/CmuxTerminalKeyEventTests.swift
  • cmux-tui/frontends/swift/CmuxLite/Tests/CmuxLiteCoreTests/CmuxWorkspaceTreeTests.swift
  • cmux-tui/frontends/swift/CmuxLite/Tests/CmuxLiteCoreTests/ScriptedClientFactory.swift
  • cmux-tui/frontends/swift/CmuxLite/Tests/CmuxLiteCoreTests/ScriptedTransport.swift
  • cmux-tui/frontends/swift/CmuxLite/project.yml
  • scripts/check-package-resolved-policy.py
💤 Files with no reviewable changes (122)
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteApp/Resources/Localizable.xcstrings
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxEmptyResponse.swift
  • cmux-tui/frontends/swift/CmuxLite/Tests/CmuxLiteCoreTests/CmuxShortcutTableTests.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteSmoke/Resources/Localizable.xcstrings
  • cmux-tui/frontends/swift/CmuxLite/Package.swift
  • cmux-tui/frontends/swift/CmuxLite/Tests/CmuxLiteCoreTests/CmuxResizePolicyTests.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxShortcutModifiers.swift
  • cmux-tui/frontends/swift/CmuxLite/project.yml
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxSplitDirection.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/URLSessionCmuxProtocolClientFactory.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/FallbackCmuxProtocolClientFactory.swift
  • cmux-tui/frontends/swift/CmuxLite/Tests/CmuxLiteCoreTests/CmuxTerminalGridGeometryTests.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxPaneAttachment.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxScrollbackRequest.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxShortcutInput.swift
  • cmux-tui/frontends/swift/CmuxLite/README.ja.md
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/ConfiguredCmuxProtocolClientFactory.swift
  • cmux-tui/frontends/swift/CmuxLite/Tests/CmuxLiteCoreTests/CmuxAttachEventTests.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxFrontendStartup.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/Resources/Localizable.xcstrings
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxWorkspaceSnapshot.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/NetworkCmuxProtocolClientFactory.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxShortcutAction.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteApp/CmuxPalette.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxRenderRow.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxTabSnapshot.swift
  • cmux-tui/frontends/swift/CmuxLite/CmuxLite.xcodeproj/xcshareddata/xcschemes/CmuxLite.xcscheme
  • cmux-tui/frontends/swift/CmuxLite/README.md
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxResizePolicy.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxRenderAttributes.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteApp/CmuxRenderFontMetrics.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxRenderStyle.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxWorkspace.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxScreen.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxShortcutKey.swift
  • cmux-tui/frontends/swift/CmuxLite/.gitignore
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxRenderModel.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxScrollbackReconciliation.swift
  • cmux-tui/frontends/swift/CmuxLite/Tests/CmuxLiteCoreTests/CmuxRenderModelTests.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteApp/NSEvent+CmuxTerminalKeyEvent.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/UnixSocketTransport.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxSplitTarget.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxTerminalKeyAction.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxPaneLayoutView.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxTransport.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxAttachEvent.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxRenderDeltaEvent.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxGhosttyViewConfiguration.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxGhosttyViewConfigurationParser.swift
  • cmux-tui/frontends/swift/CmuxLite/Tests/CmuxLiteCoreTests/CmuxRenderStyleTests.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxRenderStateEvent.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxScreenSnapshot.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteApp/CmuxPendingRatio.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxSurfaceSize.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteApp/CmuxSplitDividerView.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxRenderCursorStyle.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxRenderUnderline.swift
  • cmux-tui/frontends/swift/CmuxLite/Tests/CmuxLiteCoreTests/ScriptedClientFactory.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxLayoutRect.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxPaneDirection.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxProtocolClientFactory.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteApp/CmuxTabButton.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxTerminalMeasurement.swift
  • cmux-tui/frontends/swift/CmuxLite/Tests/CmuxLiteCoreTests/CmuxPaneLayoutLogicTests.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxConnectionEndpoint.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/URLSessionWebSocketTransport.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxScrollbackWindow.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxResizeAction.swift
  • cmux-tui/frontends/swift/CmuxLite/CmuxLite.xcodeproj/project.pbxproj
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxCommandRequest.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxSurface.swift
  • cmux-tui/frontends/swift/CmuxLite/Tests/CmuxLiteCoreTests/CmuxFrontendSessionTests.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteApp/CmuxHoverButton.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteApp/CmuxRenderView.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxRenderCursor.swift
  • cmux-tui/frontends/swift/CmuxLite/Tests/CmuxLiteCoreTests/CmuxWorkspaceTreeTests.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteSmoke/CmuxLiteSmoke.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteApp/CmuxWindowMutation.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxLayout.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/NetworkWebSocketTransport.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxLocalSelection.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxProtocolClient.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteSmoke/SmokeRunner.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxSurfaceResponse.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxScrollbackDirection.swift
  • cmux-tui/frontends/swift/CmuxLite/Tests/CmuxLiteCoreTests/CmuxGhosttyViewConfigurationTests.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteApp/CmuxPaneViewController.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxTerminalGridGeometry.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxReadScrollbackResponse.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxInboundHeader.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteApp/CmuxTerminalHostViewController.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxSplitRatio.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxIdentifyResponse.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxRatioNudge.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteApp/CmuxTerminalGridContainerView.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/FallbackWebSocketTransport.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteApp/CmuxSplitView.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxTerminalKeyEvent.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxProtocolError.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxPaneSnapshot.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxPane.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxShortcutTable.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxWorkspaceTree.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteApp/NSEvent+CmuxShortcutInput.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteApp/CmuxRenderColor.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxResponseEnvelope.swift
  • cmux-tui/frontends/swift/CmuxLite/Tests/CmuxLiteCoreTests/CmuxTerminalKeyEventTests.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxPaneGeometry.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteApp/CmuxStateDump.swift
  • cmux-tui/frontends/swift/CmuxLite/Tests/CmuxLiteCoreTests/CmuxScrollbackWindowTests.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxRenderRun.swift
  • cmux-tui/frontends/swift/CmuxLite/Tests/CmuxLiteCoreTests/ScriptedTransport.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteApp/CmuxWorkspaceRowView.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxConnectionConfiguration.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteApp/CmuxLiteApp.swift
  • cmux-tui/frontends/swift/CmuxLite/Tests/CmuxLiteCoreTests/CmuxConnectionConfigurationTests.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxFrontendEvent.swift
  • scripts/check-package-resolved-policy.py
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxFrontendSession.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteApp/CmuxLiteWindowController.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteCore/CmuxPaneLayoutView+Actions.swift
  • cmux-tui/frontends/swift/CmuxLite/Sources/CmuxLiteApp/CmuxGhosttyConfigurationResolver.swift

Comment thread cmux-tui/crates/cmux-tui/src/ui/terminal_grid.rs Outdated
Comment thread cmux-tui/crates/cmux-tui/src/ui/terminal_grid.rs Outdated
@cursor

cursor Bot commented Jul 18, 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

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d95ac484fa

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread cmux-tui/crates/cmux-tui/src/localization.rs Outdated
@lawrencecchen

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: f290fe514b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@lawrencecchen

Copy link
Copy Markdown
Contributor Author

@codex review

@lawrencecchen

Copy link
Copy Markdown
Contributor Author

@greptile-apps review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: a5ea9b190b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@greptile-apps

greptile-apps Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR delivers two independent changes: TUI dead-band dimming for foreign-sized surfaces (when a PTY's effective grid is smaller than its pane, the dead right/bottom area is now dimmed with theme-aware colors, a │ ─ ┘ boundary, and an allocation-free EN/JA size hint), and the removal of the Swift CmuxLite demo from the tree (122 files, replaced by bilingual pointer READMEs).

  • Foreign-viewport treatment — rendered_terminal_bounds tracks the live area per surface; all PTY mouse paths (press, motion, scroll, selection) are bounded to it and fail closed when the map has no entry (e.g. before first render or after a render error). The rendering side (draw_foreign_viewport, draw_foreign_size_hint) is well-tested with four dedicated unit tests covering dark/light themes, locale injection, boundary placement, and stale-cell reset. apply_cell now calls target.reset() before styling, fixing a pre-existing stale-attribute artifact.
  • Localization refactor — the existing per-call locale/env-var read in the pairing overlay is unified into a new localization module with a process-global OnceLock<&'static Catalog>; a draw_render_frame_with_catalog seam keeps the catalog injectable in tests without touching the process global.
  • CmuxLite removal + policy cleanup — the Swift frontend Xcode lockfile exception in check-package-resolved-policy.py is correctly removed alongside the deleted tree.

Confidence Score: 5/5

The change is safe to merge. The dead-band rendering path is additive and degrades gracefully; the fail-closed mouse-input guard protects PTY surfaces without breaking non-PTY or matching-viewport surfaces.

Both the rendering and the input-bounding paths are thoroughly tested. The rendered_terminal_bounds map is kept consistent (retain on every draw pass, remove-then-reinsert per surface, absent when render fails). The localization refactor is a straightforward consolidation with no behavioral change for users. No correctness-critical logic relies on heuristics or unreliable fallbacks.

No files require special attention. The most complex logic (draw_foreign_size_hint hint-placement arithmetic) is covered by the foreign_viewport_dims_bands_draws_boundaries_and_places_hint_at_corner test.

Important Files Changed

Filename Overview
cmux-tui/crates/cmux-tui/src/ui/terminal_grid.rs Core change: adds dead-band dimming for foreign-sized surfaces with boundary characters and a locale-aware size hint; correctly clears stale cell attributes via target.reset() in apply_cell; catalog-injection seam keeps tests isolated from the process-global OnceLock.
cmux-tui/crates/cmux-tui/src/app.rs Adds rendered_terminal_bounds: HashMap<SurfaceId, Rect> and gates all PTY mouse paths (press, motion, scroll, selection start) through terminal_input_rect, which fails closed when bounds are absent; existing tests updated and a dedicated foreign-viewport mouse test added.
cmux-tui/crates/cmux-tui/src/localization.rs New module centralizing EN/JA locale catalogs (pairing + foreign-viewport strings); catalog() uses OnceLock for a one-time init per process; ForeignViewportHint is allocation-free (stack-backed 64-byte array); hint_width uses UnicodeWidthStr so wide-char Japanese strings are measured in display cells correctly.
cmux-tui/crates/cmux-tui/src/ui/pane.rs Retains only bounds for surfaces still in pane_areas, removes then re-inserts bounds around each draw_content call, correctly threads chrome and the catalog into draw_render_frame; if render fails, bounds remain absent (fail-closed).
cmux-tui/crates/cmux-tui/src/ui/overlay.rs Removes the local PairingCopy struct and per-call env-var read in favour of the shared catalog() singleton; test updated to use catalog_for_locale; no behavioural change for users.
cmux-tui/crates/cmux-tui/src/config.rs Adds three ChromeTheme fields (foreign_viewport_bg, foreign_viewport_boundary_fg, foreign_viewport_hint_fg) with sensible dark/light defaults; no behavioural change to existing theme consumers.
scripts/check-package-resolved-policy.py Removes the now-obsolete SWIFT_FRONTEND_XCODE_LOCKFILE_PREFIX exception that allowed Swift-frontend Xcode lockfiles; correct cleanup given the CmuxLite tree removal.
cmux-tui/frontends/README.md New bilingual pointer page replacing the removed Swift tree; links correctly to the private cmux-lite repo.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
    participant UI as draw_all (pane.rs)
    participant TG as terminal_grid.rs
    participant App as App.rendered_terminal_bounds
    participant Input as handle_mouse (app.rs)

    UI->>App: retain(surfaces still in pane_areas)
    UI->>TG: draw_render_frame(rect, render, chrome, catalog)
    TG->>TG: rendered_viewport_rect → live Rect
    TG->>App: insert(surface_id, live)
    Note over TG: draw live cells, then draw_foreign_viewport<br/>(dead bands + boundary + hint)

    Input->>App: "terminal_input_rect(area) → Option<Rect>"
    alt bounds present
        App-->>Input: Some(live)
        Input->>Input: reject if (x,y) outside live
        Input->>Input: forward PTY mouse at live-relative coords
    else bounds absent (fail closed)
        App-->>Input: None
        Input-->>Input: NotOwned / Draw / None
    end
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
    participant UI as draw_all (pane.rs)
    participant TG as terminal_grid.rs
    participant App as App.rendered_terminal_bounds
    participant Input as handle_mouse (app.rs)

    UI->>App: retain(surfaces still in pane_areas)
    UI->>TG: draw_render_frame(rect, render, chrome, catalog)
    TG->>TG: rendered_viewport_rect → live Rect
    TG->>App: insert(surface_id, live)
    Note over TG: draw live cells, then draw_foreign_viewport<br/>(dead bands + boundary + hint)

    Input->>App: "terminal_input_rect(area) → Option<Rect>"
    alt bounds present
        App-->>Input: Some(live)
        Input->>Input: reject if (x,y) outside live
        Input->>Input: forward PTY mouse at live-relative coords
    else bounds absent (fail closed)
        App-->>Input: None
        Input-->>Input: NotOwned / Draw / None
    end
Loading

Reviews (1): Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." | Re-trigger Greptile

@lawrencecchen
lawrencecchen merged commit ecebdbb into main Jul 19, 2026
24 of 25 checks passed
@lawrencecchen
lawrencecchen deleted the feat-tui-foreign-dim branch July 19, 2026 06:29
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