[issues/549] Harmonize status bar and toast message prefixes#578
Conversation
## Summary Centralizes all status bar message prefixing in `VscodeAdapter` so every status bar message consistently carries `RangeLink: ` or `✓ RangeLink: ` without requiring each template or call site to bake in the prefix. Toast messages (info/warning/error) no longer carry `RangeLink: ` since VS Code already shows a Source attribution for those. ## Changes - Added `setSuccessfulStatusBarMessage(message, timeout)` to `VscodeAdapter` — prepends `✓ RangeLink: `, delegates to a shared private method with `setStatusBarMessage` which prepends `RangeLink: ` - Stripped all `RangeLink: `, `✓ `, and `✓ RangeLink ` prefixes from status bar templates in `messages.en.ts` — templates now carry only message payload - Removed `RangeLink: ` prefix from all toast message templates — VS Code's toast popup already shows the extension source - Switched 11 success-path call sites from `setStatusBarMessage` to `setSuccessfulStatusBarMessage` (bind/unbind/jump/copy/bookmark) - Updated all unit test and integration test assertions for the new prefix behavior - Documentation: CHANGELOG not needed (internal prefix harmonization); README not needed ## Test Plan - [ ] All 1894 unit tests pass - [ ] All integration tests pass (automated + assisted) ## Related - Closes #549
|
The PR introduces changes to the command palette visibility of the 'Unbind' command and modifies status bar messages and toast notifications, which require additional test cases. Suggested test cases:
Generated by QA Gap Check (GPT-4o-mini via GitHub Models) |
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
WalkthroughThis PR refactors status bar and toast message formatting across the RangeLink extension to achieve consistent prefixing and eliminate duplication. The core adapter now automatically prefixes status-bar messages with ChangesStatus Bar and Toast Message Harmonization
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 3
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/rangelink-vscode-extension/src/__integration-tests__/suite/bindToDestination.test.ts (1)
342-348:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winFix assertion error message to match checked string.
The code checks for
Already bound to ${name}(line 343), which correctly expects no "RangeLink: " prefix for toast messages. However, the error message on line 347 still references"RangeLink: Already bound to <AI assistant>"which contradicts the actual check.📝 Proposed fix for error message
assert.ok( alreadyBoundLogged, - `Expected "RangeLink: Already bound to <AI assistant>" info toast for one of: ${AI_ASSISTANT_DISPLAY_NAMES.join(', ')}`, + `Expected "Already bound to <AI assistant>" info toast for one of: ${AI_ASSISTANT_DISPLAY_NAMES.join(', ')}`, );🤖 Prompt for 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. In `@packages/rangelink-vscode-extension/src/__integration-tests__/suite/bindToDestination.test.ts` around lines 342 - 348, The assertion message is inconsistent with the checked string; update the assert.ok failure text so it references the exact substring being searched for ("Already bound to <AI assistant>") instead of including the "RangeLink: " prefix. Locate the assertion using symbols alreadyBoundLogged, AI_ASSISTANT_DISPLAY_NAMES and lines, and change the error message to something like: Expected "Already bound to <AI assistant>" info toast for one of: ... so it matches the contains check for `Already bound to ${name}`.
🤖 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
`@packages/rangelink-vscode-extension/src/__tests__/helpers/createMockTerminalPasteDestination.ts`:
- Line 36: Update the JSDoc for the mock in createMockTerminalPasteDestination
so its documented default success message matches the mock return value; change
the comment that references the old "✓ ..." text to instead document
getJumpSuccessMessage as returning 'Focused Terminal: "bash"' (refer to the
getJumpSuccessMessage jest.fn() mock) so tests/readers see the correct expected
message.
In
`@packages/rangelink-vscode-extension/src/__tests__/ide/vscode/VscodeAdapter.test.ts`:
- Around line 113-116: Update the QA YAML expected_result entries to match the
new message-prefix rules: for any toast/warning/error expected_result remove the
leading "RangeLink: " prefix so messages start without that text (e.g., change
"RangeLink: Cannot find file: ..." to "Cannot find file: ..."), and for
status-bar success expected_result strings ensure they use "✓ RangeLink: …" with
a colon after "RangeLink" (e.g., change "✓ RangeLink bound to Claude Code" to "✓
RangeLink: bound to Claude Code"); after making these edits in
packages/rangelink-vscode-extension/qa/qa-test-cases-v1.1.0.yaml, run
./scripts/validate-qa-coverage.sh to verify all expected_result entries align
(this relates to tests referencing mockVSCode.window.setStatusBarMessage and any
toast assertions).
In `@packages/rangelink-vscode-extension/src/commands/AddBookmarkCommand.ts`:
- Around line 143-145: Update the QA toast assertions that still include the
"RangeLink: " source prefix by removing that prefix from the four failing
assertions: change "RangeLink: Bound editor is open in multiple tab groups..."
to "Bound editor is open in multiple tab groups...", change "RangeLink: Cannot
find file: Untitled-99" to "Cannot find file: Untitled-99", change "RangeLink:
Navigated to file.ts @ 3" to "Navigated to file.ts @ 3", and change "RangeLink:
Cannot find file: nonexistent-file.ts" to "Cannot find file:
nonexistent-file.ts" in the QA test YAML so the toast message expectations no
longer include the "RangeLink: " attribution.
---
Outside diff comments:
In
`@packages/rangelink-vscode-extension/src/__integration-tests__/suite/bindToDestination.test.ts`:
- Around line 342-348: The assertion message is inconsistent with the checked
string; update the assert.ok failure text so it references the exact substring
being searched for ("Already bound to <AI assistant>") instead of including the
"RangeLink: " prefix. Locate the assertion using symbols alreadyBoundLogged,
AI_ASSISTANT_DISPLAY_NAMES and lines, and change the error message to something
like: Expected "Already bound to <AI assistant>" info toast for one of: ... so
it matches the contains check for `Already bound to ${name}`.
🪄 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: CHILL
Plan: Pro
Run ID: 1db82567-c90c-4718-a8b6-64ea603f1a9c
📒 Files selected for processing (42)
packages/rangelink-vscode-extension/src/__integration-tests__/helpers/logBasedUiAssertions.tspackages/rangelink-vscode-extension/src/__integration-tests__/suite/bindToDestination.test.tspackages/rangelink-vscode-extension/src/__integration-tests__/suite/builtInAiAssistants.test.tspackages/rangelink-vscode-extension/src/__integration-tests__/suite/contextMenuEditorContent.test.tspackages/rangelink-vscode-extension/src/__integration-tests__/suite/contextMenuEditorTab.test.tspackages/rangelink-vscode-extension/src/__integration-tests__/suite/contextMenuExplorer.test.tspackages/rangelink-vscode-extension/src/__integration-tests__/suite/contextMenuTerminal.test.tspackages/rangelink-vscode-extension/src/__integration-tests__/suite/coreSendCommands.test.tspackages/rangelink-vscode-extension/src/__integration-tests__/suite/dirtyBufferWarning.test.tspackages/rangelink-vscode-extension/src/__integration-tests__/suite/filePathNavigation.test.tspackages/rangelink-vscode-extension/src/__integration-tests__/suite/filenameOnlyNavigation.test.tspackages/rangelink-vscode-extension/src/__integration-tests__/suite/goToRangeLink.test.tspackages/rangelink-vscode-extension/src/__integration-tests__/suite/navigationClamping.test.tspackages/rangelink-vscode-extension/src/__integration-tests__/suite/navigationPrecision.test.tspackages/rangelink-vscode-extension/src/__integration-tests__/suite/navigationToastSettings.test.tspackages/rangelink-vscode-extension/src/__integration-tests__/suite/sendFilePath.test.tspackages/rangelink-vscode-extension/src/__integration-tests__/suite/textEditorDestination.test.tspackages/rangelink-vscode-extension/src/__integration-tests__/suite/unbind.test.tspackages/rangelink-vscode-extension/src/__integration-tests__/suite/untitledNavigation.test.tspackages/rangelink-vscode-extension/src/__tests__/commands/AddBookmarkCommand.test.tspackages/rangelink-vscode-extension/src/__tests__/commands/BindToTerminalCommand.test.tspackages/rangelink-vscode-extension/src/__tests__/commands/BindToTextEditorCommand.test.tspackages/rangelink-vscode-extension/src/__tests__/commands/GoToRangeLinkCommand.test.tspackages/rangelink-vscode-extension/src/__tests__/commands/ManageBookmarksCommand.test.tspackages/rangelink-vscode-extension/src/__tests__/destinations/PasteDestinationManager.test.tspackages/rangelink-vscode-extension/src/__tests__/destinations/capabilities/EditorFocusCapability.test.tspackages/rangelink-vscode-extension/src/__tests__/destinations/destinationBuilders.test.tspackages/rangelink-vscode-extension/src/__tests__/helpers/createMockTerminalPasteDestination.tspackages/rangelink-vscode-extension/src/__tests__/ide/vscode/VscodeAdapter.test.tspackages/rangelink-vscode-extension/src/__tests__/integration-helpers/logBasedUiAssertions.test.tspackages/rangelink-vscode-extension/src/__tests__/navigation/FilePathNavigationHandler.test.tspackages/rangelink-vscode-extension/src/__tests__/navigation/RangeLinkNavigationHandler.test.tspackages/rangelink-vscode-extension/src/__tests__/navigation/RangeLinkTerminalProvider.test.tspackages/rangelink-vscode-extension/src/__tests__/statusBar/RangeLinkStatusBar.test.tspackages/rangelink-vscode-extension/src/commands/AddBookmarkCommand.tspackages/rangelink-vscode-extension/src/config/__tests__/getDelimitersForExtension.test.tspackages/rangelink-vscode-extension/src/destinations/PasteDestinationManager.tspackages/rangelink-vscode-extension/src/i18n/messages.en.tspackages/rangelink-vscode-extension/src/ide/vscode/VscodeAdapter.tspackages/rangelink-vscode-extension/src/services/ClipboardRouter.tspackages/rangelink-vscode-extension/src/services/__tests__/SelectionValidator.test.tspackages/rangelink-vscode-extension/src/utils/__tests__/formatMessage.test.ts
CI / Integration Tests (with extensions) — run summary
|
CI / Test & Validate — run summary
|
…error message Addresses CodeRabbit review comments: JSDoc still referenced old `✓ ` prefix, seven QA YAML expected_result entries had stale `RangeLink: ` in toast messages, and one assertion error message referenced the wrong checked string. Ref: #578 (review)
CI / Integration Tests (with extensions) — run summary
|
CI / Test & Validate — run summary
|
|
@coderabbitai review - You were rate-limited in #578 (comment) |
|
✅ Actions performedReview triggered.
|
Summary
Centralizes all status bar message prefixing in
VscodeAdapterso every status bar message consistently carriesRangeLink:or✓ RangeLink:without requiring each template or call site to bake in the prefix. Toast messages (info/warning/error) no longer carryRangeLink:since VS Code already shows a Source attribution for those.Changes
setSuccessfulStatusBarMessage(message, timeout)toVscodeAdapter— prepends✓ RangeLink:, delegates to a shared private method withsetStatusBarMessagewhich prependsRangeLink:RangeLink:,✓, and✓ RangeLinkprefixes from status bar templates inmessages.en.ts— templates now carry only message payloadRangeLink:prefix from all toast message templates — VS Code's toast popup already shows the extension sourcesetStatusBarMessagetosetSuccessfulStatusBarMessage(bind/unbind/jump/copy/bookmark)Test Plan
Related
Summary by CodeRabbit
UI Improvements
Tests