kin: auto-commit after pipeline

This commit is contained in:
Gros Frumos 2026-03-21 12:17:25 +02:00
parent f1935d2af2
commit d42ee4246d
3 changed files with 113 additions and 138 deletions

View file

@ -175,8 +175,8 @@ function phaseStatusColor(s: string) {
}
// Tab groups
const PRIMARY_TABS = ['tasks', 'kanban', 'phases', 'decisions', 'modules', 'links'] as const
const MORE_TABS = ['environments', 'settings'] as const
const PRIMARY_TABS = ['tasks', 'kanban', 'decisions'] as const
const MORE_TABS = ['phases', 'modules', 'environments', 'links', 'settings'] as const
function tabLabel(tab: string): string {
const labels: Record<string, string> = {
@ -1193,16 +1193,7 @@ 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 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) -->
<!-- Mode dropdown (Auto, Autocommit, AutoTest, Worktrees) -->
<div class="relative">
<div v-if="showModeMenu" class="fixed inset-0 z-[5]" @click="showModeMenu = false"></div>
<button
@ -1210,8 +1201,8 @@ async function addDecision() {
:data-mode="autoMode ? 'auto' : 'review'"
@click="showModeMenu = !showModeMenu"
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'">
:class="(autoMode || autocommit || autoTest || worktrees) ? 'text-yellow-400 border-yellow-800 bg-yellow-900/20' : 'text-gray-400 border-gray-700 bg-gray-800/50'">
Mode
</button>
<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
@ -1558,38 +1549,52 @@ async function addDecision() {
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 ? '&#x1F513; Авто' : '&#x1F512; 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 ? '&#x2713; Автокомит' : 'Автокомит' }}
</button>
<button @click="toggleAutoTest"
class="px-2 py-1 text-xs border rounded transition-colors"
:class="autoTest
? 'bg-blue-900/30 text-blue-400 border-blue-800 hover:bg-blue-900/50'
: 'bg-gray-800/50 text-gray-400 border-gray-700 hover:bg-gray-800'"
:title="autoTest ? 'Auto-test: on — запускать тесты после pipeline' : 'Auto-test: off'">
{{ autoTest ? '✓ ' + t('projectView.auto_test_label') : t('projectView.auto_test_label') }}
</button>
<button @click="toggleWorktrees"
class="px-2 py-1 text-xs border rounded transition-colors"
:class="worktrees
? 'bg-teal-900/30 text-teal-400 border-teal-800 hover:bg-teal-900/50'
: 'bg-gray-800/50 text-gray-400 border-gray-700 hover:bg-gray-800'"
:title="worktrees ? 'Worktrees: on' : 'Worktrees: off'">
{{ worktrees ? t('projectView.worktrees_on') : t('projectView.worktrees_off') }}
</button>
<!-- Mode dropdown (Auto, Autocommit, AutoTest, Worktrees) -->
<div class="relative">
<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-10 transition-colors"
:class="(autoMode || autocommit || autoTest || worktrees) ? 'text-yellow-400 border-yellow-800 bg-yellow-900/20' : 'text-gray-400 border-gray-700 bg-gray-800/50'">
Mode
</button>
<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(); 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>
<span :class="autoMode ? 'text-yellow-400' : 'text-gray-600'" class="text-[10px]">{{ autoMode ? 'on' : 'off' }}</span>
</button>
<button
data-testid="mode-toggle-autocommit"
@click="toggleAutocommit"
class="w-full text-left px-3 py-1.5 text-xs flex items-center justify-between hover:bg-gray-800"
:title="autocommit ? 'Autocommit: on — git commit after pipeline' : 'Autocommit: off'">
<span>Autocommit</span>
<span :class="autocommit ? 'text-green-400' : 'text-gray-600'" class="text-[10px]">{{ autocommit ? 'on' : 'off' }}</span>
</button>
<button
data-testid="mode-toggle-autotest"
@click="toggleAutoTest"
class="w-full text-left px-3 py-1.5 text-xs flex items-center justify-between hover:bg-gray-800"
:title="autoTest ? 'Auto-test: on — запускать тесты после pipeline' : 'Auto-test: off'">
<span>{{ t('projectView.auto_test_label') }}</span>
<span :class="autoTest ? 'text-blue-400' : 'text-gray-600'" class="text-[10px]">{{ autoTest ? 'on' : 'off' }}</span>
</button>
<button
data-testid="mode-toggle-worktrees"
@click="toggleWorktrees"
class="w-full text-left px-3 py-1.5 text-xs flex items-center justify-between hover:bg-gray-800"
:title="worktrees ? 'Worktrees: on' : 'Worktrees: off'">
<span>{{ worktrees ? t('projectView.worktrees_on') : t('projectView.worktrees_off') }}</span>
<span :class="worktrees ? 'text-teal-400' : 'text-gray-600'" class="text-[10px]">{{ worktrees ? 'on' : 'off' }}</span>
</button>
</div>
</div>
<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">