Extract StatusManager, dedupe ColumnChange type, add useDialog composable
- Pull the status-management feature (drag reorder, add, delete with reassignment) out of ProjectConfigureView into its own StatusManager component. It fetches its own status list independently, so the view is left with just page chrome and the rename form (316 -> 106 lines). - Define ColumnChange once in lib/cardOrder.ts instead of duplicating the same type in AppSidebar.vue and ProjectView.vue. - Add composables/useDialog.ts for the Escape-to-close + focus-on-open behaviour shared by every confirm/reassign modal (and, without a focus target, plain dropdown menus). Used by ProjectManageMenu's delete-confirmation modal + its own menu, and StatusManager's reassignment modal.
This commit is contained in:
@@ -6,7 +6,7 @@ import CardRow from '../components/CardRow.vue'
|
||||
import KanbanCard from '../components/KanbanCard.vue'
|
||||
import ProjectManageMenu from '../components/ProjectManageMenu.vue'
|
||||
import { ApiError, apiRequest } from '../lib/api'
|
||||
import { reorderColumn } from '../lib/cardOrder'
|
||||
import { reorderColumn, type ColumnChange } from '../lib/cardOrder'
|
||||
import { useCardsStore } from '../stores/cards'
|
||||
import { useInboxStore } from '../stores/inbox'
|
||||
import type { Card, CardStatus, Project } from '../types'
|
||||
@@ -51,11 +51,6 @@ interface Column {
|
||||
statusId: number
|
||||
cards: Card[]
|
||||
}
|
||||
type ColumnChange = {
|
||||
added?: { element: Card; newIndex: number }
|
||||
removed?: { element: Card; oldIndex: number }
|
||||
moved?: { element: Card; oldIndex: number; newIndex: number }
|
||||
}
|
||||
|
||||
const board = ref<Column[]>([])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user