Add settings page navigation to flow-launcher:// deep links - #4628
Draft
Garulf wants to merge 5 commits into
Draft
Add settings page navigation to flow-launcher:// deep links#4628Garulf wants to merge 5 commits into
Garulf wants to merge 5 commits into
Conversation
The singleton SettingWindowViewModel's _pageType survives across window open/close cycles because panes only set it in OnNavigatedTo. A cold-start deep link targeting the same pane as the last session made SetPageType return false, so NavigationView_SelectionChanged never navigated the frame. Reset it to null before selecting the pending item, mirroring the existing normal-open branch. Also make settings/plugins plugin id lookup case-insensitive to match InstallByIdAsync's comparison in the same file, treat whitespace-only filters and plugin ids as absent, and replace the duplicated "settings/plugins"/"settings/store" string literals with shared consts used by both the SettingsPages map and the handler switch.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Extends the
flow-launcher://settingsdeep link from #4565 so links can open a specific settings pane, jump to an installed plugin in the Plugins pane, or pre-fill the Plugin Store search.flow-launcher://settingsflow-launcher://settings/general/theme/hotkey/proxy/aboutflow-launcher://settings/pluginsflow-launcher://settings/plugins?plugin=<id>plugin/install)flow-launcher://settings/store?q=<term>flow-launcher://settings/<anything else>How
DeepLink.cs: a publicSettingsPagesmap (verb to pane type) drives the handler registrations, so the documented links, the dispatch table, and the tests share one source of truth.settings/pluginsresolves the id via loaded plugins;settings/storepassesqthrough; whitespace-only params are treated as absent.SettingWindowViewModel: one-shot pending destination (pane type + optional filter text) with consume-once accessors, so a later manual visit never re-applies a stale destination or filter.SettingWindow: the frame-loaded handler consumes the pending page instead of always selecting General (resetting the stale page type first so navigation actually fires); an already open window is navigated viaNavigateToPendingPage, which re-navigates the frame directly when the target pane is already selected so a new filter still applies.SettingsPanePlugins/SettingsPanePluginStore: consume the pending filter inOnNavigatedToand assign it to their existingFilterText.en.xamlfor the unknown-plugin notification.Tests
DeepLinkTestcovers every documented link mapping (including case-insensitivity and an unmapped subpage), plusplugin/qparameter extraction;SettingWindowViewModelTestcovers the consume-once semantics.?plugin=<installed id>filters; unknown id shows the notification and opens unfiltered?q=clipboardpre-fills the store searchflow-launcher://settings/plugins(regression check for the stale page type)flow-launcher://settingsunchangedSummary by cubic
Summary of changes
Adds navigation for
flow-launcher://settingsdeep links so links can open a specific pane, jump to an installed plugin in Plugins, or pre-fill the Plugin Store search. Previously,flow-launcher://settingsalways opened General; now subpaths select panes, Plugins supports?plugin=<id>, Store supports?q=<term>, and unknown plugin ids show a notification while still opening Plugins.SettingsPagesmap; the same map drives tests and routing.settings/plugins?plugin=<id>looks up installed plugins case-insensitively; whitespace-only parameters are ignored.OpenSettingsPageandHandleSettingsPlugins, plus a consume-once pending navigation state onSettingWindowViewModel.OnNavigatedTo.NavigateToPendingPageenables warm navigation to the target pane.SettingsPages.settings/pluginsandsettings/store.SettingsPagesmap and two short-lived fields for pending navigation on an existing singleton view model.DeepLinkTestvalidates all documented settings links and parameter parsing.SettingWindowViewModelTestverifies one-shot pending navigation and default behaviors.Release Note
You can now open specific Settings pages via links (for example, Plugins or Store) and even pre-fill plugin filters or store search directly from a
flow-launcher://settings/...link.Written for commit 72fe41d. Summary will update on new commits.