Skip to content

Workspaces: PWA apps should not necessarily configure profile to launch. #39971

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

Merged
merged 7 commits into from
Jun 17, 2025

Conversation

vanzue
Copy link
Contributor

@vanzue vanzue commented Jun 10, 2025

Summary of the Pull Request

Workspace support for pwa is now limited, it is tight to specific Profile launch. If you create a pwa app with a profile other than "Default", launch will fail. Then you have to manually configure that profile to launch.
This pr fix it by launching with shell:appsfolder\appusermodelId

PR Checklist

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

  • Create a new workspace with a pwa app(Other than default profile) should be no problem.
  • Existing workspace with a pwa(default profile and other profile) should launch successfully without problem
  1. with pt version 91.1, create a loop pwa with "Profile 1" instead of "Default" in edge.
  2. capture and launch actually launch the edge instead of loop
  3. Create profile with this impl and launch
  4. Launch pwa successfully

This comment has been minimized.

@vanzue vanzue marked this pull request as ready for review June 10, 2025 04:01
@vanzue vanzue requested review from yeelam-gordon and Copilot June 10, 2025 04:02
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 launch failure for PWAs when using a non‐default profile by switching to using the AppUserModelId from a WindowUtils utility and adding version handling to control the launch path. Key changes include:

  • Replacing calls to PwaHelper’s GetAUMIDFromWindow with the new Utils::GetAUMIDFromWindow method.
  • Introducing a version field for applications to control launch behavior.
  • Updating project files and related modules (WorkspacesData, WorkspacesEditor, etc.) to propagate and use the new version information.

Reviewed Changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
WindowArranger.cpp Updated to use Utils::GetAUMIDFromWindow for retrieving the AUMID.
SnapshotUtils.cpp Modified to assign appUserModelId and version from the window AUMID and JSON data.
WorkspacesLib.vcxproj & .filters Added new WindowUtils and StringUtils source files to the project.
WorkspacesData.h/.cpp Added a new version field to support versioned launch behavior.
WindowUtils.{h,cpp} New utility for retrieving window properties including the AUMID.
AppLauncher.cpp Updated launch logic to parse version and decide the correct launch path.
WorkspacesEditor files Propagated the version property into workspace editor models and serialization.
Comments suppressed due to low confidence (1)

src/modules/Workspaces/WorkspacesLib/WorkspacesData.h:37

  • [nitpick] Clarify the comment for the version field to indicate whether the empty version string should default to '1' and explain the rationale behind this default behavior.
// empty to 1,

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@vanzue vanzue changed the title Launch pwa with appuser model id Workspaces: PWA apps should not necessarily configure profile to launch. Jun 10, 2025
@yeelam-gordon yeelam-gordon added the Product-Workspaces Refers to the Workspaces utility label Jun 10, 2025
@yeelam-gordon yeelam-gordon added this to the PowerToys 0.92 milestone Jun 10, 2025
Copy link
Contributor

@yeelam-gordon yeelam-gordon left a comment

Choose a reason for hiding this comment

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

I follow the logic, basically adding a virtual version to use the new behavior or launch or not.

@vanzue
Copy link
Contributor Author

vanzue commented Jun 17, 2025

I follow the logic, basically adding a virtual version to use the new behavior or launch or not.

Thanks for review!

@vanzue vanzue merged commit c487638 into main Jun 17, 2025
16 checks passed
yeelam-gordon pushed a commit that referenced this pull request Jun 20, 2025
…ch. (#39971)

<!-- Enter a brief description/summary of your PR here. What does it
fix/what does it change/how was it tested (even manually, if necessary)?
-->
## Summary of the Pull Request
Workspace support for pwa is now limited, it is tight to specific
Profile launch. If you create a pwa app with a profile other than
"Default", launch will fail. Then you have to manually configure that
profile to launch.
This pr fix it by launching with shell:appsfolder\appusermodelId

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist

- [X] **Closes:** #36384
- [ ] **Communication:** I've discussed this with core contributors
already. If work hasn't been agreed, this work might be rejected
- [ ] **Tests:** Added/updated and all pass
- [ ] **Localization:** All end user facing strings can be localized
- [ ] **Dev docs:** Added/updated
- [ ] **New binaries:** Added on the required places
- [ ] [JSON for
signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json)
for new binaries
- [ ] [WXS for
installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs)
for new binaries and localization folder
- [ ] [YML for CI
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml)
for new test projects
- [ ] [YML for signed
pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml)
- [ ] **Documentation updated:** If checked, please file a pull request
on [our docs
repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys)
and link it here: #xxx

<!-- Provide a more detailed description of the PR, other things fixed
or any additional comments/features here -->
## Detailed Description of the Pull Request / Additional comments

<!-- Describe how you validated the behavior. Add automated tests
wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed
- [X] Create a new workspace with a pwa app(Other than default profile)
should be no problem.
- [X] Existing workspace with a pwa(default profile and other profile)
should launch successfully without problem

1. with pt version 91.1, create a loop pwa with "Profile 1" instead of
"Default" in edge.
2. capture and launch actually launch the edge instead of loop
3. Create profile with this impl and launch
4. Launch pwa successfully

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Product-Workspaces Refers to the Workspaces utility
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants