Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion apps/frontend/src/renderer/components/TaskCreationWizard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
*/
import { useState, useEffect, useCallback, useRef, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import { Loader2, ChevronDown, ChevronUp, RotateCcw, FolderTree, GitBranch } from 'lucide-react';
import { Loader2, ChevronDown, ChevronUp, RotateCcw, FolderTree, GitBranch, Info } from 'lucide-react';
import { Button } from './ui/button';
import { Label } from './ui/label';
import {
Expand Down Expand Up @@ -521,6 +521,19 @@ export function TaskCreationWizard({
}
>
<div className="space-y-6">
{/* Worktree isolation info banner */}
<div className="flex items-start gap-3 p-4 bg-info/10 border border-info/30 rounded-lg">
<Info className="h-5 w-5 text-info flex-shrink-0 mt-0.5" />
<div className="flex-1 min-w-0">
<h4 className="text-sm font-medium text-foreground mb-1">
{t('tasks:wizard.worktreeNotice.title')}
</h4>
<p className="text-sm text-muted-foreground">
{t('tasks:wizard.worktreeNotice.description')}
</p>
</div>
</div>

{/* Main form fields */}
<TaskFormFields
description={description}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
import { useTranslation } from 'react-i18next';
import { Button } from '../../ui/button';
import { Checkbox } from '../../ui/checkbox';
import { Tooltip, TooltipContent, TooltipTrigger } from '../../ui/tooltip';
import { cn } from '../../../lib/utils';
import type { WorktreeStatus, MergeConflict, MergeStats, GitConflictInfo, SupportedIDE, SupportedTerminal } from '../../../../shared/types';
import { useSettingsStore } from '../../../stores/settings-store';
Expand Down Expand Up @@ -100,7 +101,7 @@ export function WorkspaceStatus({
onSwitchToTerminals,
onOpenInbuiltTerminal
}: WorkspaceStatusProps) {
const { t } = useTranslation(['taskReview', 'common']);
const { t } = useTranslation(['taskReview', 'common', 'tasks']);
const { settings } = useSettingsStore();
const preferredIDE = settings.preferredIDE || 'vscode';
const preferredTerminal = settings.preferredTerminal || 'system';
Expand Down Expand Up @@ -418,32 +419,41 @@ export function WorkspaceStatus({

{/* State 3: Merge preview loaded - show appropriate merge/stage button */}
{mergePreview && !isLoadingPreview && (
<Button
variant={hasGitConflicts || isBranchBehind || hasPathMappedMerges ? "warning" : "success"}
onClick={onMerge}
disabled={isMerging || isDiscarding}
className="flex-1"
>
{isMerging ? (
<>
<Loader2 className="mr-2 h-4 w-4 animate-spin" />
{hasGitConflicts || isBranchBehind || hasPathMappedMerges
? t('taskReview:merge.buttons.resolving')
: stageOnly
? t('taskReview:merge.buttons.staging')
: t('taskReview:merge.buttons.merging')}
</>
) : (
<>
<GitMerge className="mr-2 h-4 w-4" />
{hasGitConflicts || isBranchBehind || hasPathMappedMerges
? (stageOnly ? t('taskReview:merge.buttons.stageWithAIMerge') : t('taskReview:merge.buttons.mergeWithAI'))
: (stageOnly
? t('taskReview:merge.buttons.stageTo', { branch: worktreeStatus.currentProjectBranch || worktreeStatus.baseBranch || 'main' })
: t('taskReview:merge.buttons.mergeTo', { branch: worktreeStatus.currentProjectBranch || worktreeStatus.baseBranch || 'main' }))}
</>
)}
</Button>
<Tooltip>
<TooltipTrigger asChild>
<Button
variant={hasGitConflicts || isBranchBehind || hasPathMappedMerges ? "warning" : "success"}
onClick={onMerge}
disabled={isMerging || isDiscarding}
className="flex-1"
>
{isMerging ? (
<>
<Loader2 className="mr-2 h-4 w-4 animate-spin" />
{hasGitConflicts || isBranchBehind || hasPathMappedMerges
? t('taskReview:merge.buttons.resolving')
: stageOnly
? t('taskReview:merge.buttons.staging')
: t('taskReview:merge.buttons.merging')}
</>
) : (
<>
<GitMerge className="mr-2 h-4 w-4" />
{hasGitConflicts || isBranchBehind || hasPathMappedMerges
? (stageOnly ? t('taskReview:merge.buttons.stageWithAIMerge') : t('taskReview:merge.buttons.mergeWithAI'))
: (stageOnly
? t('taskReview:merge.buttons.stageTo', { branch: worktreeStatus.currentProjectBranch || worktreeStatus.baseBranch || 'main' })
: t('taskReview:merge.buttons.mergeTo', { branch: worktreeStatus.currentProjectBranch || worktreeStatus.baseBranch || 'main' }))}
</>
)}
</Button>
</TooltipTrigger>
<TooltipContent>
<p className="max-w-xs">
{t('tasks:review.mergeTooltip')}
</p>
</TooltipContent>
</Tooltip>
)}

{/* Create PR Button */}
Expand Down
7 changes: 7 additions & 0 deletions apps/frontend/src/shared/i18n/locales/en/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@
"browseFiles": "Browse Files",
"creating": "Creating...",
"createTask": "Create Task",
"worktreeNotice": {
"title": "Isolated Workspace",
"description": "This task runs in an isolated git worktree. Your main branch stays safe until you choose to merge."
},
"gitOptions": {
"title": "Git Options (optional)",
"baseBranchLabel": "Base Branch (optional)",
Expand All @@ -158,6 +162,9 @@
"createFailed": "Failed to create task. Please try again."
}
},
"review": {
"mergeTooltip": "Merges changes from the task's worktree branch back to your base branch. AI will resolve any conflicts. You can then choose whether to keep or remove the worktree."
},
"edit": {
"title": "Edit Task",
"description": "Update task details including title, description, classification, images, and settings. Changes will be saved to the spec files.",
Expand Down
7 changes: 7 additions & 0 deletions apps/frontend/src/shared/i18n/locales/fr/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@
"browseFiles": "Parcourir les fichiers",
"creating": "Création...",
"createTask": "Créer la tâche",
"worktreeNotice": {
"title": "Espace de travail isolé",
"description": "Cette tâche s'exécute dans un worktree git isolé. Votre branche principale reste protégée jusqu'à ce que vous choisissiez de fusionner."
},
"gitOptions": {
"title": "Options Git (optionnel)",
"baseBranchLabel": "Branche de base (optionnel)",
Expand All @@ -158,6 +162,9 @@
"createFailed": "Échec de la création de la tâche. Veuillez réessayer."
}
},
"review": {
"mergeTooltip": "Fusionne les changements de la branche worktree de la tâche vers votre branche de base. L'IA résoudra les conflits éventuels. Vous pourrez ensuite choisir de conserver ou de supprimer le worktree."
},
"edit": {
"title": "Modifier la tâche",
"description": "Mettez à jour les détails de la tâche, y compris le titre, la description, la classification, les images et les paramètres. Les modifications seront enregistrées dans les fichiers de spécification.",
Expand Down
Loading