-
-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
chorePackage updates, refactoring e.g.Package updates, refactoring e.g.
Description
Description
The entity tab components in edit dialogs use two different event patterns inconsistently. This should be standardized for better maintainability.
Current State
Pattern A: @changed event (component manages everything internally)
Used by: EntityLocationsTab, EntityPlayersTab, EntityFactionsTab
- Component handles add/update/remove internally
- Emits single
@changedevent - Parent just calls
loadCounts()orrefresh*()
Pattern B: @add/@remove/@update events (parent manages logic)
Used by: NpcRelationsTab, NpcMembershipsTab, EntityItemsTab, EntityLoreTab, EntityNpcsTab
- Component emits granular events
- Parent handles API calls and state updates
- Parent calls
loadCounts()after each operation
Recommendation
Standardize on Pattern A (@changed) because:
- Better encapsulation - component is self-contained
- Less boilerplate in parent dialogs
- Easier to maintain and test
- Parent doesn't need to know internal implementation details
Affected Components
Components to refactor to Pattern A:
EntityItemsTab.vueEntityLoreTab.vueEntityNpcsTab.vueNpcRelationsTab.vueNpcMembershipsTab.vue
Implementation
For each component:
- Move API calls from parent into component
- Add internal state management
- Replace
@add/@remove/@updatewith single@changedemit - Update all parent dialogs to use
@changed
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
chorePackage updates, refactoring e.g.Package updates, refactoring e.g.