Skip to content

Refresh pinned commands when actions change#795

Merged
multiplex55 merged 1 commit intomasterfrom
codex/extend-cache-invalidation-logic-for-pinned-commands
Feb 4, 2026
Merged

Refresh pinned commands when actions change#795
multiplex55 merged 1 commit intomasterfrom
codex/extend-cache-invalidation-logic-for-pinned-commands

Conversation

@multiplex55
Copy link
Copy Markdown
Owner

Motivation

  • Ensure the pinned commands widget rebuilds its cache when the pinned list itself changes and when in-memory actions are updated so the dashboard always shows current items.
  • Guarantee dashboard widgets observe action updates even if saving to disk fails or is deferred by bumping the global actions version when actions are added/edited.

Description

  • Track a hash of cfg.action_ids by adding last_action_ids_hash and action_ids_hash(...), and include that hash in refresh_cache so the cache is rebuilt when the pinned list changes.
  • Call crate::actions::bump_actions_version() after app.update_action_cache() in the add/edit branches of the action dialog to surface in-memory changes to the dashboard immediately.
  • Add unit tests in src/dashboard/widgets/pinned_commands.rs that verify (1) changing cfg.action_ids forces a cache refresh and (2) bumping actions_version causes cached actions to be rebuilt, using a minimal DashboardContext and DashboardDataCache::new().

Testing

  • Ran targeted tests with cargo test for the new tests; the build started but failed due to a missing system dependency required by alsa-sys (pkg-config/alsa.pc), so the test run did not complete.
  • The new unit tests are included and should pass in an environment where the alsa development pkg (or appropriate build flags/environment) is available so the project can compile and run tests successfully.

Codex Task

@multiplex55 multiplex55 merged commit 532ca5e into master Feb 4, 2026
1 check passed
@multiplex55 multiplex55 deleted the codex/extend-cache-invalidation-logic-for-pinned-commands branch February 7, 2026 15:13
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