Skip to content

Cache action filter metadata and reuse it in launcher filtering#931

Merged
multiplex55 merged 5 commits intomasterfrom
codex/refactor-action_kind_candidates-allocation
Mar 14, 2026
Merged

Cache action filter metadata and reuse it in launcher filtering#931
multiplex55 merged 5 commits intomasterfrom
codex/refactor-action_kind_candidates-allocation

Conversation

@multiplex55
Copy link
Copy Markdown
Owner

Motivation

  • Reduce per-call allocations and repeated normalization when filtering actions by precomputing and reusing normalized id/kind candidates for each action.
  • Make action-kind/id filtering cheaper during search and plugin result post-processing by storing metadata alongside actions.

Description

  • Add ActionFilterMetadata and ActionWithMetadata to src/common/query.rs to hold a precomputed normalized_id and normalized_kind_candidates and provide constructors from_action/from_action wrappers.
  • Change apply_action_filters to funnel through a new apply_action_filters_with_metadata which consumes metadata-aware entries and updates filtering to call action_matches_filters(metadata, filters) that uses precomputed values instead of rebuilding candidates.
  • Wire a per-action action_filter_metadata: Vec<ActionFilterMetadata> into LauncherApp in src/gui/mod.rs, populate it inside update_action_cache and initialize it in new, and short-circuit search_actions to evaluate kind:/id: filters against the cached metadata before performing label/desc fuzzy or exact matching.
  • Remove the old per-call action_kind_candidates rebuild and route callers to the metadata-based checks instead.

Testing

  • Ran cargo fmt and cargo fmt --check, both completed successfully.
  • Started cargo check which progressed through dependency compilation during validation but was left running in CI-like environment (no final failure observed during edit/formatting cycle).
  • Attempts to run cargo test were initiated but aborted due to long build times in the interactive environment, so no full test-suite run was completed here.

Codex Task

@multiplex55 multiplex55 merged commit 4f16b48 into master Mar 14, 2026
1 check passed
@multiplex55 multiplex55 deleted the codex/refactor-action_kind_candidates-allocation branch March 25, 2026 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant