mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 02:36:19 +02:00
## Summary of the Pull Request This PR ensures that the list of recent searches in the Web Search extension is updated immediately after a new item is added or when settings controlling the number of items are changed. - Refactors the Web Search extension history to keep it in memory after being loaded at startup - Adds an event to notify subscribers when the history changes - Implements `IDisposable` to ensure that `WebSearchListPage` unsubscribes from the event - Moves responsibility for creating all list items to single class (`WebSearchListPage`) - Updated unit tests - ## PR Checklist - [x] Closes: #40548 - [ ] **Communication:** I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected - [x] **Tests:** Added/updated and all pass - [x] **Localization:** All end-user-facing strings can be localized - [x] **Dev docs:** nothing - [x] **New binaries:** none - [x] **Documentation updated:** nope <!-- Provide a more detailed description of the PR, other things fixed, or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed
23 lines
614 B
C#
23 lines
614 B
C#
// Copyright (c) Microsoft Corporation
|
|
// The Microsoft Corporation licenses this file to you under the MIT license.
|
|
// See the LICENSE file in the project root for more information.
|
|
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using Microsoft.CommandPalette.Extensions.Toolkit;
|
|
|
|
namespace Microsoft.CmdPal.Ext.WebSearch.Helpers;
|
|
|
|
public interface ISettingsInterface
|
|
{
|
|
event EventHandler? HistoryChanged;
|
|
|
|
public bool GlobalIfURI { get; }
|
|
|
|
public int HistoryItemCount { get; }
|
|
|
|
public IReadOnlyList<HistoryItem> HistoryItems { get; }
|
|
|
|
public void AddHistoryItem(HistoryItem historyItem);
|
|
}
|