[pull] develop from Orcpub:develop#76
Merged
pull[bot] merged 6 commits intodatdamnzotz:developfrom Feb 17, 2026
Merged
Conversation
The custom weapon dropdowns (Damage Die Number, Damage Die, Simple/Martial, Melee/Ranged) were immediately resetting to default values after user interaction, preventing users from selecting values. Root cause: Default values were dispatched during component render via a doseq block in views.cljs, overwriting user selections on every re-render. Fix: - Move default value initialisation from render phase to the ::mi/toggle-subtype event handler (events.cljs) so defaults are set once when "Custom" is first selected, not on every render cycle. - Remove the problematic doseq dispatch block from views.cljs. - Convert selection-adder to a Form-2 Reagent component with a local atom so the dropdown resets to the placeholder after each selection.
Extract remove-custom-weapon-fields and apply-subtype-toggle into magic_items.cljc so they can be tested from JVM tests. Simplify the reg-event-db handler in events.cljs to a one-liner delegating to the extracted function. Tests cover: - Weapon field stripping (all 17 keys removed, non-weapon keys preserved) - Custom (:other) defaults (die count, die, weapon type, melee/ranged) - :all subtype toggle - Named subtype add/remove and :other/:all cleanup
apply-subtype-toggle was writing defaults to ::mi/ keys instead of ::weapons5e/ keys, so custom weapon properties (damage die, type, melee/ranged, damage type) were silently dropped during serialization. Also fixes item-save-success to update the custom-items list in app-db so saved items appear immediately without a page reload.
Adds missing Special and Loading checkboxes to the custom weapon builder. Special was partially wired (schema + serialization) but had no UI/events/subs. Loading is new end-to-end including tagging existing weapons (crossbows, blowgun, firearms) per 5e PHB rules.
The PDF equipment fields were only looking up names from the base equipment map, causing magic items to display as raw keywords. Merge the magic items map into the lookup. Also ensure add-key populates :name so custom items resolve correctly.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )