Skip to content

Make fork destination titles exhaustive - #185

Merged
lawrencecchen merged 1 commit into
mainfrom
fix-fork-default-title-exhaustive
Jul 15, 2026
Merged

lawrencecchen merged 1 commit into
mainfrom
fix-fork-default-title-exhaustive

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Jul 15, 2026 •

Copy link
Copy Markdown

Follow-up to #184.

Lists every non-fork action explicitly so new TabContextAction cases cannot silently inherit the right-side fork label.

Validation: swift test (197 tests passed).


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


Summary by cubic

Enumerates all non-fork TabContextAction cases when choosing fork destination titles so they no longer inherit the default "Fork Conversation to the Right" label. Adds an assertion to catch misuse, preventing future actions from silently getting the fork label.

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

Review in cubic

@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@lawrencecchen, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 26 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e914a688-cab9-47c1-b53a-ece4527b8745

📥 Commits

Reviewing files that changed from the base of the PR and between bf9728c and f538d8a.

📒 Files selected for processing (1)
  • Sources/Bonsplit/Internal/Views/TabItemView.swift
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-fork-default-title-exhaustive

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.

@greptile-apps

greptile-apps Bot commented Jul 15, 2026

Copy link
Copy Markdown

Greptile Summary

This PR replaces the default: catch-all in forkConversationDefaultTitle(for:) with an exhaustive list of all 21 non-fork TabContextAction cases, adding an assertionFailure when any of them is passed incorrectly. The change forces the Swift compiler to flag unhandled cases if new actions are added to the enum in future.

  • All 21 non-fork cases (rename through disconnectRemote) are now explicitly listed, and all 7 fork-destination cases continue to return their correct localized titles — the switch covers all 28 enum members with no fallthrough.
  • Non-fork paths hit assertionFailure in debug builds and gracefully fall back to the "right" label in release builds, matching the existing behavior while surfacing programming errors during development.

Confidence Score: 5/5

Safe to merge — the switch is fully exhaustive and the change introduces no new runtime paths in production.

The replacement is a mechanical, compiler-verified improvement: every one of the 28 TabContextAction cases is now explicitly handled, the assertionFailure fires only in debug builds, and the release fallback is identical to the old default: return. No logic is altered; the change only tightens future-proofing.

No files require special attention.

Important Files Changed

Filename Overview
Sources/Bonsplit/Internal/Views/TabItemView.swift Replaced default: with exhaustive non-fork case list in forkConversationDefaultTitle; adds assertionFailure guard and falls back to the right label in release builds. Switch now covers all 28 TabContextAction members.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["forkConversationDefaultTitle(for: action)"] --> B{action}
    B -->|forkConversationLeft| C["'Fork Conversation to the Left'"]
    B -->|forkConversationTop| D["'Fork Conversation to the Top'"]
    B -->|forkConversationBottom| E["'Fork Conversation to the Bottom'"]
    B -->|forkConversationNewTab| F["'Fork Conversation to New Tab'"]
    B -->|forkConversationNewWorkspace| G["'Fork Conversation to New Workspace'"]
    B -->|"forkConversationRight / forkConversation"| H["'Fork Conversation to the Right'"]
    B -->|"rename, clearName, closeToLeft, closeToRight, …disconnectRemote (21 non-fork cases)"| I["assertionFailure (debug only)"]
    I --> J["'Fork Conversation to the Right' (release fallback)"]
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"}}}%%
flowchart TD
    A["forkConversationDefaultTitle(for: action)"] --> B{action}
    B -->|forkConversationLeft| C["'Fork Conversation to the Left'"]
    B -->|forkConversationTop| D["'Fork Conversation to the Top'"]
    B -->|forkConversationBottom| E["'Fork Conversation to the Bottom'"]
    B -->|forkConversationNewTab| F["'Fork Conversation to New Tab'"]
    B -->|forkConversationNewWorkspace| G["'Fork Conversation to New Workspace'"]
    B -->|"forkConversationRight / forkConversation"| H["'Fork Conversation to the Right'"]
    B -->|"rename, clearName, closeToLeft, closeToRight, …disconnectRemote (21 non-fork cases)"| I["assertionFailure (debug only)"]
    I --> J["'Fork Conversation to the Right' (release fallback)"]
Loading

Reviews (1): Last reviewed commit: "Make fork destination titles exhaustive" | Re-trigger Greptile

@lawrencecchen
lawrencecchen merged commit 50a03f9 into main Jul 15, 2026
6 checks passed
@lawrencecchen
lawrencecchen deleted the fix-fork-default-title-exhaustive branch July 15, 2026 10:18
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