kin: auto-commit after pipeline

This commit is contained in:
Gros Frumos 2026-03-21 11:39:10 +02:00
parent 977176f004
commit d7f7193ad7
4 changed files with 352 additions and 52 deletions

View file

@ -175,8 +175,8 @@ function phaseStatusColor(s: string) {
}
// Tab groups
const PRIMARY_TABS = ['tasks', 'kanban', 'phases', 'decisions'] as const
const MORE_TABS = ['modules', 'environments', 'links', 'settings'] as const
const PRIMARY_TABS = ['tasks', 'kanban', 'phases', 'decisions', 'modules', 'links'] as const
const MORE_TABS = ['environments', 'settings'] as const
function tabLabel(tab: string): string {
const labels: Record<string, string> = {
@ -308,8 +308,6 @@ async function toggleWorktrees() {
}
}
const anyModeActive = computed(() => autoMode.value || autocommit.value || autoTest.value || worktrees.value)
// Settings form
const settingsForm = ref({
execution_mode: 'review',
@ -757,6 +755,25 @@ function taskDepth(task: Task): number {
const expandedTasks = ref(new Set<string>())
// Computed: IDs of parent tasks with at least one non-done child
const autoExpandIds = computed(() => {
const ids = new Set<string>()
for (const [parentId, children] of childrenMap.value.entries()) {
if (children.some(c => c.status !== 'done')) {
ids.add(parentId)
}
}
return ids
})
// Auto-expand on first load; respect manual toggles after that
let _autoExpandInitialized = false
watch(autoExpandIds, (ids) => {
if (_autoExpandInitialized || ids.size === 0) return
expandedTasks.value = new Set(ids)
_autoExpandInitialized = true
}, { immediate: true })
function toggleExpand(taskId: string) {
const next = new Set(expandedTasks.value)
if (next.has(taskId)) next.delete(taskId)
@ -1176,21 +1193,30 @@ async function addDecision() {
class="px-1.5 py-0.5 text-xs text-gray-600 hover:text-red-400 rounded"></button>
</div>
<div class="flex gap-2">
<!-- Mode dropdown -->
<!-- Mode toggle (always visible) -->
<button
:data-mode="autoMode ? 'auto' : 'review'"
@click="toggleMode"
class="px-2 py-1 text-xs border rounded transition-colors"
:class="autoMode ? 'text-yellow-400 border-yellow-800 bg-yellow-900/20 hover:bg-yellow-900/50' : 'text-gray-400 border-gray-700 bg-gray-800/50 hover:bg-gray-800'"
:title="autoMode ? 'Auto mode: agents can write files' : 'Review mode: agents read-only'">
{{ autoMode ? '🔓 Auto' : '🔒 Review' }}
</button>
<!-- Aux settings dropdown (Autocommit, AutoTest, Worktrees) -->
<div class="relative">
<div v-if="showModeMenu" class="fixed inset-0 z-10" @click="showModeMenu = false"></div>
<div v-if="showModeMenu" class="fixed inset-0 z-[5]" @click="showModeMenu = false"></div>
<button
data-testid="mode-menu-trigger"
:data-mode="autoMode ? 'auto' : 'review'"
@click="showModeMenu = !showModeMenu"
class="px-2 py-1 text-xs border rounded relative z-20"
:class="anyModeActive ? 'text-yellow-400 border-yellow-800 bg-yellow-900/20' : 'text-gray-400 border-gray-700 bg-gray-800/50'">
Mode
class="px-2 py-1 text-xs border rounded relative z-10 transition-colors"
:class="(autocommit || autoTest || worktrees) ? 'text-yellow-400 border-yellow-800 bg-yellow-900/20' : 'text-gray-400 border-gray-700 bg-gray-800/50'">
</button>
<div v-if="showModeMenu" class="absolute right-0 top-full mt-1 z-20 w-52 bg-gray-900 border border-gray-700 rounded shadow-lg py-1">
<div v-if="showModeMenu" class="absolute right-0 top-full mt-1 z-10 w-52 bg-gray-900 border border-gray-700 rounded shadow-lg py-1">
<button
data-testid="mode-toggle-auto"
@click="toggleMode"
@click="toggleMode(); showModeMenu = false"
class="w-full text-left px-3 py-1.5 text-xs flex items-center justify-between hover:bg-gray-800"
:title="autoMode ? 'Auto mode: agents can write files' : 'Review mode: agents read-only'">
<span>{{ autoMode ? '🔓 Auto' : '🔒 Review' }}</span>