Skip to content

feat(update check): Adds optional Windows Update popup menu#763

Closed
CodeRedPaul wants to merge 1 commit intoamnweb:mainfrom
CodeRedPaul:Update_Windows_PopupMenu
Closed

feat(update check): Adds optional Windows Update popup menu#763
CodeRedPaul wants to merge 1 commit intoamnweb:mainfrom
CodeRedPaul:Update_Windows_PopupMenu

Conversation

@CodeRedPaul
Copy link
Copy Markdown

@CodeRedPaul CodeRedPaul commented Mar 3, 2026

Summary

Introduces show_popup_menu and popup_menu_padding configuration options for the Update Check - Windows Update source. This allows users to enable a popup menu on left-click instead of directly opening Windows Update settings.

The popup menu offers two choices:

  • Open Windows Update in Settings.
  • Directly update Windows Defender Virus' security intelligence, which prompts for UAC elevation.

Includes dedicated styling for the new popup menu and its items.

Features Implemented

  1. Adds a new optional parameter to the WindowsUpdateConfig for the Update Check widget.
    1. All changes are backwards compatible with existing config
    2. The popup needs to be explicitly turned on via config in the user's config.yaml
    3. Allows for overall padding of the popup to be altered via config in the user's config.yaml
    4. Allows more complex styling via css
    5. Implements a UAC elevation prompt as required

Changes

  • Updated the validation config to support the two new options parameters
  • Updated the widget to:
    • Import the new config parameters
    • Set up a popup widget to display the 2 menu items
    • Optionally show the popup on left-click if enabled
    • Launch either of the commands if selected
    • Pass through the overall popup menu padding from the config to the controls
    • Include some hard coded visual elements (such as blur, animation etc.)
    • Added some basic logging
  • Added some default CSS to styles.css
  • Updated the wiki documentation:
    • Added the 2 new optional parameters to the 'Windows Update Options' section
    • Added the new styles to the 'Available Styles' section
    • Expanded the 'Example' css section with populated css styles

Usage Example

widgets:
  update:
    type: "yasb.update_check.UpdateCheckWidget"
    options:
      windows_update:
        enabled: true
        show_popup_menu: true
        popup_menu_padding: 15

In Action

image image image image image

Showing more details on the UAC prompt will indicate what the command will run:
image

Related Issues

Only indirectly related, but I note that this feature will need some minor amendments should PR #744 be approved as it consumes the Popup widget and will need to meet the new standard.

Rationale

I got very confused with this widget when I first started to use YASB. The left-click opens Windows Update but I could get 4 or 5 notifications throughout the day indicating my virus definitions needed updating. Looking at Windows Update it reported no updates available.

Originally I was left scratching my head trying to work out how to remove these 'rogue' notifications that wouldn't go away unless I clicked through multiple items to manually update Windows Defender's security intelligence. I even created a shortcut I could run from my desktop to alleviate the burden, and then I decided to try incorporating it into the widget itself.

I now know what happens under the covers. I'd already started this contribution before I fully realized the relationship between Windows Defender and Windows Update, but I figured I would continue for 2 main reasons:

  1. I've never coded in Python and I've already an idea for another new widget, so I wanted to prove to myself I could not only learn some Python but also start to understand the inner workings of YASB and contribute something that would meet code quality standards.
  2. I figured there was still some value in the idea, as Windows Update occurs infrequently and the updates for Windows Defender can occur multiple times in a day. I think it minimizes the distraction of opening, running and closing Windows Update.

Acknowledgements and Thanks

I would like to acknowledge the vast amount that I leant on the work of SavedByGrace251 in his PR #521. I reused a lot of his work and would not have been able to produce this contribution without retrofitting his hard work into this widget. Thank you.

Caveats and Feedback

This is my first time working on YASB, my first time working with Python and my first time contributing to an open source project. Any mistakes or omissions are of course entirely my own.

Please do provide feedback and constructive criticism where due. I can't do it right in the future if I don't know what I'm doing wrong now. That includes the whole idea of this feature. I won't mind at all should this not be accepted. I really just did it to prove that I could but I hope others might see and extract some value from it.

Introduces `show_popup_menu` and `popup_menu_padding` configuration options for the Windows Update source. This allows users to enable a popup menu on left-click instead of directly opening Windows Update settings.

The popup menu offers two choices:
- Open Windows Update in Settings.
- Directly update Windows Defender virus security intelligence, which prompts for UAC elevation.

Includes dedicated styling for the new popup menu and its items.
@CodeRedPaul CodeRedPaul marked this pull request as ready for review March 3, 2026 17:55
@amnweb
Copy link
Copy Markdown
Owner

amnweb commented Mar 11, 2026

To be honest, this is not needed. I mean, if we cannot have a consistent UI for all of this where we have Scoop, Winget and Windows Update, I'm not thinking about merging this. You can simply ignore these updates by adding exclude: ["Security Intelligence Update"] and you will not see Defender updates anymore.

@CodeRedPaul
Copy link
Copy Markdown
Author

To be honest, this is not needed. I mean, if we cannot have a consistent UI for all of this where we have Scoop, Winget and Windows Update, I'm not thinking about merging this. You can simply ignore these updates by adding exclude: ["Security Intelligence Update"] and you will not see Defender updates anymore.

That's totally fine and I respect your decision. As I said, I mainly did to prove that I could.

Also TBH, the exclusion option was documented but the way it was worded made me think it needed an exact match.

Peace. ✌️

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.

2 participants