Skip to content

Comments

[pull] develop from Orcpub:develop#76

Merged
pull[bot] merged 6 commits intodatdamnzotz:developfrom
Orcpub:develop
Feb 17, 2026
Merged

[pull] develop from Orcpub:develop#76
pull[bot] merged 6 commits intodatdamnzotz:developfrom
Orcpub:develop

Conversation

@pull
Copy link

@pull pull bot commented Feb 17, 2026

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 : )

codeGlaze and others added 6 commits February 16, 2026 20:14
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.
Fixes #633, #572, #552, #276 - dropdown refresh bug, checkbox snapback, pdf custom item display
@pull pull bot locked and limited conversation to collaborators Feb 17, 2026
@pull pull bot added the ⤵️ pull label Feb 17, 2026
@pull pull bot merged commit 1925b49 into datdamnzotz:develop Feb 17, 2026
@pull pull bot added the ⤵️ pull label Feb 17, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants