Refresh abilities and adversaries dynamically in Adversary view#99
Open
deacon-mp wants to merge 1 commit into
Open
Refresh abilities and adversaries dynamically in Adversary view#99deacon-mp wants to merge 1 commit into
deacon-mp wants to merge 1 commit into
Conversation
The ability picker and adversary dropdown cached their data on initial mount, so new abilities created while editing an adversary or adversary YAML files updated on disk were not visible until a full page reload. - AbilitySelection: re-fetch abilities from API when the modal opens - AdversariesView: refresh all data on KeepAlive re-activation and refresh the adversary list when the selection dropdown opens
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Adversary view and ability picker to refresh data dynamically so newly created/modified abilities and adversaries appear without requiring a page reload, especially when returning via KeepAlive.
Changes:
- Refresh abilities/adversaries/objectives on KeepAlive re-activation in
AdversariesView.vue - Refresh adversary list when the adversary dropdown opens
- Re-fetch abilities whenever the ability picker modal opens in
AbilitySelection.vue
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/views/AdversariesView.vue | Adds KeepAlive onActivated refresh and dropdown-open refresh to keep adversary/ability/objective data current |
| src/components/abilities/AbilitySelection.vue | Re-fetches abilities on modal open so newly created abilities appear immediately |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+36
to
+40
| onActivated(async () => { | ||
| await abilityStore.getAbilities($api); | ||
| await adversaryStore.getAdversaries($api); | ||
| await objectiveStore.getObjectives($api); | ||
| }); |
Comment on lines
+45
to
+49
| watch(isAdversaryDropdownOpen, async (isOpen) => { | ||
| if (isOpen) { | ||
| await adversaryStore.getAdversaries($api); | ||
| } | ||
| }); |
Comment on lines
+49
to
+53
| watch(() => props.active, async (isActive) => { | ||
| if (isActive) { | ||
| await abilityStore.getAbilities($api); | ||
| } | ||
| }); |
Contributor
|
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.
Summary
onActivated) and refresh the adversary list when the selection dropdown opensProblem
In the Adversary view:
Test plan