Skip to content

feat: copy path to line from editor tab and line number gutter - #79

Merged
nwparker merged 4 commits into
mainfrom
nwparker/line-number-copy-path
Mar 24, 2026
Merged

nwparker merged 4 commits into
mainfrom
nwparker/line-number-copy-path

Conversation

@nwparker

@nwparker nwparker commented Mar 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Right-click on line number gutter shows a Radix context menu with "Copy Path to Line" and "Copy Rel. Path to Line" (appends #L<line> to path)
  • Right-click on editor file tab adds "Copy Relative Path", "Copy Path to Line", and "Copy Relative Path to Line" options
  • Tracks cursor line position per file via the editor store

Changes

  • MonacoEditor.tsx: Intercepts gutter right-click (like VSCode's editorLineNumberMenu.ts) and shows a Radix DropdownMenu at click position. Tracks cursor line via onDidChangeCursorPosition.
  • EditorFileTab.tsx: New tab context menu items for copy relative path and copy path to line
  • EditorPanel.tsx: Passes relativePath prop to MonacoEditor
  • editor.ts: New editorCursorLine store state for cursor line tracking per file

Test plan

  • Open a file, right-click line number 42 → "Copy Path to Line" copies <abs-path>#L42
  • Right-click line number → "Copy Rel. Path to Line" copies <rel-path>#L42
  • Right-click editor tab → verify "Copy Relative Path" and line-based options work
  • Diff tabs should not show line-based options in tab context menu

🤖 Generated with Claude Code

Tracks cursor line position from Monaco editor and adds context menu
options to copy file path with line number anchor (e.g. path#L59).

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@nwparker
nwparker force-pushed the nwparker/line-number-copy-path branch from e748d7e to e8aa9d5 Compare March 24, 2026 06:29
nwparker and others added 3 commits March 23, 2026 23:32
Adds "Copy Path to Line" and "Copy Relative Path to Line" as Monaco
editor context menu actions so they appear on right-click anywhere in
the editor. Also handles right-click on line number gutter to show
the context menu there too.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Replaces Monaco's built-in context menu with a Radix DropdownMenu for
the line number gutter, matching the VSCode approach of intercepting
the gutter right-click and showing a custom menu. Shows the clicked
line number in the menu items.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@nwparker nwparker changed the title feat: copy path to line from editor tab context menu feat: copy path to line from editor tab and line number gutter Mar 24, 2026
@nwparker
nwparker merged commit 02b603b into main Mar 24, 2026
enrick-dev pushed a commit to enrick-dev/orca that referenced this pull request Oct 15, 2026
…yai#79)

* feat: add copy path/relative path to line in editor tab context menu

Tracks cursor line position from Monaco editor and adds context menu
options to copy file path with line number anchor (e.g. path#L59).

Co-Authored-By: Claude Opus 4.6 <[email protected]>

* fix: add copy path to line in Monaco editor context menu

Adds "Copy Path to Line" and "Copy Relative Path to Line" as Monaco
editor context menu actions so they appear on right-click anywhere in
the editor. Also handles right-click on line number gutter to show
the context menu there too.

Co-Authored-By: Claude Opus 4.6 <[email protected]>

* fix: use Radix context menu for line number gutter right-click

Replaces Monaco's built-in context menu with a Radix DropdownMenu for
the line number gutter, matching the VSCode approach of intercepting
the gutter right-click and showing a custom menu. Shows the clicked
line number in the menu items.

Co-Authored-By: Claude Opus 4.6 <[email protected]>

* fix: simplify gutter context menu to just path-to-line options

Co-Authored-By: Claude Opus 4.6 <[email protected]>

---------

Co-authored-by: Claude Opus 4.6 <[email protected]>
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