Skip to content

Add NPC groups feature#330

Merged
HarmlessHarm merged 14 commits intodevelopfrom
feature/npc-groups
Mar 21, 2026
Merged

Add NPC groups feature#330
HarmlessHarm merged 14 commits intodevelopfrom
feature/npc-groups

Conversation

@HarmlessHarm
Copy link
Copy Markdown
Collaborator

Summary

  • Add NPC groups for organizing NPCs into custom categories with full CRUD management
  • Support group assignment in the NPC editor and group filtering in the NPC list
  • Add campaign-based groups that auto-populate from user campaigns
  • Filter encounter entity picker by campaign group
  • Exclude groups from NPC export/import to avoid cross-account issues

Changes

  • New NpcGroupManager component for creating, editing, and deleting groups
  • New Firebase service (npc_groups.js) and Vuex store module (npcGroups.js)
  • Group multi-select in NPC editor, group chips in NPC table
  • Campaign-only NPC filter toggle in encounter entity picker
  • Shared campaignGroupKey() utility function

- Add NPC groups Firebase service and Vuex store module
- Add group CRUD management dialog (NpcGroupManager)
- Add group assignment in NPC editor via multi-select
- Display group membership as chips in NPC table
- Add group filter dropdown to NPC list
- Cascade group cleanup when deleting a group
- Sync groups field to search_npcs for client-side filtering
Groups are user-specific and should not be transferred between accounts.
Strip groups during export to keep JSON clean, and during import to
avoid AJV schema validation errors.
…ey helper

Add toggle to filter custom NPCs by campaign in the encounter entity picker.
Extract shared campaignGroupKey() utility to replace hardcoded 'campaign__'
prefix across 4 files. Fix router-link using wrong key property (col.key →
props.key).
@HarmlessHarm HarmlessHarm added feature New feature or request quality of Life and removed feature New feature or request labels Mar 4, 2026
- Add aria-labels to icon-only anchors in NpcGroupManager
- Rename npcGroupServices to PascalCase (NpcGroupServices)
- Remove redundant try/catch blocks that only rethrow
- Replace nested ternary with if/return in visibleColumns
@HarmlessHarm
Copy link
Copy Markdown
Collaborator Author

#329

On card_width < 600 the Groups/Export/Generate/Import buttons are replaced
by a single ellipsis button with a q-popup-proxy dropdown, positioned after
the New NPC button via a new actions-after slot in ContentHeader.
Also render the New NPC router-link as a button element for consistent sizing.
Replaces inline campaign toggle and group select with a Filter button
matching the SRD pattern. Extends hk-filter with a type="npc" branch
(groups, types, CR range) and applies filters client-side in filteredCustomNpcs.
Slider now uses 34 positions mapping to actual CR values so the first
ticks display 0, 1/8, 1/4, 1/2 before hitting 1. Labels and stored
filter values both reflect the correct CR numbers.
…hips

- Languages, Environment, and Groups each on their own row
- Environment and Groups side-by-side on sm+ screens
- Add bottom-slots to unvalidated fields for consistent spacing
- Fix Groups chips showing [object Object] with emit-value + map-options
- Use some() instead of every() in Entities.vue group filter (OR semantics, consistent with Npcs.vue)
- Use campaignGroupKey() helper in BasicInfo.vue instead of hardcoded campaign__ prefix
@HarmlessHarm
Copy link
Copy Markdown
Collaborator Author

Review Comments:

  • Group Multiselect in NPC list needs styling ([campaign] Campaign Name) is not nice
  • Separate groups card in NPC edit has to go

@HarmlessHarm HarmlessHarm added feature New feature or request and removed quality of Life labels Mar 21, 2026
- Remove duplicate Groups card from EditNpc (already in BasicInfo)
- Replace [Campaign] text prefix with a neutral-4 pill badge in dropdown options
- Campaign group chips use dark prop to distinguish when selected
- NPC list table chips also reflect campaign groups distinctly
- Environment select uses non-dense chips via selected-item slot
@sonarqubecloud
Copy link
Copy Markdown

@HarmlessHarm HarmlessHarm merged commit df28225 into develop Mar 21, 2026
3 checks passed
@HarmlessHarm HarmlessHarm deleted the feature/npc-groups branch March 21, 2026 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant