Skip to content

feat(applifecycle): add public constructor to AppActivationArguments [Issue fix agent testing - not actual feature work!]#6269

Draft
MuyuanMS wants to merge 2 commits intomainfrom
feat/appactivationargs-public-ctor
Draft

feat(applifecycle): add public constructor to AppActivationArguments [Issue fix agent testing - not actual feature work!]#6269
MuyuanMS wants to merge 2 commits intomainfrom
feat/appactivationargs-public-ctor

Conversation

@MuyuanMS
Copy link
Contributor

@MuyuanMS MuyuanMS commented Mar 5, 2026

Summary

Add a public WinRT constructor to AppActivationArguments so callers can create instances directly for activation redirection scenarios (e.g., RedirectActivationToAsync) without relying on internal factory methods.

Fixes #6075

Changes

API surface (dev/AppLifecycle/AppLifecycle.idl)

  • Bumped AppLifecycleContract from contractversion(2) to contractversion(3)
  • Added AppActivationArguments(ExtendedActivationKind kind, IInspectable data) constructor gated to [contract(AppLifecycleContract, 3)]

Implementation (dev/AppLifecycle/AppActivationArguments.h)

  • Removed = delete on the default constructor (the WinRT factory needs it)
  • Added factory_implementation namespace with the required factory struct
  • Added clarifying comments to both constructors

Factory wiring (dev/AppLifecycle/AppActivationArguments.cpp — new file)

  • Includes the auto-generated .g.cpp to provide the winrt_make_ factory function that the WinRT projection calls when consumers invoke the new public constructor

Build system (dev/AppLifecycle/AppLifecycle.vcxitems)

  • Added AppActivationArguments.cpp to the shared items project

Motivation

Issue #6075 (and companion #6074) describe a gap where AppActivationArguments had no public constructor, making it impossible for developers to construct custom activation args for scenarios like:

  • Calling AppInstance.RedirectActivationToAsync() with modified or synthetic activation data
  • Unit testing activation handling code
  • Building middleware that transforms activation arguments before forwarding

The existing internal constructors were only accessible from within the SDK.

Validation

  • Build: BuildAll.ps1 -Platform x64 -Configuration Release — ✅ passes (exit code 0)
  • Backward compatibility: The new constructor is gated behind AppLifecycleContract v3; existing v1/v2 consumers are unaffected
  • No breaking changes: The two existing internal constructors remain unchanged; only a new public constructor is added

Risk

Low — additive API surface only. The new constructor delegates to the same field assignments used by existing internal code paths.


A microsoft employee must use /azp run to validate using the pipelines below.

WARNING: Comments made by azure-pipelines bot maybe inaccurate. Please see pipeline link to verify that the build is being ran.

For status checks on the main branch, please use TransportPackage-Foundation-PR and run the build against your PR branch with the default parameters.

MuyuanMS and others added 2 commits March 4, 2026 18:50
Port agents and skills from PowerToys for automated PR and issue
workflows, generalized for any repository:

Agents (8): ReviewPR, FixPR, TriagePR, ReviewIssue, PlanIssue,
  FixIssue, IssueToPR, ReviewTheReview

Skills (10): pr-review (13-dimension analysis), pr-fix, pr-rework
  (iterative review-fix-build loops), pr-triage, issue-review,
  issue-fix, issue-review-review, issue-to-pr-cycle,
  continuous-issue-triage, parallel-job-orchestrator

Key generalizations:
- Auto-detect owner/repo via gh CLI (Get-RepoSlug helper)
- Build commands use existing BuildAll.ps1
- Worktree scripts use existing worktree-manager skill
- Review dimension 10 rewritten for C++/WinRT + WIL patterns
- All 13 review dimensions updated with WinAppSDK-specific checks
- No hardcoded repo references; fully portable

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Bump AppLifecycleContract from v2 to v3 and expose a public constructor on AppActivationArguments(ExtendedActivationKind, IInspectable) so callers can create instances directly for activation redirection scenarios without relying on internal factory methods.

Fixes #6075
@MuyuanMS MuyuanMS marked this pull request as draft March 5, 2026 09:41
@MuyuanMS MuyuanMS changed the title feat(applifecycle): add public constructor to AppActivationArguments feat(applifecycle): add public constructor to AppActivationArguments [Issue fix agent testing - not actual feature work!] Mar 5, 2026
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.

Feature request: Allow creation of AppActivationArguments for activation redirection

1 participant