Skip to content
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

[OOBE] Fix release notes error InfoBars #37804

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

davidegiacometti
Copy link
Collaborator

@davidegiacometti davidegiacometti commented Mar 6, 2025

Summary of the Pull Request

The InfoBars that should be displayed when release notes fail to fetch are never shown because they are closed.
Changes in the PR properly set IsOpen and TabStop for both InfoBars instead of Visibility.
Also add a retry button.

PR Checklist

  • Closes: #xxx
  • 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
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Screenshot 2025-03-08 124326

Animation

Validation Steps Performed

Manually tested:

  • Verify that the What's New is still working as expected
  • Altered the code to throw the required Exception and verified that both InfoBars are displayed
  • Tested InfoBar tab navigation + narrator

@yeelam-gordon yeelam-gordon requested a review from Copilot March 7, 2025 00:58

Choose a reason for hiding this comment

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

PR Overview

This PR fixes the issue where release notes error InfoBars were not being displayed by replacing direct Visibility changes with the setting of IsOpen and IsTabStop properties via a new helper method.

  • Introduces the SetInfoBar method to update InfoBar visibility and focus behavior.
  • Removes an unused using directive for System.Text.Json.Serialization.

Reviewed Changes

File Description
src/settings-ui/Settings.UI/SettingsXAML/OOBE/Views/OobeWhatsNew.xaml.cs Replaces direct Visibility adjustments with a method call to SetInfoBar for consistent InfoBar behavior.

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

Comments suppressed due to low confidence (1)

src/settings-ui/Settings.UI/SettingsXAML/OOBE/Views/OobeWhatsNew.xaml.cs:250

  • [nitpick] Consider renaming the parameter 'open' to 'isOpen' to more clearly indicate that it represents a boolean state.
private void SetInfoBar(InfoBar infoBar, bool open)
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 feel the message should be updated with more wordings like: "Please click on the release notes above or revisit this page to retry."

There is a minor comments by Copilot as well, which I agree
i.e. the parameter open to "isOpen".

@davidegiacometti
Copy link
Collaborator Author

davidegiacometti commented Mar 7, 2025

I'll update the PR with the required changes. I think a retry button in the info bar will be nice instead of suggest to reopen.

@davidegiacometti davidegiacometti requested a review from Copilot March 8, 2025 11:57

Choose a reason for hiding this comment

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

PR Overview

This PR fixes the issue where release notes error InfoBars were not appearing by updating the InfoBar handling to use IsOpen properties and adding a retry button for reloading release notes.

  • Updated InfoBar visibility logic to use IsOpen for proper error display
  • Introduced a _loadingReleaseNotes flag to prevent concurrent reloads
  • Added an event handler for a retry button to reload release notes

Reviewed Changes

File Description
src/settings-ui/Settings.UI/SettingsXAML/OOBE/Views/OobeWhatsNew.xaml.cs Updated InfoBar handling, introduced a reload guard flag, and added a retry button event handler

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

Comments suppressed due to low confidence (2)

src/settings-ui/Settings.UI/SettingsXAML/OOBE/Views/OobeWhatsNew.xaml.cs:130

  • Consider providing logging or user feedback when a release notes reload is already in progress to help diagnose cases when multiple retry attempts occur.
if (_loadingReleaseNotes) { return; }

src/settings-ui/Settings.UI/SettingsXAML/OOBE/Views/OobeWhatsNew.xaml.cs:260

  • Consider adding automated tests to verify the behavior of the new LoadReleaseNotes_Click handler, particularly ensuring that the _loadingReleaseNotes flag prevents concurrent reloads.
private async void LoadReleaseNotes_Click(object sender, Microsoft.UI.Xaml.RoutedEventArgs e)
@davidegiacometti
Copy link
Collaborator Author

@yeelam-gordon I decided to keep the existing message and introduced a retry button (see first message). The new button, along with the release notes hyperlink immediately above should be quite explanatory. WDYT?

@davidegiacometti
Copy link
Collaborator Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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.

4 participants