Skip to content

Commit 74caa7e

Browse files
committed
Remove old codgen badge
1 parent b3b6b04 commit 74caa7e

File tree

4 files changed

+2
-217
lines changed

4 files changed

+2
-217
lines changed

apps/desktop/src/components/BranchCard.svelte

Lines changed: 2 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,20 @@
55
import BranchHeaderContextMenu from '$components/BranchHeaderContextMenu.svelte';
66
import CardOverlay from '$components/CardOverlay.svelte';
77
import ChecksPolling from '$components/ChecksPolling.svelte';
8-
import ClaudeSessionDescriptor from '$components/ClaudeSessionDescriptor.svelte';
98
import CreateReviewBox from '$components/CreateReviewBox.svelte';
109
import Dropzone from '$components/Dropzone.svelte';
1110
import PrNumberUpdater from '$components/PrNumberUpdater.svelte';
12-
import ReduxResult from '$components/ReduxResult.svelte';
13-
import CodegenBadge from '$components/codegen/CodegenBadge.svelte';
1411
import { BranchDropData } from '$lib/branches/dropHandler';
15-
import { CLAUDE_CODE_SERVICE } from '$lib/codegen/claude';
16-
import { CodegenRuleDropData, CodegenRuleDropHandler } from '$lib/codegen/dropzone';
17-
import { useGoToCodegenPage } from '$lib/codegen/redirect.svelte';
1812
import { MoveCommitDzHandler } from '$lib/commits/dropHandler';
19-
import { draggableChips } from '$lib/dragging/draggable';
20-
import { DROPZONE_REGISTRY } from '$lib/dragging/registry';
2113
import { ReorderCommitDzHandler } from '$lib/dragging/stackingReorderDropzoneManager';
2214
import { DEFAULT_FORGE_FACTORY } from '$lib/forge/forgeFactory.svelte';
23-
import { RULES_SERVICE } from '$lib/rules/rulesService.svelte';
2415
import { STACK_SERVICE } from '$lib/stacks/stackService.svelte';
2516
import { UI_STATE } from '$lib/state/uiState.svelte';
2617
import { inject } from '@gitbutler/core/context';
2718
import { ReviewBadge, TestId } from '@gitbutler/ui';
28-
import { DRAG_STATE_SERVICE } from '@gitbutler/ui/drag/dragStateService.svelte';
2919
import { getTimeAgo } from '@gitbutler/ui/utils/timeAgo';
3020
import { isDefined } from '@gitbutler/ui/utils/typeguards';
3121
import type { DropzoneHandler } from '$lib/dragging/handler';
32-
import type { RuleFilter } from '$lib/rules/rule';
3322
import type { PushStatus } from '$lib/stacks/stack';
3423
import type iconsJson from '@gitbutler/ui/data/icons.json';
3524
import type { Snippet } from 'svelte';
@@ -102,15 +91,9 @@
10291
10392
let { projectId, branchName, lineColor, readonly, ...args }: Props = $props();
10493
105-
const { goToCodegenPage } = useGoToCodegenPage();
106-
10794
const uiState = inject(UI_STATE);
10895
const stackService = inject(STACK_SERVICE);
10996
const forge = inject(DEFAULT_FORGE_FACTORY);
110-
const rulesService = inject(RULES_SERVICE);
111-
const claudeCodeService = inject(CLAUDE_CODE_SERVICE);
112-
const dropzoneRegistry = inject(DROPZONE_REGISTRY);
113-
const dragStateService = inject(DRAG_STATE_SERVICE);
11497
11598
const prService = $derived(forge.current.prService);
11699
const prUnit = $derived(prService?.unit);
@@ -203,21 +186,12 @@
203186
<PrNumberUpdater {projectId} stackId={args.stackId} {branchName} />
204187
{/if}
205188

206-
{@const rule = args.stackId
207-
? rulesService.aiRuleForStack({ projectId, stackId: args.stackId })
208-
: undefined}
209-
{@const codegenRuleHandler = args.stackId
210-
? new CodegenRuleDropHandler(projectId, args.stackId, rulesService, !!rule?.response)
211-
: undefined}
212-
213189
<Dropzone
214-
handlers={args.first
215-
? [moveHandler, codegenRuleHandler, ...args.dropzones].filter(isDefined)
216-
: args.dropzones}
190+
handlers={args.first ? [moveHandler, ...args.dropzones].filter(isDefined) : args.dropzones}
217191
>
218192
{#snippet overlay({ hovered, activated, handler })}
219193
{@const label =
220-
handler instanceof MoveCommitDzHandler || handler instanceof CodegenRuleDropHandler
194+
handler instanceof MoveCommitDzHandler
221195
? 'Move here'
222196
: handler instanceof ReorderCommitDzHandler
223197
? 'Reorder here'
@@ -277,9 +251,6 @@
277251
{#if args.buttons}
278252
{@render args.buttons()}
279253
{/if}
280-
{#if args.first}
281-
{@render claudeRule(args as StackBranchProps)}
282-
{/if}
283254
{/snippet}
284255

285256
{#snippet emptyState()}
@@ -423,55 +394,6 @@
423394
{/if}
424395
</div>
425396

426-
{#snippet claudeRule(args: StackBranchProps)}
427-
{@const rule = args.stackId
428-
? rulesService.aiRuleForStack({ projectId, stackId: args.stackId })
429-
: undefined}
430-
{#if rule}
431-
<ReduxResult result={rule?.result} {projectId} stackId={args.stackId}>
432-
{#snippet children(rule, { projectId, stackId })}
433-
{#if rule}
434-
{@const sessionId = (rule.filters[0]! as RuleFilter & { type: 'claudeCodeSessionId' })
435-
.subject}
436-
{@const sessionDetails = claudeCodeService.sessionDetails(projectId, sessionId)}
437-
<ReduxResult result={sessionDetails.result} {projectId} {stackId}>
438-
{#snippet children(sessionDetails, { projectId, stackId: _stackId })}
439-
<ClaudeSessionDescriptor {projectId} {sessionId}>
440-
{#snippet loading()}
441-
<CodegenBadge state="loading" />
442-
{/snippet}
443-
{#snippet error()}
444-
<CodegenBadge state="error" />
445-
{/snippet}
446-
<div
447-
class="branch-header__ai-pill"
448-
use:draggableChips={{
449-
label: !sessionDetails.inGui ? 'CLI' : undefined,
450-
data: new CodegenRuleDropData(rule),
451-
chipType: 'ai-session',
452-
dropzoneRegistry,
453-
dragStateService
454-
}}
455-
>
456-
<CodegenBadge
457-
state={sessionDetails.inGui ? 'ebabled' : 'cli'}
458-
onclick={async () => {
459-
if (!args.stackId) return;
460-
if (!sessionDetails.inGui) return;
461-
462-
goToCodegenPage(projectId, args.stackId, branchName);
463-
}}
464-
/>
465-
</div>
466-
</ClaudeSessionDescriptor>
467-
{/snippet}
468-
</ReduxResult>
469-
{/if}
470-
{/snippet}
471-
</ReduxResult>
472-
{/if}
473-
{/snippet}
474-
475397
<style lang="postcss">
476398
.branch-card {
477399
display: flex;
@@ -508,9 +430,4 @@
508430
padding: 12px;
509431
}
510432
}
511-
512-
.branch-header__ai-pill {
513-
display: flex;
514-
overflow: hidden;
515-
}
516433
</style>

apps/desktop/src/components/BranchHeaderContextMenu.svelte

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,8 @@
1818
import { PROMPT_SERVICE } from '$lib/ai/promptService';
1919
import { AI_SERVICE } from '$lib/ai/service';
2020
import { CLIPBOARD_SERVICE } from '$lib/backend/clipboard';
21-
import { useGoToCodegenPage } from '$lib/codegen/redirect.svelte';
2221
import { projectAiGenEnabled } from '$lib/config/config';
2322
import { DEFAULT_FORGE_FACTORY } from '$lib/forge/forgeFactory.svelte';
24-
import { RULES_SERVICE } from '$lib/rules/rulesService.svelte';
2523
import { STACK_SERVICE } from '$lib/stacks/stackService.svelte';
2624
import { URL_SERVICE } from '$lib/utils/url';
2725
import { inject } from '@gitbutler/core/context';
@@ -54,10 +52,7 @@
5452
contextData
5553
}: Props = $props();
5654
57-
const { goToCodegenPage } = useGoToCodegenPage();
58-
5955
const aiService = inject(AI_SERVICE);
60-
const rulesService = inject(RULES_SERVICE);
6156
const stackService = inject(STACK_SERVICE);
6257
const forge = inject(DEFAULT_FORGE_FACTORY);
6358
const promptService = inject(PROMPT_SERVICE);
@@ -251,21 +246,6 @@
251246
{/if}
252247
</ContextMenuSection>
253248
<ContextMenuSection>
254-
{#if stackId && first}
255-
{@const rule = rulesService.aiRuleForStack({ projectId, stackId })}
256-
{#if !rule.response}
257-
<ContextMenuItem
258-
label="Start agent session"
259-
icon="agents-tab"
260-
testId={TestId.BranchHeaderContextMenu_StartCodegenAgent}
261-
disabled={isReadOnly}
262-
onclick={() => {
263-
goToCodegenPage(projectId, stackId, branchName);
264-
close();
265-
}}
266-
/>
267-
{/if}
268-
{/if}
269249
{#if $aiGenEnabled && aiConfigurationValid && !branch.remoteTrackingBranch && stackId}
270250
<ContextMenuItem
271251
label="Generate branch name"

apps/desktop/src/components/codegen/CodegenBadge.svelte

Lines changed: 0 additions & 90 deletions
This file was deleted.

apps/desktop/src/lib/codegen/redirect.svelte.ts

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)