Skip to content

Show repository in diff viewer titles - #13587

Merged
teamleaderleo merged 3 commits into
mainfrom
fix/13361-diff-viewer-repo-title
Sep 22, 2026
Merged

teamleaderleo merged 3 commits into
mainfrom
fix/13361-diff-viewer-repo-title

Conversation

@teamleaderleo

@teamleaderleo teamleaderleo commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

Multiple diff viewer windows can show the same generic title even when they belong to different repositories. Git-backed viewers now include the active repository identity in the document title and keep it current when the typed viewer switches repositories.

  • Format git viewer titles as <diff title> — <repo>, using the existing repo context.
  • Update the title when repository selection changes inside the same typed viewer.
  • Show the selected repository's full path in the repo selector tooltip.
  • Preserve patch-file titles, including patch inputs whose labels happen to look git-like.
  • Regenerate the checked-in diff viewer bundle.

Validation

  • Regression commit fcdebac: tests only.
  • Fix commit ea8a878: implementation plus generated bundle.
  • Focused coverage checks initial repo titles, repo switching, full-path tooltips, and patch-file title preservation.
  • Final CI is running on the rebased head.

Fixes #13361

Summary by CodeRabbit

  • Improvements
    • Browser tab titles now reflect the configured page title and, when applicable, the selected repository.
    • Patch-file views retain their configured title without adding repository information.
    • Repository changes automatically update the browser tab title.
    • Repository selection tooltips now show the selected repository’s descriptive label or path, improving clarity when choosing between repositories.

@coderabbitai

coderabbitai Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

💤 Files selected but had no reviewable changes (1)
  • Resources/markdown-viewer/webviews-app/chunks/diffSurface.mjs
⚙️ Run configuration

Configuration used: Repository: manaflow-ai/cmux/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 57a299d3-eb3c-4262-a9c8-c78f5dd67c67

📥 Commits

Reviewing files that changed from the base of the PR and between 60a0f79 and 5386e96.

📒 Files selected for processing (1)
  • Resources/markdown-viewer/webviews-app/chunks/diffSurface.mjs

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: manaflow-ai/cmux/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 2eb27f92-a143-496c-af05-c640c059697d

📥 Commits

Reviewing files that changed from the base of the PR and between 38ced03 and 60a0f79.

📒 Files selected for processing (2)
  • webviews/src/App.tsx
  • webviews/test/app.test.tsx

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


📝 Walkthrough

Walkthrough

The diff viewer now derives its document title from the configured title, source type, and repository. The repository selector can show the selected repository path in its native tooltip. Tests cover patch mode, repository-specific titles, and repository switching.

Changes

Diff viewer context

Layer / File(s) Summary
Document title resolution
webviews/src/App.tsx, webviews/test/app.test.tsx
App preserves the configured title for patch sources and appends the matching repository label for other sources. Tests verify both behaviors and updates after repository changes.
Repository selector title
webviews/src/App.tsx, webviews/test/app.test.tsx
NavigationSelect can use the selected option's message, value, or fallback label as its title. The repository selector enables this behavior, and tests verify the repository path tooltip.

Priority: ➖ Normal

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

Change: Feature · Severity of issue fixed: Medium

Sequence Diagram(s)

sequenceDiagram
  participant Payload
  participant App
  participant NavigationSelect
  participant Document
  Payload->>App: provide title and repository context
  App->>Document: set patch or repository-qualified title
  App->>NavigationSelect: pass selectedOptionTitle
  NavigationSelect->>NavigationSelect: display selected repository path
Loading

Merge Risk: ⚪ Minimal · up to 60a0f

Diff viewers now show repository context while patch titles remain unchanged; the covered behavior presents no actionable merge-blocking risk.

🚥 Pre-merge checks | ✅ 24 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (24 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: adding repository context to diff viewer titles.
Description check ✅ Passed The description explains the problem, behavior changes, patch-title preservation, generated bundle update, testing focus, and linked issue. It does not include the template's Demo Video, Review Trigge…
Linked Issues check ✅ Passed [#13361] requires repository context in Git-backed diff titles, updates after repository changes, a full-path repository selector tooltip, and unchanged patch titles. App updates document.title wi…
Out of Scope Changes check ✅ Passed The changes stay within [#13361]. The title effect, repository selector tooltip support, regenerated viewer bundle, and related tests directly implement or validate the requested diff-viewer repositor…
Cmux Cloud Persistent Session And Early Input ✅ Passed PASS. The pull request changes only webviews/src/App.tsx and its tests. The changed code updates document.title and the repository selector tooltip. It does not add or modify Cloud terminal creati…
Cmux Swift Actor Isolation ✅ Passed PASS — The pull request changes only webviews/src/App.tsx and webviews/test/app.test.tsx. The authoritative diff contains no Swift files, so it introduces no Swift actor-isolation issue.
Cmux Swift Blocking Runtime ✅ Passed The pull request changes only webviews/src/App.tsx and webviews/test/app.test.tsx. It introduces no production Swift changes and no Swift blocking or timing synchronization. The check is not appli…
Cmux Browser Automation Off-Main ✅ Passed PASS. The pull request changes only webviews/src/App.tsx and webviews/test/app.test.tsx. The diff adds document-title and repository-selector UI behavior and related tests. It does not change `Sou…
Cmux Expensive Synchronous Load ✅ Passed PASS. The authoritative pull-request diff changes only webviews/src/App.tsx and webviews/test/app.test.tsx. It contains no Swift changes and no expensive agent-history load, workspace scan, transc…
Cmux Cache Substitution Correctness ✅ Passed The PR adds transient document.title and repository-select tooltip behavior in webviews/src/App.tsx. The changed code does not replace a fresh authoritative read in a persistence, history, undo, o…
Cmux No Hacky Sleeps ✅ Passed PASS. The production change adds a React useEffect that updates document.title from source and repository state. It introduces no sleep, timer, polling loop, delayed dispatch, or wall-clock wait. …
Cmux Algorithmic Complexity ✅ Passed The production diff adds one linear repoOptions.find(...) in the title effect and adds no nested scan, per-target rescan, sorting, filtering, join, or unbounded event-path rebuild. `NavigationSelect…
Cmux Swift Concurrency ✅ Passed The authoritative PR diff changes only webviews/src/App.tsx and webviews/test/app.test.tsx. It contains no changed cmux-owned Swift code, so it cannot introduce or materially expand the specified …
Cmux Swift @Concurrent ✅ Passed The pull request changes only webviews/src/App.tsx and webviews/test/app.test.tsx. It introduces no Swift changes, Swift async functions, or Swift call-site changes covered by the @concurrent ru…
Cmux Swift Package Boundaries ✅ Passed The pull request changes only webviews/src/App.tsx and webviews/test/app.test.tsx. The authoritative diff contains zero .swift files and zero SwiftPM manifest changes. Therefore, it introduces n…
Cmux Swiftpm Lockfiles ✅ Passed The pull request changes only webviews/src/App.tsx and webviews/test/app.test.tsx. It does not change a SwiftPM package, Xcode project, .gitignore, workflow, or dependency file, so the SwiftPM l…
Cmux Swift Logging ✅ Passed PASS — The PR changes only webviews/src/App.tsx and webviews/test/app.test.tsx. It adds no Swift files or Swift logging statements, so the Swift logging failure conditions do not apply.
Cmux User-Facing Error Privacy ✅ Passed PASS: The production changes update the diff viewer document title and repository selector tooltip. These are normal UI metadata, not user-facing errors, alerts, command output, API error bodies, or r…
Cmux Full Internationalization ✅ Passed PASS. The production diff adds no new translatable English copy. It composes the existing configured title with dynamic repository identity and uses repository paths for the tooltip. Standard diff tit…
Cmux Swiftui State Layout ✅ Passed The pull request changes only webviews/src/App.tsx and webviews/test/app.test.tsx. The authoritative diff contains no Swift files or SwiftUI state/layout changes, so the SwiftUI state-layout failu…
Cmux Architecture Rethink ✅ Passed PASS: The authoritative PR diff changes only webviews/src/App.tsx and webviews/test/app.test.tsx. It contains no Swift, Objective-C, SwiftUI, or AppKit changes. Therefore the Swift architecture ru…
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed PASS: The pull request changes only webviews/src/App.tsx and webviews/test/app.test.tsx. It contains no Swift changes, so it does not add or materially change a Swift auxiliary window.
Cmux Source Artifacts ✅ Passed The pull request changes only webviews/src/App.tsx and webviews/test/app.test.tsx. Both paths are existing, intentional source and test files. The diff adds application logic and regression covera…
Cmux No Test Or Debug Seam In Production Source ✅ Passed The pull-request range changes only webviews/src/App.tsx and webviews/test/app.test.tsx. It changes no Swift files under a production Sources/ path, so this check is not applicable.
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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

Copy link
Copy Markdown
Contributor

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

@cursor

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

@teamleaderleo
teamleaderleo force-pushed the fix/13361-diff-viewer-repo-title branch from 08b83dd to 72e2246 Compare September 22, 2026 04:22
@teamleaderleo
teamleaderleo enabled auto-merge (squash) September 22, 2026 04:24
@cursor

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

@teamleaderleo
teamleaderleo force-pushed the fix/13361-diff-viewer-repo-title branch from 5789d9f to ea8a878 Compare September 22, 2026 04:28
@cursor

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

@teamleaderleo
teamleaderleo force-pushed the fix/13361-diff-viewer-repo-title branch from 6797f7f to e0b9579 Compare September 22, 2026 04:32
@cursor

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

@teamleaderleo
teamleaderleo force-pushed the fix/13361-diff-viewer-repo-title branch from e0b9579 to c054820 Compare September 22, 2026 04:33
@blacksmith-sh

This comment has been minimized.

@teamleaderleo
teamleaderleo force-pushed the fix/13361-diff-viewer-repo-title branch from 64d2d51 to 35772c2 Compare September 22, 2026 09:45
@teamleaderleo
teamleaderleo merged commit 63e2f29 into main Sep 22, 2026
55 checks passed
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.

Diff viewer: surface which repo a diff belongs to (window title / file header)

1 participant