Skip to content

Fix: Fixed issue where archives opened in new tab instead of existing one #17394

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 2 commits into
base: main
Choose a base branch
from

Conversation

marcofranzen99
Copy link
Contributor

Resolved / Related Issues

Steps used to test these changes

  1. Set the default app for the '.zip' file extension to Files
  2. Open a '.zip' file using Files
  3. Verify that the archive opens in the same tab, not a new one

Description
On my system, multiple applications were returned for the .zip file extension. The first association returned was not Files, which caused .zip files to open in a new tab instead of the same one.
With this change, all associations are now checked

@Josh65-2201
Copy link
Member

Works for me

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a bug where ZIP archives would open in a new tab instead of the existing tab when multiple applications were registered for the .zip file extension. The issue occurred because only the first file association was checked, which might not be the Files app itself.

  • Refactored file association checking to examine all registered associations instead of just the first one
  • Added new method GetAllFileAssociationsAsync to retrieve all file associations for a given file type
  • Updated the ZIP folder logic to use Any() check across all associations to determine if Files app can handle the file

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
ZipStorageFolder.cs Updated CheckDefaultZipApp to use new method that checks all file associations instead of just the first one
Win32Helper.Storage.cs Added GetAllFileAssociationsAsync method and refactored existing association logic into reusable helper methods

@yaira2 yaira2 changed the title Fix: Fixed bug where archive did not open in existing tab Fix: Fixed issue where archives didn't open in existing tab Aug 4, 2025
@yaira2 yaira2 changed the title Fix: Fixed issue where archives didn't open in existing tab Fix: Fixed issue where archives opened in new tab instead of existing one Aug 10, 2025
@yaira2 yaira2 force-pushed the 16646-open-archive-in-existing-tab branch from 2109996 to 11b054b Compare August 10, 2025 20:09
@yaira2
Copy link
Member

yaira2 commented Aug 10, 2025

If I change the default association to File Explorer, it still opens in Files. The expected behavior is to respect the default association.

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.

Bug: Archives should open in the same tab not a new one
3 participants