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

Feature: Restore tabs when Files process is closed incorrectly #14795

Merged
merged 1 commit into from
Feb 21, 2024

Conversation

yaira2
Copy link
Member

@yaira2 yaira2 commented Feb 20, 2024

Resolved / Related Issues

  • Were these changes approved in an issue or discussion with the project maintainers? In order to prevent extra work, feature requests and changes to the codebase must be approved before the pull request will be reviewed. This prevents extra work for the contributors and maintainers.
    Closes Feature: Save tabs on Windows shutdown or app crash #12624...

Validation
How did you test these changes?

  • Did you build the app and test your changes?
  • Did you check for accessibility? You can use Accessibility Insights for this.
  • Did you remove any strings from the en-us resource file?
    • Did you search the solution to see if the string is still being used?
  • Did you implement any design changes to an existing feature?
    • Was this change approved?
  • Are there any other steps that were used to validate these changes?
    1. Open multiple tabs
    2. Force close app from task manager
    3. Confirm tabs are restored during the next session

Notes*
This doesn't support multiple windows, the list of saved tabs will be from whichever window was last active.

@yaira2 yaira2 marked this pull request as ready for review February 20, 2024 21:10
@@ -39,6 +39,7 @@ public MultitaskingContext()
private void AppInstances_CollectionChanged(object? sender, NotifyCollectionChangedEventArgs e)
{
UpdateTabCount();
AppLifecycleHelper.SaveSessionTabs();
Copy link
Member

Choose a reason for hiding this comment

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

Can we delete any other code that calls SaveSessionTabs()?

Copy link
Member Author

@yaira2 yaira2 Feb 21, 2024

Choose a reason for hiding this comment

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

They might be worth keeping because AppInstances_CollectionChanged is only called when a tab is added/removed, it's fine for a single instance but it can cause issues with multiple windows. That said, if we add support for saving the tab list for multiple windows, I think we can rely on this one call.

Copy link
Member

@hishitetsu hishitetsu left a comment

Choose a reason for hiding this comment

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

LGTM

@yaira2 yaira2 merged commit ca8be96 into main Feb 21, 2024
6 checks passed
@yaira2 yaira2 added ready to merge Pull requests that are approved and ready to merge and removed needs - code review labels Feb 21, 2024
@yaira2 yaira2 deleted the ya/SaveTabsOnShutdown branch February 21, 2024 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge Pull requests that are approved and ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature: Save tabs on Windows shutdown or app crash
2 participants