← Back to Pull requests

Add Windows application lifecycle hooks #4903

Open
sinha20abhishek2007-debug opened this pull request with 70 lines diff across 4 files
View on GitHub
sinha20abhishek2007-debug sinha20abhishek2007-debug commented on Nov 23, 2026 16:39 UTC
Author

<!--- Describe your changes in detail -->
<!--- What problem does this change solve? -->
<!--- If this PR relates to an issue, include Refs #XXX or Fixes #XXX -->

PR Checklist:


<!--- Go over all the following points, and put an x in all the boxes that apply. -->
  • I will abide by the BeeWare Code of Conduct

  • I have read and have followed the [CONTRIBUTING.md](../blob/main/CONTRIBUTING.md) file

  • This PR was generated or assisted using an AI tool

  • <!-- update or delete the next line to reflect your usage -->
    Assisted-by: ChatGpt

    Diff: 70 lines (+70 / -0) across 4 files Reviewer: freakboy3742 Review duration: 16638m
    All Vouch review confidence checks passed
    Residual risk 0.04 = Change Risk (0.38) × (1 − Review Confidence (0.88)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.38 · 70 lines diff across 4 files
    0.38
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.87 · 2 substantive comment(s)
    0.87
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    88%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.255
    Ai Authored ai_authored
    0.050
    Real PR Conversation Timeline
    4 items
    freakboy3742 freakboy3742 commented on code on Nov 25, 2026 01:12 UTC
    Code Review
    testbed/tests/app/test_windows.py:1

    The testbed doesn't include platform-specific tests. If there's something that needs to be tested, we find a platform-agnostic way to express that test, and then put the implementation in the test probe.

    For the purpose of lifecycle hooks, if the event isn't triggered as part of normal app operation, we have historically been accepting a no-cover on those handlers. However, if you're able to find a generic representation for the "type" of event that can't be triggered as part of the test suite (e.g., triggering events that are part of the app being put into the background), then a generic test that is implemented in the probe would be acceptable.

    freakboy3742 freakboy3742 commented on code on Nov 25, 2026 01:14 UTC
    Code Review
    docs/en/reference/platforms/windows.md:1
    @@ -33,3 +33,17 @@ $ python -m pip install toga-winforms
     The `toga-winforms` backend uses the [Windows Forms API](https://learn.microsoft.com/en-us/dotnet/desktop/winforms/?view=netdesktop-8.0).
     
     The native .NET APIs are accessed using [Python.NET](http://pythonnet.github.io).
    +
    +## Platform-specific app lifecycle hooks

    The structure of this documentation isn't consistent with the accepted style/format that has been used for iOS, Android and macOS.

    freakboy3742 freakboy3742 requested changes on Nov 25, 2026 01:15 UTC
    Changes Requested Reviewer

    Thanks for the PR; it's currently failing CI by causing a timeout on the platforms that this change modifies.

    There's also some issues with style/consistency, which I've flagged inline.

    Reviewers
    Assignees
    sinha20abhishek2007-debug sinha20abhishek2007-debug
    Labels
    risk: low confidence: 88.3% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 37.9% (MEDIUM) · Higher = larger blast radius
    37.9%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 88.3% · Lower = rushed or shallow review
    88.3%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 4.4% · Safe to merge
    4.4%
    Repository