[diffs/edit] Use editor gutter interaction handler for line selection - #1005
[diffs/edit] Use editor gutter interaction handler for line selection#1005ije wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0c5b998a42
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| private startLineSelectionFromPointerDown(event: PointerEvent): void { | ||
| const { enableLineSelection = false } = this.options; | ||
| if (!enableLineSelection) { | ||
| if (!enableLineSelection || this.hasEditorAttached) { |
There was a problem hiding this comment.
Preserve touch line selection while editing
When an editor is attached, this guard prevents the InteractionManager's normal line-selection path for every pointer type. The editor gutter handler that is supposed to take over only handles mouse pointers (it returns for touch/pen before resolving editable lines), so on touch/pen devices with enableLineSelection true, tapping or dragging the editable gutter in edit mode now neither updates editor selections nor fires line-selection callbacks; before this change the existing InteractionManager touch path handled those gestures. Consider letting non-mouse pointers continue through the existing line-selection path or adding touch support to the editor handler.
Useful? React with 👍 / 👎.
|
So I had made a bit of an intentional design decision here. If enableLineSelection was true, then you’d lose the editor line selection functionality. You also don’t need to use that prop to make line selections because it can be done programmatically or via gutter utility. I think this makes for a cleaner separation of concerns, and if devs want the edit line selection they could toggle the prop when editing |
|
i see! i create another pr for fixing the selection rounded corner rendering with selected lines in #1007 |
#979 fixed
enableLineSelectionand other file/diffs options that did have good compatibility with the editor. however the editor has the own gutter interaction handler.this pr uses editor gutter interaction when a editor attached without changing the file/difss options, and the previous line selection remain.