Add D&D 5e spell description display on stat blocks #36

Open
opened 2026-04-10 17:59:56 +02:00 by dostulata · 0 comments
Owner

Summary

PF2e stat blocks already support clickable spell names that show inline descriptions (popover on desktop, bottom sheet on mobile) using data embedded in the creature JSON. D&D 5e creatures only store spell names as strings — the full spell data lives in separate 5etools source files. To show D&D spell descriptions, the user must explicitly load spell data (same legal model as bestiary source loading — the app never bundles or delivers the content).

When a user clicks a D&D spell name and the spell data is not yet cached, the popover shows a mini fetch prompt (analogous to SourceFetchPrompt for bestiary sources) where the user can confirm a pre-filled URL or upload a local file. After loading, the popover updates to show the spell description. Subsequent clicks on spells from the same source are instant. Spell sources appear in the existing Source Manager alongside bestiary sources for cache management.

Spell descriptions must respect the active rules edition setting (2014 vs 2024). The 2014 and 2024 versions of spells often differ in range, damage, duration, and some spells are renamed. The spell index and cache must support both editions, and the displayed description must match the active rules edition.

Acceptance Criteria

  • D&D spell names in stat block spellcasting sections are rendered as clickable elements (consistent with existing PF2e spell display)
  • Clicking a spell with cached data opens a popover (desktop) or bottom sheet (mobile) showing the spell description, level, school, range, duration, components, and casting time
  • Clicking a spell without cached data shows a fetch prompt inside the popover with a pre-filled URL and file upload option
  • After the user loads a spell source, the popover immediately displays the spell description without requiring a second click
  • All spells from the loaded source are cached — subsequent clicks on other spells from that source open instantly
  • Spell sources appear in the Source Manager alongside bestiary sources and can be individually cleared or bulk-cleared
  • Spell descriptions respect the active rules edition (2014 vs 2024) — switching editions shows the corresponding spell version
  • Spells that only exist in one edition (e.g., renamed between 2014 and 2024) display correctly for their respective edition
  • The app never bundles or delivers spell content — all data is user-provided via URL fetch or file upload
  • A generated spell index maps spell names to their source files for both editions (no spell content in the index — only names and source references)
## Summary PF2e stat blocks already support clickable spell names that show inline descriptions (popover on desktop, bottom sheet on mobile) using data embedded in the creature JSON. D&D 5e creatures only store spell names as strings — the full spell data lives in separate 5etools source files. To show D&D spell descriptions, the user must explicitly load spell data (same legal model as bestiary source loading — the app never bundles or delivers the content). When a user clicks a D&D spell name and the spell data is not yet cached, the popover shows a mini fetch prompt (analogous to `SourceFetchPrompt` for bestiary sources) where the user can confirm a pre-filled URL or upload a local file. After loading, the popover updates to show the spell description. Subsequent clicks on spells from the same source are instant. Spell sources appear in the existing Source Manager alongside bestiary sources for cache management. Spell descriptions must respect the active rules edition setting (2014 vs 2024). The 2014 and 2024 versions of spells often differ in range, damage, duration, and some spells are renamed. The spell index and cache must support both editions, and the displayed description must match the active rules edition. ## Acceptance Criteria - [ ] D&D spell names in stat block spellcasting sections are rendered as clickable elements (consistent with existing PF2e spell display) - [ ] Clicking a spell with cached data opens a popover (desktop) or bottom sheet (mobile) showing the spell description, level, school, range, duration, components, and casting time - [ ] Clicking a spell without cached data shows a fetch prompt inside the popover with a pre-filled URL and file upload option - [ ] After the user loads a spell source, the popover immediately displays the spell description without requiring a second click - [ ] All spells from the loaded source are cached — subsequent clicks on other spells from that source open instantly - [ ] Spell sources appear in the Source Manager alongside bestiary sources and can be individually cleared or bulk-cleared - [ ] Spell descriptions respect the active rules edition (2014 vs 2024) — switching editions shows the corresponding spell version - [ ] Spells that only exist in one edition (e.g., renamed between 2014 and 2024) display correctly for their respective edition - [ ] The app never bundles or delivers spell content — all data is user-provided via URL fetch or file upload - [ ] A generated spell index maps spell names to their source files for both editions (no spell content in the index — only names and source references)
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dostulata/initiative#36