Fix missing dice/damage fields on roll dialog for copied spells - #353
Merged
Conversation
…mage fields Traces the bug to action_options() in hk-action-roll-form.vue using `this.options || [""]`, which treats an empty options array (truthy in JS) the same as a populated one instead of falling back, so the damage-type/dice q-tab-panel loop renders zero panels whenever a copied spell's top-level options array is [].
action_options() used `this.options || [""]`, which treats an empty options array as populated since empty arrays are truthy in JS. The compendium API returns options: [] for spells without versatile options, so copying any such spell produced zero q-tab-panels and hid the damage type, dice count/type, fixed value and primary fields for every action and roll on the copy.
The staging workflow only triggered pull_request builds against develop, so hotfix/* PRs targeting main (per our Git Flow) never got a staging build to validate against. Add main as a pull_request base and gate the job so it only runs for main-targeted PRs when the head branch is hotfix/*, leaving other PR bases and plain pushes to main untouched.
|
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
New roll/Edit roll) not showing the Damage type, Dice count, Dice type, Fixed value and Primary fields when a custom spell is created via Copy existing Spell — for new actions, new rolls, and rolls that came with the copied spell.action_options()inhk-action-roll-form.vueusedthis.options || [""]. An empty array is truthy in JS, so when a spell'soptionsfield is[](which the compendium API returns for spells that don't use the versatile-options feature), the fallback never kicked in and theq-tab-panelloop holding those fields rendered zero panels..planning/spell-copied-rolls-no-dice.mddocumenting the root cause analysis.Changes
src/components/hk-components/hk-action-rolls/hk-action-roll-form.vue: fall back to[""]whenoptionsis empty, not just when it's falsy..planning/spell-copied-rolls-no-dice.md: investigation report.Since
hk-action-roll-form.vueis shared with NPC actions, this also resolves the same latent issue there.Test plan
Generated by Claude Code