Add Cmd+Click go-to-definition in code viewer#1
Draft
davegaeddert wants to merge 2 commits into
Draft
Conversation
The minimap now attaches its own passive scroll listener and ResizeObserver on the scrollContainer prop, directly mutating its viewport indicator div. This removes the forwardRef/ useImperativeHandle plumbing and the useScrollPosition hook from CodeViewer, simplifying parent↔minimap communication.
Cmd+Click on a symbol in the diff/file viewer navigates to its definition. Uses git grep to narrow candidate files, then tree-sitter symbol extraction to find exact matches. Single result navigates directly; multiple results show a picker dialog. - Rust: new find_symbol_definitions Tauri command with parallel tree-sitter processing - TypeScript: SymbolDefinition type, API client method - React: useCmdKeyHeld and useGoToDefinition hooks - UI: DefinitionPicker dialog, Cmd+hover cursor/underline styling via onLineClick in @pierre/diffs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
git grep -lto quickly narrow candidate files, then parallel tree-sitter symbol extraction to find exact name matchesunsafeCSSinjection into@pierre/diffsshadow DOMChanges
Rust backend (3 modified files)
SymbolDefinitionstruct insymbols/mod.rsfind_definitions()helper insymbols/extractor.rs(recursive, includes children)find_symbol_definitionsTauri command with parallel file processingTypeScript API (4 modified files)
SymbolDefinitiontype,findSymbolDefinitions()in ApiClient interface + TauriClient + HttpClient stubReact hooks (2 new files)
useCmdKeyHeld— tracks Meta key state via keydown/keyup/bluruseGoToDefinition— full flow: word extraction via composedPath(), keyword filtering, backend lookup, navigation or pickerUI (5 modified files, 1 new file)
DefinitionPicker— Radix Dialog with keyboard navigation (arrows, Enter, Esc)onLineClickwired into DiffView and PlainCodeView optionsTest plan
scripts/test— TypeScript type check + Rust tests pass