-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix unexpected click handling in File Explorer #255
Conversation
mofojed
commented
Oct 22, 2021
- Pass the event that triggered the select through
- Use that event to trigger whether we should focus the editor or not
- When we don't want to focus the editor, maintain the focus
- Fixes Unexpected File Explorer Click Handling #151
It's still focusing too much though
It shouldn't focus the editor, should keep focus in item list
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still need to pull the changes and test functionality in addition to the requested changes
packages/dashboard-core-plugins/src/panels/FileExplorerPanel.tsx
Outdated
Show resolved
Hide resolved
- Wire up a new `tabClicked` event in golden-layout - Listen to `tabClicked` event in NotebookPanel, focus when that happens - Explicitly call `focus()` from `ConsolePlugin` instead of relying on implicit `focus()` on shown event - Deleted unused `_$shown` method in golden-layout
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some issues w/ behavior I found
- Fresh page. Single click on a file doesn't focus editor, but focuses the previewed tab. File explorer does not keep focus like it should. This seems to only be on first click
- Single clicking an already selected file deselects it (inconsistent w/ vscode). In VSCode, it keeps it selected and does nothing really
- Single clicking a file, clicking out (in console for example), then single clicking again deselects. Similar to above
- Open a file (in preview or full mode) and then single clicking on the file name again doesn't maintain focus in the file explorer
- Double clicking a file that is already open when it is not blurred selected in the file explorer results in no selection in file explorer
Something is off w/ the logic. Should be
- Single click always brings file tab into view (open preview if necessary). Always leave focus in file explorer
- Double click always brings file tab into view (open or promote from preview if necessary). Leave blurred focus in file explorer. Focus editor.
@dsmmcken Just want to confirm single click should keep it selected. Makes sense to me, but we explicitly deselect in that scenario in CommandHistory. |
Yeah, that's fine for this. Especially if selection also changes depending on tab selected. I general though, I like being able to de-select things. |
Focus is still weird when opening other panels, due to: https://github.com/illumon-public/golden-layout/blame/a08cdc71cf5b5b2e26da31465ebe0971b3686b44/src/js/items/Component.js#L53
- The .append causes the existing elements to be added to a fragment outside of the document, so focus is lost - Just add the focus back after appending the child. - Clean up isFocusOnShow default value
@mattrunyon I think it should be good now, but I'm not really sure what you mean by your last checkbox item:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The last comment meant the faded selection state where the item was previously selected and then the panel was blurred.
Everything looks to be working properly now.
I did notice a few very minor inconsistencies, but I don't think they are due to this element/handling logic.
- Right clicking a file followed by left clicking the file does not select the file. I think that's a context menu problem. Pretty sure it creates an invisible overlay for click outside detection.
- Entering the rename dialog and then pressing escape/enter blurs the file input focus. In VSCode it maintains focus and just exits the rename input.
The only annoyance someone might face is if they want to rename several files in succession and use the keyboard to do it since confirming a rename also blurs input. We can make that a separate ticket since this one relates to click handling.