Skip to content

Code Quality: Added support for middle clicking in the new BreadcrumbBar #17476

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

0x5bfa
Copy link
Member

@0x5bfa 0x5bfa commented Aug 20, 2025

Resolved / Related Issues

Steps used to test these changes

  1. Open Files app
  2. navigate to a nested folder
  3. Middle-click on the parent folder
  4. See a new tab opens with the parent folder

@yaira2 yaira2 self-requested a review August 20, 2025 04:47
@@ -10,7 +10,7 @@ public partial class BreadcrumbBarItem
{
private void ItemContentButton_Click(object sender, RoutedEventArgs e)
{
OnItemClicked();
//OnItemClicked();
Copy link
Member

Choose a reason for hiding this comment

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

Is this supposed to be commented out?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thought it would be better than removing the event handler to let poeple notice that this is already handled. Should we remove?

Copy link
Member

Choose a reason for hiding this comment

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

If it's already handled, it should be removed.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@@ -279,7 +279,8 @@ private async void BreadcrumbBar_ItemClicked(Controls.BreadcrumbBar sender, Cont
ViewModel.PathComponents[args.Index].Path is not { } path)
return;

await ViewModel.HandleFolderNavigationAsync(path);
var pointerUpdateKind = args.PointerRoutedEventArgs.GetCurrentPoint(null).Properties.PointerUpdateKind;
await ViewModel.HandleFolderNavigationAsync(path, pointerUpdateKind is PointerUpdateKind.MiddleButtonReleased);
Copy link
Member

@yaira2 yaira2 Aug 24, 2025

Choose a reason for hiding this comment

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

Instead of passing PointerUpdateKind.MiddleButtonReleased directly, I think we can make the code easier to read if we add another variable like this var openInNewTab = PointerUpdateKind.MiddleButtonReleased.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

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

Successfully merging this pull request may close these issues.

2 participants