Skip to content

feat: add NPC button to the Set Initiative screen#344

Merged
Lakeyzer merged 1 commit into
developfrom
feature/add-npc-on-initiative-screen
Jun 26, 2026
Merged

feat: add NPC button to the Set Initiative screen#344
Lakeyzer merged 1 commit into
developfrom
feature/add-npc-on-initiative-screen

Conversation

@HarmlessHarm

Copy link
Copy Markdown
Collaborator

Summary

  • Adds an Add button to the NPC pane on the Set Initiative screen (desktop header + mobile tab panel), opening the existing AddNpc drawer
  • The drawer already supports both flows: typing basic stats (Name / Initiative / AC / HP) and copying a full NPC from the SRD or custom library
  • Button is disabled in test mode with a tooltip, matching the existing behaviour of the Add button in the live tracker's Targets pane
  • The AddNpc drawer now shows a single Add button (instead of "Add next round" / "Add directly") when the encounter hasn't started yet (round === 0), since the "next round" concept doesn't apply before combat begins

Test plan

  • Open an encounter on the Set Initiative screen; confirm the Add button appears in the NPC pane header (desktop) and NPC tab (mobile)
  • Add an NPC via basic stats — confirm it appears in the NPC list and Overview immediately
  • Add an NPC via Copy NPC (SRD + custom) — confirm full stats copy in and DEX-based initiative roll works
  • Start the encounter; open Add from Targets mid-combat — confirm both "Add next round" and "Add directly" are shown
  • Open in test mode — confirm the button is greyed out, non-functional, and shows the tooltip

Allows the DM to add NPCs on the fly before combat starts, without
having to enter the live tracker first. The existing AddNpc drawer
(basic stats + copy full NPC) is reused unchanged except for collapsing
its two submit buttons into a single "Add" when round === 0 (no
"next round" concept before combat has started).

The button is disabled in test mode, matching the Targets pane.
@HarmlessHarm HarmlessHarm force-pushed the feature/add-npc-on-initiative-screen branch from 57bd252 to f5103a4 Compare June 24, 2026 21:19
@Lakeyzer Lakeyzer merged commit 2bd9e7a into develop Jun 26, 2026
4 checks passed
@Lakeyzer Lakeyzer deleted the feature/add-npc-on-initiative-screen branch June 26, 2026 12:10
@sonarqubecloud

Copy link
Copy Markdown

@HarmlessHarm HarmlessHarm added the improvement Improvement to existing feature label Jun 26, 2026
HarmlessHarm pushed a commit that referenced this pull request Jul 7, 2026
Brings in NPC groups, campaign view refactor (#341), DM screen splitter
persistence (#339), Set Initiative NPC button (#344), and monster filter
changes (#345), re-expressed in Vue 3 syntax where main's code still
used Vue 2 patterns:

- slot="x" attributes -> v-slot templates (NpcGroupManager, BasicInfo,
  Npcs, Entities dialogs)
- $set/$delete/Vue.set/Vue.delete -> direct assignment (npcGroups and
  npcs store modules, hk-filter, Entities, BasicInfo)
- vue-snotify -> Quasar notify utils (NpcGroupManager, Entities, Npcs)
- vee-validate v3 slot props -> v4 errorMessage API (BasicInfo)
- QTable :data -> :rows; () => import() -> defineAsyncComponent
- process.browser -> typeof window guard in browserDetect (app failed
  to boot server- and client-side otherwise)
- adopted main's boot/prototypes.js (server-enabled for SSR)

Additionally fixes a latent Quasar v2 event-contract gap the merge
review surfaced: 101 @input handlers and 43 :value bindings on Quasar
form components renamed to @update:model-value / :model-value (Quasar
v2 components no longer emit input or read value; the handlers were
dead and several bindings one-way only).

Verified: SPA + SSR builds pass; headless audit of 10 routes renders
with zero Vue warnings.

https://claude.ai/code/session_013pNZHMppjJ2iGVjxjHKkpQ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improvement to existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants