feat: unified @mention button in FileViewer (lines or whole file) - #352
Open
windli2018 wants to merge 1 commit into
Open
feat: unified @mention button in FileViewer (lines or whole file)#352windli2018 wants to merge 1 commit into
windli2018 wants to merge 1 commit into
Conversation
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.
What
The FileViewer (opened-file tab) tool bar now has a single @ mention button that works everywhere:
@path#Lstart-Lend@pathThe button is always visible (previously the line-mention button only showed in source mode). Behavior follows the current selection — same @ icon, one entry point. A dynamic tooltip shows what will happen: "Mention selected lines (L12-L18)" vs "Insert path".
On mobile, after any mention the file panel/sidebar closes so the chat (with the inserted mention) is revealed — no need to manually navigate back.
Why
@path) was missing in FileViewer entirely (only the file explorer sidebar had it).How
FileViewer: a unified mention button (onPointerDown preventDefault to preserve the selection through the click on touch devices). Click handler branches onselectedLineRange.AppShell: passonAtMentionto FileViewer (reusing the existinghandleAtMention); the three mention handlers now collapse the file panel + sidebar on mobile so the user lands back in the chat.Notes
onMentionLines(passed when the right panel is open); when it's absent the button falls back to whole-file mention — so the button is always useful.