Skip to content

[issues/643] Fix R-F on images and other non-text editor tabs#651

Merged
couimet merged 2 commits into
mainfrom
issues/643
Jun 16, 2026
Merged

[issues/643] Fix R-F on images and other non-text editor tabs#651
couimet merged 2 commits into
mainfrom
issues/643

Conversation

@couimet

@couimet couimet commented Jun 15, 2026

Copy link
Copy Markdown
Owner

Summary

R-F (Cmd+R Cmd+F / Ctrl+R Ctrl+F, "paste current file path") showed No active file. Open a file and try again. whenever the active tab was an image, notebook, or diff view, because the paster only consulted vscode.window.activeTextEditor. The paster now resolves the URI from the active tab's input, covering every tab kind that maps to a file.

Changes

  • Added VscodeAdapter.getActiveTabUri(): resolves a file URI from any tab input by checking input.uri ?? input.modified, with a vscode.Uri duck-type guard. Works for text editors, custom editors (images), notebooks, and diff views (returns .modified). Future VS Code tab types with a file URI work automatically.
  • Added VscodeAdapter.getActiveTabViewColumn() so self-paste detection still works when the active tab is non-text.
  • Switched FilePathPaster.pasteCurrentFilePath to the new tab-based adapter methods. LinkGenerator and getEligibleFiles keep getActiveTextEditorUri; they need real text-editor geometry.
  • Centralized integration-test file cleanup into a module-level registry in fileHelpers.ts. Every file-creation helper (createFileAt, createWorkspaceFile, createPngFixture) auto-registers for teardown. trackFileUri removed from the SsContext interface.
  • Refactored filePicker.test.ts subdirectory file creation to use createFileAt (which now supports subdirectory paths via ensureParentDir), dropping manual fs.mkdirSync / fs.writeFileSync / ss.trackFileUri boilerplate.
  • Documentation: CHANGELOG entry added under [Unreleased] → Fixed. README not updated (existing R-F documentation is still accurate).

Test Plan

  • Unit suite: 2067 / 2067 passing
  • New integration tests send-file-path-017 (image preview / custom editor) and send-file-path-018 (text diff / asserts modified side is used): both passing
  • Affected integration tests (sfp-004, sfp-005, sfp-006, sfp-009, sfp-015, ted-002, fp-003, fp-011, rvec-014) all passing
  • QA YAML entries for 017 and 018 added; validate-qa-coverage passes

Related

## Summary

R-F (`Cmd+R Cmd+F` / `Ctrl+R Ctrl+F`, "paste current file path") showed `No active file. Open a file and try again.` whenever the active tab was an image, notebook, or diff view, because the paster only consulted `vscode.window.activeTextEditor`. The paster now resolves the URI from the active tab's input, covering every tab kind that maps to a file.

## Changes

- Added `VscodeAdapter.getActiveTabUri()`: resolves a file URI from any tab input by checking `input.uri ?? input.modified`, with a `vscode.Uri` duck-type guard. Works for text editors, custom editors (images), notebooks, and diff views (returns `.modified`). Future VS Code tab types with a file URI work automatically.
- Added `VscodeAdapter.getActiveTabViewColumn()` so self-paste detection still works when the active tab is non-text.
- Switched `FilePathPaster.pasteCurrentFilePath` to the new tab-based adapter methods. `LinkGenerator` and `getEligibleFiles` keep `getActiveTextEditorUri`; they need real text-editor geometry.
- Centralized integration-test file cleanup into a module-level registry in `fileHelpers.ts`. Every file-creation helper (`createFileAt`, `createWorkspaceFile`, `createPngFixture`) auto-registers for teardown. `trackFileUri` removed from the `SsContext` interface.
- Refactored `filePicker.test.ts` subdirectory file creation to use `createFileAt` (which now supports subdirectory paths via `ensureParentDir`), dropping manual `fs.mkdirSync` / `fs.writeFileSync` / `ss.trackFileUri` boilerplate.
- Documentation: CHANGELOG entry added under [Unreleased] → Fixed. README not updated (existing R-F documentation is still accurate).

## Test Plan

- [x] Unit suite: 2067 / 2067 passing
- [x] New integration tests `send-file-path-017` (image preview / custom editor) and `send-file-path-018` (text diff / asserts modified side is used): both passing
- [x] Affected integration tests (sfp-004, sfp-005, sfp-006, sfp-009, sfp-015, ted-002, fp-003, fp-011, rvec-014) all passing
- [x] QA YAML entries for 017 and 018 added; validate-qa-coverage passes

## Related

- Closes #643
@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown

⚠️ QA Coverage Gap Detected

The PR introduces changes to the behavior of the R-F command, allowing it to work with various active tab types, which requires additional test cases for coverage.

Suggested test cases:

  • send-file-path: R-F sends file path when active tab is an image preview (automatable)
  • send-file-path: R-F sends the modified side path when active tab is a text diff view (automatable)

Generated by QA Gap Check (GPT-4o-mini via GitHub Models)

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

Repository owner deleted a comment from coderabbitai Bot Jun 16, 2026
@github-actions

Copy link
Copy Markdown

✅ CI / Integration Tests (with overrides) — run summary

Duration: 1m 5s

QA TC IDs: 2 exercised across 0 features

Report: View run & artifacts

Reproduce locally: ./scripts/run-integration-tests.sh --label needs-override --exclude-label cursor --exclude-assisted

Feature breakdown
Feature TCs IDs

@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@couimet, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 33 minutes and 2 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

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.

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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 638f26b4-11c4-47f1-ab8c-ade0a8ef4e66

📥 Commits

Reviewing files that changed from the base of the PR and between 68084a5 and a921a76.

📒 Files selected for processing (13)
  • packages/rangelink-vscode-extension/CHANGELOG.md
  • packages/rangelink-vscode-extension/qa/qa-test-cases.yaml
  • packages/rangelink-vscode-extension/src/__integration-tests__/helpers/fileHelpers.ts
  • packages/rangelink-vscode-extension/src/__integration-tests__/helpers/ssContext.ts
  • packages/rangelink-vscode-extension/src/__integration-tests__/suite/contextMenuEditorContent.test.ts
  • packages/rangelink-vscode-extension/src/__integration-tests__/suite/editorBindingValidation.test.ts
  • packages/rangelink-vscode-extension/src/__integration-tests__/suite/filePicker.test.ts
  • packages/rangelink-vscode-extension/src/__integration-tests__/suite/sendFilePath.test.ts
  • packages/rangelink-vscode-extension/src/__integration-tests__/suite/textEditorDestination.test.ts
  • packages/rangelink-vscode-extension/src/__tests__/ide/vscode/VscodeAdapter.test.ts
  • packages/rangelink-vscode-extension/src/__tests__/services/FilePathPaster.test.ts
  • packages/rangelink-vscode-extension/src/ide/vscode/VscodeAdapter.ts
  • packages/rangelink-vscode-extension/src/services/FilePathPaster.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch issues/643

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 and usage tips.

@github-actions

Copy link
Copy Markdown

✅ CI / Integration Tests (automated) — run summary

Duration: 11m 20s

QA TC IDs: 163 exercised across 0 features

Report: View run & artifacts

Reproduce locally: ./scripts/run-integration-tests.sh --exclude-label requires-extensions --exclude-label cursor --automated

Feature breakdown
Feature TCs IDs

@github-actions

Copy link
Copy Markdown

✅ CI / Integration Tests (with extensions) — run summary

Duration: 12m 57s

Unit tests: Ran in separate Test & Validate job

QA TC IDs: 195 exercised across 0 features

Report: View run & artifacts

Reproduce locally: ./scripts/run-integration-tests.sh --exclude-label cursor --exclude-label needs-override --exclude-assisted

Feature breakdown
Feature TCs IDs

@couimet couimet merged commit 1f89d4f into main Jun 16, 2026
7 checks passed
@couimet couimet deleted the issues/643 branch June 16, 2026 12:54
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.

R-F doesn't seem to work on images

1 participant