kin: KIN-075 Расширить канбан-вид до ширины экрана, сейчас он ограничен центром. + добавить кнопки Тас Аудит Автокомит Авто в канбан вид
This commit is contained in:
parent
9764d1b414
commit
394301c7a7
4 changed files with 205 additions and 6 deletions
|
|
@ -149,6 +149,7 @@ function initStatusFilter(): string[] {
|
|||
|
||||
const selectedStatuses = ref<string[]>(initStatusFilter())
|
||||
const selectedCategory = ref('')
|
||||
const taskSearch = ref('')
|
||||
|
||||
function toggleStatus(s: string) {
|
||||
const idx = selectedStatuses.value.indexOf(s)
|
||||
|
|
@ -271,6 +272,10 @@ watch(selectedStatuses, (val) => {
|
|||
router.replace({ query: { ...route.query, status: val.length ? val.join(',') : undefined } })
|
||||
}, { deep: true })
|
||||
|
||||
watch(() => props.id, () => {
|
||||
taskSearch.value = ''
|
||||
})
|
||||
|
||||
onMounted(async () => {
|
||||
await load()
|
||||
loadMode()
|
||||
|
|
@ -289,9 +294,19 @@ const taskCategories = computed(() => {
|
|||
return Array.from(cats).sort()
|
||||
})
|
||||
|
||||
const filteredTasks = computed(() => {
|
||||
const searchFilteredTasks = computed(() => {
|
||||
if (!project.value) return []
|
||||
let tasks = project.value.tasks
|
||||
const q = taskSearch.value.trim().toLowerCase()
|
||||
if (!q) return project.value.tasks
|
||||
return project.value.tasks.filter(t => {
|
||||
if (t.title.toLowerCase().includes(q)) return true
|
||||
if (t.brief && JSON.stringify(t.brief).toLowerCase().includes(q)) return true
|
||||
return false
|
||||
})
|
||||
})
|
||||
|
||||
const filteredTasks = computed(() => {
|
||||
let tasks = searchFilteredTasks.value
|
||||
if (selectedStatuses.value.length > 0) tasks = tasks.filter(t => selectedStatuses.value.includes(t.status))
|
||||
if (selectedCategory.value) tasks = tasks.filter(t => t.category === selectedCategory.value)
|
||||
return tasks
|
||||
|
|
@ -401,10 +416,9 @@ const dragOverStatus = ref<string | null>(null)
|
|||
let kanbanPollTimer: ReturnType<typeof setInterval> | null = null
|
||||
|
||||
const kanbanTasksByStatus = computed(() => {
|
||||
if (!project.value) return {} as Record<string, Task[]>
|
||||
const result: Record<string, Task[]> = {}
|
||||
for (const col of KANBAN_COLUMNS) result[col.status] = []
|
||||
for (const t of project.value.tasks) {
|
||||
for (const t of searchFilteredTasks.value) {
|
||||
if (result[t.status]) result[t.status].push(t)
|
||||
}
|
||||
return result
|
||||
|
|
@ -604,6 +618,13 @@ async function addDecision() {
|
|||
<Badge :text="cat" :color="CATEGORY_COLORS[cat] || 'gray'" />
|
||||
</button>
|
||||
</div>
|
||||
<!-- Search -->
|
||||
<div class="flex items-center gap-1">
|
||||
<input v-model="taskSearch" placeholder="Поиск по задачам..."
|
||||
class="bg-gray-800 border border-gray-700 rounded px-2 py-1 text-xs text-gray-300 placeholder-gray-600 w-56 focus:border-gray-500 outline-none" />
|
||||
<button v-if="taskSearch" @click="taskSearch = ''"
|
||||
class="text-gray-600 hover:text-red-400 text-xs px-1">✕</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Manual escalation tasks -->
|
||||
<div v-if="manualEscalationTasks.length" class="mb-4">
|
||||
|
|
@ -824,7 +845,44 @@ async function addDecision() {
|
|||
</div>
|
||||
|
||||
<!-- Kanban Tab -->
|
||||
<div v-if="activeTab === 'kanban'" class="overflow-x-auto pb-4">
|
||||
<div v-if="activeTab === 'kanban'" class="pb-4">
|
||||
<div class="flex items-center justify-between gap-2 mb-3">
|
||||
<div class="flex items-center gap-1">
|
||||
<input v-model="taskSearch" placeholder="Поиск..."
|
||||
class="bg-gray-800 border border-gray-700 rounded px-2 py-1 text-xs text-gray-300 placeholder-gray-600 w-48 focus:border-gray-500 outline-none" />
|
||||
<button v-if="taskSearch" @click="taskSearch = ''"
|
||||
class="text-gray-600 hover:text-red-400 text-xs px-1">✕</button>
|
||||
</div>
|
||||
<div class="flex gap-2">
|
||||
<button @click="toggleMode"
|
||||
class="px-2 py-1 text-xs border rounded transition-colors"
|
||||
:class="autoMode
|
||||
? 'bg-yellow-900/30 text-yellow-400 border-yellow-800 hover:bg-yellow-900/50'
|
||||
: 'bg-gray-800/50 text-gray-400 border-gray-700 hover:bg-gray-800'"
|
||||
:title="autoMode ? 'Auto mode: agents can write files' : 'Review mode: agents read-only'">
|
||||
{{ autoMode ? '🔓 Авто' : '🔒 Review' }}
|
||||
</button>
|
||||
<button @click="toggleAutocommit"
|
||||
class="px-2 py-1 text-xs border rounded transition-colors"
|
||||
:class="autocommit
|
||||
? 'bg-green-900/30 text-green-400 border-green-800 hover:bg-green-900/50'
|
||||
: 'bg-gray-800/50 text-gray-400 border-gray-700 hover:bg-gray-800'"
|
||||
:title="autocommit ? 'Autocommit: on — git commit after pipeline' : 'Autocommit: off'">
|
||||
{{ autocommit ? '✓ Автокомит' : 'Автокомит' }}
|
||||
</button>
|
||||
<button @click="runAudit" :disabled="auditLoading"
|
||||
class="px-2 py-1 text-xs bg-purple-900/30 text-purple-400 border border-purple-800 rounded hover:bg-purple-900/50 disabled:opacity-50"
|
||||
title="Check which pending tasks are already done">
|
||||
<span v-if="auditLoading" class="inline-block w-3 h-3 border-2 border-purple-400 border-t-transparent rounded-full animate-spin mr-1"></span>
|
||||
{{ auditLoading ? 'Auditing...' : 'Аудит' }}
|
||||
</button>
|
||||
<button @click="showAddTask = true"
|
||||
class="px-3 py-1 text-xs bg-gray-800 text-gray-300 border border-gray-700 rounded hover:bg-gray-700">
|
||||
+ Тас
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="overflow-x-auto">
|
||||
<div class="flex gap-3" style="min-width: max-content">
|
||||
<div v-for="col in KANBAN_COLUMNS" :key="col.status" class="w-64 flex flex-col gap-2">
|
||||
<!-- Column header -->
|
||||
|
|
@ -860,6 +918,7 @@ async function addDecision() {
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Add Task Modal -->
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue