Skip to content

Conversation

DHANUSHRAJA22
Copy link

Resolved / Related Issues
To prevent extra work, all changes to the Files codebase must link to an approved issue marked as Ready to build. Please insert the issue number following the hashtag with the issue number that this Pull Request resolves.

Description
This PR implements the ability for users to middle-click on parent folder breadcrumbs in the navigation toolbar to open those folders in new tabs. When a user middle-clicks on any breadcrumb item except the current folder (the last item), it will open that parent folder in a new tab.

Changes Made:

  • Added ItemMiddleClicked event to BreadcrumbBar control
  • Added BreadcrumbBarItemMiddleClickedEventArgs class for event arguments
  • Added pointer pressed event handler to BreadcrumbBarItem to detect middle mouse button clicks
  • Added BreadcrumbBar_ItemMiddleClicked handler in NavigationToolbar.xaml.cs that:
    • Prevents action on the current folder (last breadcrumb item)
    • Retrieves the path from ViewModel.PathComponents[args.Index].Path
    • Calls NavigationHelpers.AddNewTabByPathAsync(typeof(ShellPanesPage), path, false) to open the folder in a new tab

Steps used to test these changes
Stability is a top priority for Files and all changes are required to go through testing before being merged into the repo. Please include a list of steps that you used to test this PR.

  1. Opened Files and navigated to a nested folder structure
  2. Right-clicked with middle mouse button on parent folder breadcrumbs (not the current folder)
  3. Verified that the parent folder opens in a new tab
  4. Confirmed that middle-clicking on the current folder (last breadcrumb) does not trigger the action
  5. Tested with different folder depths to ensure consistency
  6. Verified that normal left-clicking still works as expected for navigation<!--
    🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨
    I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING:
  7. PR may be deleted if it is not following the template
  8. Try not to make duplicates. Do a quick search before posting
  9. Add a clear title starting with "Feature:" or "Fix:"
    -->

Resolved / Related Issues

To prevent extra work, all changes to the Files codebase must link to an approved issue marked as Ready to build. Please insert the issue number following the hashtag with the issue number that this Pull Request resolves.

  • Closes #

Steps used to test these changes

Stability is a top priority for Files and all changes are required to go through testing before being merged into the repo. Please include a list of steps that you used to test this PR.

  1. Opened Files ...
  2. ...

…les-community#17378)feat(ui): middle click Omnibar parent opens folder in new tab (fix files-community#17378)feat(ui): Add middle-click handler for BreadcrumbBarItemfeat(ui): Add middle-click handler for BreadcrumbBarItemfeat(ui): Add middle-click handler for BreadcrumbBarItemUpdate BreadcrumbBarItem.Events.cs

- Add PointerPressed event handler to detect middle mouse button clicks
- Include Microsoft.UI.Input using statement for pointer properties
- Call OnItemMiddleClicked() method when middle button is pressed
- Part of implementation for opening parent folder in new tab on middle-click (issue files-community#17378)

Signed-off-by: DHANUSH RAJA <[email protected]>
…licked event to BreadcrumbBarfeat(ui): add ItemMiddleClicked event to BreadcrumbBarUpdate BreadcrumbBar.cs

Signed-off-by: DHANUSH RAJA <[email protected]>
…les-community#17378)feat(ui): middle click Omnibar parent opens folder in new tab (fix files-community#17378)Update NavigationToolbar.xaml.cs

Signed-off-by: DHANUSH RAJA <[email protected]>
@Josh65-2201
Copy link
Member

This is already being worked on in #17476

@yaira2
Copy link
Member

yaira2 commented Aug 26, 2025

@DHANUSHRAJA22 thank you for your PR. As Josh mentioned, someone already started a similar PR. Can you please take a look at #17476 and offer your feedback?

@yaira2 yaira2 closed this Aug 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: Middle click to open a new tab from a parent folder in the Omnibar
3 participants