Skip to content

CmdPal: Apps refactor (1/n) - Catalog - #51100

Draft
Jiří Polášek (jiripolasek) wants to merge 29 commits into
mainfrom
dev/jpolasek/f/51093-cmdpal-apps-refactor-catalog
Draft

Jiří Polášek (jiripolasek) wants to merge 29 commits into
mainfrom
dev/jpolasek/f/51093-cmdpal-apps-refactor-catalog

Conversation

@jiripolasek

@jiripolasek Jiří Polášek (jiripolasek) commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Summary of the Pull Request

Caution

BEWARE: This branch will migrate you All Apps extension settings and doesn't care about migration back.

Note

DESCRIPTION TBD: This is a toaster generated placeholder

This PR aligns the built-in Apps module with Command Palette by replacing the inherited discovery implementation with a shared application catalog and persistent cache. It improves reliability, reduces repeated work, and addresses longstanding discovery, search and visibility issues.

Startup from a valid cache is now effectively instant: applications become available before filesystem and package reconciliation begins, with substantially less discovery work on the startup path.

  • Shared application catalog and persistent cache
    • Gives All Apps, Home, pins and dock entries a consistent application inventory, with immutable snapshots containing metadata, identities, aliases and visibility.
    • Publishes validated cached applications immediately and reconciles them in the background. Uncached sources publish individually as they finish.
    • Reuses unchanged metadata, application objects and list rows, avoiding repeated shortcut parsing, manifest loading and unnecessary consumer updates.
    • Validates cached sources independently. Incomplete scans preserve affected entries without treating unconfirmed data as freshly validated.
  • Reliable discovery and refresh
    • Reconciles source-setting changes immediately, retaining unchanged sources and retiring their watchers when no longer needed.
    • Handles filesystem changes through debounced updates, bounded retries, watcher recovery and periodic background reconciliation.
    • Keeps readable applications available when individual files, folders or packages cannot be read; confirmed deletions still take effect.
    • Lets foreground refreshes interrupt background discovery at cancellation checkpoints. Manual Refresh waits for its own work instead of subsequent background activity.
    • Isolates notification-handler failures so they cannot abort startup, prevent later subscribers from updating, or turn a completed hide operation into an error.
  • Broader discovery and more accurate deduplication
    • Adds configurable shortcut folders and portable-app folders, alongside Start Menu, Desktop, packaged apps, Registry App Paths and PATH sources.
    • Merges equivalent shortcuts, executables, execution aliases and packaged representations while preserving meaningful arguments and working directories.
    • Retains alternate names and source provenance for search, exclusions and command compatibility.
    • Recognizes browser-hosted web apps, deduplicates equivalent Edge PWA registrations, and excludes automatic Startup-folder discovery.
  • Consistent search and browsing
    • Shares application matching between All Apps and Home, including executable filenames, registry command names, package metadata and execution aliases.
    • Adds configurable exact executable-name priority. The default requires an extension, allowing cmd.exe to rank Command Prompt ahead of unrelated fuzzy matches.
    • Finds packaged execution aliases such as wt and prefers the application selected as their owner in Windows.
    • Limits incidental matches from shared directory names while retaining explicit path searches.
    • Adds All, Win32, Packaged, Web apps and Hidden filters, deterministic ordering, and settings changes that rerank searches without rebuilding commands.
  • Visibility controls
    • Adds persistent Hide/Unhide actions and case-insensitive wildcard exclusions by application name or path.
    • Separates manually hidden applications from pattern exclusions in the Hidden view, with optional uninstaller and non-application filtering.
    • Keeps explicitly pinned hidden applications available through Home, dock references and command links.
  • Stable identities and saved references
    • Derives command identities from launch information instead of presentation text, preserving identity through localization and shortcut renames.
    • Retains released command IDs and supported install-move redirects through durable aliases; ambiguous references remain blocked.
    • Preserves legacy usage for Home ranking without rewriting stored history.
    • Separates disposable catalog data, durable aliases, hidden state and user preferences into independently managed files.
  • Theme-independent packaged artwork
    • Caches logical package resources rather than theme-selected image paths, so theme changes no longer invalidate the application catalog.
    • Resolves artwork for the requesting surface’s size, theme and high-contrast context at rendering time.
    • Carries rendering context through icon preparation and cache keys, including high-contrast handling for themed SVG and generated icons.
  • Maintenance and diagnostics
    • Replaces the legacy Win32/UWP discovery helpers with focused readers, metadata and catalog payloads.
    • Separates publication, identity, visibility and persistence responsibilities, and removes unused legacy helpers.
    • Adds opt-in diagnostics for startup, source scans, metadata reuse, publication, consumer projection and cache persistence.

Pictures? Just a taste...

image image

PR Checklist

  • Communication: I've discussed this with core contributors already. If the 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

Validation Steps Performed

- Subscribes before command loading and coalesces notifications until publication completes.
- Re-resolves pins and dock bands after replaying provider changes.
- Retains in-flight loads through timeouts and discards state for removed or disposed providers.
- Checks current provider enablement before publication and cleans up discarded reload results.
- Captures surface theme, contrast qualifiers and system colors in one immutable render context before icon work is queued.
- Shares contrast modes across icon consumers and refreshes realized icons when Windows contrast settings change.
- Keys bitmap caches by each processor's normalized context while sharing context-independent artwork.
- Applies the captured contrast palette to themed SVG and generated icons while retaining literal artwork and swatch colors.
- Requires explicit render contexts throughout icon preparation and fallback loading.
- Defines canonical app payloads, source provenance and visibility contracts.
- Validates persistent caches independently for each discovery source.
- Coalesces refresh requests and merges completed sources into the current publication.
- Preserves newer data across late cache loads, failed sources and source replacements.
- Normalizes source identity hashing while retaining existing discovery consumers.
- Uses one catalog and materialized row source for All Apps, Home, pins and dock commands.
- Replaces provider-owned discovery with independently cached packaged and Win32 sources.
- Preserves cached startup, source enablement and visibility updates across consumer lifecycles.
- Handles transient package metadata failures conservatively and refreshes when update-target or framework metadata is unavailable.
- Configures Start Menu, Desktop, registry, PATH and custom-folder discovery profiles.
- Uses immutable source-profile properties for custom application folders.
- Watches relevant directory trees and applies path changes incrementally.
- Coalesces filesystem events, retains source provenance and falls back to complete scans when incremental coverage is insufficient.
- Merges packaged, execution-alias, registry and shortcut representations under canonical app identities.
- Captures immutable shortcut metadata and retains source command IDs through deduplication.
- Preserves distinct arguments and working-directory profiles while normalizing default launch directories.
- Retains original shortcut activation and recognizes installer launchers without depending on display names.
- Shares stable catalog projections across All Apps and Home search.
- Adds type and hidden-app filters with distinct icons and separators.
- Persists manual visibility and exposes initial indexing and explicit refresh status.
- Keeps background reconciliation quiet and preserves results while replacement scoring runs.
- Reuses unchanged rows and notifies consumers when visible command resolution changes.
- Preserves hidden state across coalesced identities and clears contributing identities when unhiding.
- Adds an option to hide uninstaller entries from app discovery results.
- Applies case-insensitive wildcard exclusion patterns to application names and paths.
- Presents pattern-excluded apps separately from manually hidden apps.
- Reprojects visibility when settings change while retaining explicit hidden state and source metadata.
- Uses precomputed title, description and metadata targets across both pages, including pins and aliases.
- Excludes shared directory names from ordinary queries.
- Prioritizes exact executable names for plain launches while preserving exact title and alias precedence.
- Breaks ranking ties deterministically across sequential and parallel scoring.
- Uses typed command IDs independent of display names and language.
- Retains released name-based references and shortcut launch identities across install moves.
- Resolves equivalent packaged-ID casing while protecting current canonical IDs.
- Keeps hidden apps available through Home pins, dock items and command links.
- Uses canonical IDs for hidden-pin scoring, history and recents.
- Prefers visible alias claimants while preserving saved ambiguity markers.
- Reloads saved commands when hidden rows or alias resolution change.
- Stops generating synthetic identities from unreleased builds.
- Stores durable aliases in apps.aliases.json and migrates settings only after saving the separate file.
- Keeps alias updates from rewriting user preferences and retains ambiguity markers.
- Retries transient alias-file read failures before giving up.
- Protects existing aliases when their content cannot be loaded.
- Publishes usable cached rows before source initialization.
- Tracks startup completion through the first publication of each source ID, including replacements and shutdown.
- Isolates catalog and visibility listeners so failures do not block scans, later notifications or persistence.
- Adds filename-and-stem, filename-only and disabled priority modes for All Apps and Home.
- Persists an explicit Default choice with a current filename-only policy.
- Preserves explicit selections when the default policy changes.
- Captures search policy in snapshots so setting changes rerank queries without replacing rows or commands.
- Requires prepared app search state and avoids catalog reads for global fallback scoring.
- Matches executable names with an indexed loop to avoid per-app predicate allocations.
- Retains App Paths command filenames and stems as scan-local metadata alongside resolved targets.
- Indexes packaged executable filenames and stems without their containing folders.
- Merges supplemental terms into preferred representations without changing launch identity or source priority.
- Keeps shared packaged launcher names in ordinary metadata instead of exact executable-name priority.
- Preserves compatibility with cached packaged metadata that has no executable name.
- Reads application-scoped execution aliases from package manifests and keeps every claimant searchable.
- Ranks the Windows-selected alias owner consistently on All Apps and Home.
- Publishes immutable ownership maps from a primed background cache with debounced WindowsApps watching.
- Bounds fallback refreshes and recovers from missing directories and worker failures.
- Reranks existing rows on ownership changes without rebuilding commands or accessing the filesystem during scoring.
- Re-arms failed watchers and retries unreadable candidates with bounded backoff.
- Reconciles sources in the background while prioritizing foreground refreshes and reusing unchanged metadata.
- Retains unreadable representations while applying confirmed deletions and shortcut retargeting.
- Keeps cache validation tied to complete scans and preserves previous entries across incomplete source-key changes.
- Normalizes PATH entries and retains offline apps without rapid network retries.
- Uses full scans for PATH and registry recovery and clears retries according to the actual scan scope.
- Prevents Shell shortcut resolution from searching nearby folders and volumes while preserving link tracking.
- Reuses unchanged rejected and excluded Win32 candidates and detects targets that reappear.
- Retains bounded dirty-path hints through full refreshes and re-reads explicitly retried or changed candidates.
- Preserves pending retry deadlines and reschedules consumed retries within the existing attempt budget.
- Reuses known missing-manifest scans without validating incomplete package cache entries.
- Retrieves each Windows package identity once while capturing its metadata.
- Publishes each completed source immediately and saves catalog cache data once per batch.
- Isolates publication failures from source read failures and continues publishing other sources.
- Completes explicit refresh requests independently of subsequent recovery and supports background publication waits.
- Adds opt-in source timings for setup, reads, publication, cache persistence and loading completion.
- Separates snapshot projection and refresh-request coalescing from catalog lifecycle coordination.
- Splits program enumeration from metadata reading with short-lived Shell handles.
- Captures immutable Win32 metadata and prefers Shell display names while retaining source names for released IDs.
- Uses native TargetPath and IconLocation fields and translates them into AppItem presentation metadata.
- Preserves launch profiles and case-sensitive URLs during identity and search projection.
…reader

- Captures package and application metadata without retaining live package objects.
- Reads manifest applications independently and determines elevation per application.
- Handles supported manifest namespace variants and validates native call results.
- Uses PackagedAppPayload for cached manifest data and translates source fields into AppItem presentation metadata.
- Removes legacy UWP discovery while retaining failure coverage for incomplete package scans.
- Associates unambiguous package-local executable paths with packaged identities without opening files or depending on PATH discovery.
…aches

- Retains logical manifest logo references and package identity instead of caching theme-selected artwork paths.
- Resolves packaged artwork for the requesting surface's theme, contrast and size through an Apps-owned icon protocol.
- Reuses thread-safe PRI managers with per-request qualifier contexts and preserves resource-package, language, size and alternate-form fallbacks.
- Adapts packaged icon requests in the host and includes relevant theme and contrast qualifiers in bitmap cache keys.
- Avoids catalog rescans and cache invalidation on theme changes while allowing transient resource failures to recover.
- Represents high-contrast artwork with a boolean and reports unexpected resource failures once per package.
- Stores command aliases and hidden identities independently of user preferences.
- Keeps alias reconciliation and exclusion rules in catalog publication using one coherent snapshot.
- Uses source-generated JSON metadata, atomic data-file replacement and bounded read retries.
- Preserves unreadable files and rejects visibility edits that cannot be persisted safely.
- Gives the catalog ownership of alias writer flushing and removes branch-only settings migration.
- Orders events, constants, fields, properties, constructors, methods and nested types consistently.
- Expands expression-bodied methods and local functions into block bodies.
- Identifies equivalent hosted Edge PWAs through matching publishers, runtime, parameters and full profile context.
- Captures launch metadata with the existing manifest reader and retains it in the catalog cache.
- Preserves contributing command IDs, provenance and hidden state when the preferred package disappears.
- Selects activation, artwork and uninstall actions from one deterministic preferred payload.
- Keeps different browser runtimes, profiles, data directories and URL contexts separate.
- Uses deferred Shell icon requests for every Win32 app row.
- Preserves direct packaged icon sources and existing fallback and hero-icon behavior.
- Removes the unused constructor flag and updates all callers.
- Removes the unused pin-state event arguments.
- Removes obsolete pin and copy icons and the pin-toggle key chord.
- Stops requesting unused Shell image factory and GDI extraction APIs from CsWin32.
- Removes the obsolete DeleteObjectSafeHandle analyzer suppression.
- Adds a Web apps filter with a globe icon while reusing existing rows and hidden-app visibility.
- Includes recognized Chromium PWA shortcuts and Firefox taskbar-tab shortcuts without changing activation or command identities.
- Classifies packaged PWA hosts independently of Edge's strict deduplication format.
- Retains packaged web-app classification in the catalog cache without additional scans when switching filters.
- Groups pages, list projections, commands and persistence in matching namespaces.
- Separates Win32 and packaged integration from shared utilities.
- Places catalog cache, payload and source contracts beside their implementations.
- Updates host consumers and qualified references for the new namespaces.
@github-actions github-actions Bot added the Product-Command Palette Refers to the Command Palette utility label Oct 7, 2026
@michaeljolley

Copy link
Copy Markdown
Contributor

Not a fan of the filters. Most users don't think in terms of Win32, packaged, etc.

Hidden makes sense.

@jiripolasek

Copy link
Copy Markdown
Collaborator Author

Not a fan of the filters. Most users don't think in terms of Win32, packaged, etc.

Hidden makes sense.

Not going to disagree. 4/n:

image

@michaeljolley

Copy link
Copy Markdown
Contributor

That's sick! Love it.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment