Repository navigation
Name the default fork destination in tab menus - #184
Conversation
|
Warning Review limit reached
Next review available in: 40 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThe fork conversation context-menu item now displays a localized title based on its default destination, with English and Japanese strings added. Tests now select the updated left-destination title. ChangesFork Conversation Titles
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
| case .forkConversationRight, | ||
| .forkConversation: | ||
| return localized( | ||
| "tabContext.forkConversation.default.right", | ||
| defaultValue: "Fork Conversation to the Right" | ||
| ) | ||
| default: | ||
| return localized( | ||
| "tabContext.forkConversation.default.right", | ||
| defaultValue: "Fork Conversation to the Right" | ||
| ) | ||
| } |
There was a problem hiding this comment.
Non-exhaustive switch bypasses compiler safety
The default branch makes the switch non-exhaustive. TabContextAction is a public CaseIterable enum, so adding a new fork-destination case in the future (e.g., .forkConversationCurrentPane) would silently fall through to "Fork Conversation to the Right" here without any compiler warning. The existing forkConversationSubmenuItem helper already guards against this pattern by using isForkConversationDestination — but forkConversationDefaultTitle has no equivalent guard. Since .forkConversation is explicitly listed alongside .forkConversationRight, the default arm only catches truly unrelated actions (like .move or .reload), which would never be valid default fork actions anyway. Removing default and making the switch exhaustive over all TabContextAction cases would let the compiler enforce completeness as the enum evolves.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
The primary tab context-menu action now names its configured destination, such as “Fork Conversation to the Right”. The existing destination submenu remains available.
Tests:
swift test --filter 'BonsplitTests.testTabContextMenuBuilderCreatesForkConversationSubmenu|BonsplitTests.testTabContextMenuBuilderKeepsForkConversationVisibleWhenOpenAvailabilityIsRefreshing'Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.Summary by cubic
Show the configured default fork destination in the tab context menu’s primary action (e.g., “Fork Conversation to the Right”). Replace the fork availability APIs with a hidden/refreshing/available state so the item can stay visible but disabled while loading; submenu unchanged and en/ja labels added.
Written for commit e099cf4. Summary will update on new commits.