Skip to content

Default singleClickNavigation back to false #7624

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

Closed
wants to merge 2 commits into from

Conversation

jtpio
Copy link
Member

@jtpio jtpio commented Apr 4, 2025

Fixes #7538

See #7538 for more context.

  • Update default value for singleClickNavigation
  • Mention in the user facing changelog

@jtpio jtpio added this to the 7.4.0 milestone Apr 4, 2025
@jtpio jtpio added the bug label Apr 4, 2025
Copy link
Contributor

github-actions bot commented Apr 4, 2025

Binder 👈 Launch a Binder on branch jtpio/notebook/single-click-navigation-default

Copy link
Collaborator

@brichet brichet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jtpio, looks good

@afshin
Copy link
Member

afshin commented Apr 9, 2025

I wonder if moving the single click handling from mousedown to click would fix the underlying problem.

diff --git a/packages/filebrowser/src/listing.ts b/packages/filebrowser/src/listing.ts
index 9a63d85329..2b0d377d58 100644
--- a/packages/filebrowser/src/listing.ts
+++ b/packages/filebrowser/src/listing.ts
@@ -1376,6 +1376,10 @@ export class DirListing extends Widget {
       //    previously focussed item will be focussed.
       this._focusItem(this._focusIndex);
     }
+
+    if (this._allowSingleClick) {
+      this.evtDblClick(event as MouseEvent);
+    }
   }

   /**
@@ -1470,10 +1474,6 @@ export class DirListing extends Widget {
       document.addEventListener('mouseup', this, true);
       document.addEventListener('mousemove', this, true);
     }
-
-    if (this._allowSingleClick) {
-      this.evtDblClick(event as MouseEvent);
-    }
   }

   /**

@jtpio
Copy link
Member Author

jtpio commented Apr 9, 2025

We discussed this PR in the Jupyter Frontends call today, trying to weigh the pros and cons for changing the default.

While changing the default back to double click would solve the issue, it would also be a change of behavior in 7.4, for a default that was added in 7.3. So there is a risk of making Notebook users annoyed by these changes of default between minor releases, with a short notice.

Also, it sounded like this is actually a bug, that could be fixed as a regular bug fix. It's not clear yet whether that would mean fixing it in JupyterLab or Notebook, but at least it could be released as 7.4.x.

So closing this PR for now to unblock the 7.4.0 release. Since the bug has been in 7.3.x, we could fix it as part of 7.4.x.

@jtpio jtpio closed this Apr 9, 2025
@jtpio
Copy link
Member Author

jtpio commented Apr 9, 2025

I wonder if moving the single click handling from mousedown to click would fix the underlying problem.

Ah interesting, thanks @afshin for looking into this 👍

I can try to add the patch in a draft PR here in notebook to see if it helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'navigate files and folders with single click' only effective in jupyter lab
3 participants