Skip to content

Commit e80f192

Browse files
authored
feat(ui): simplify Claude unavailable banner and add settings warning (#10275)
1 parent ead3158 commit e80f192

File tree

2 files changed

+49
-54
lines changed

2 files changed

+49
-54
lines changed
Lines changed: 21 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<script lang="ts">
2-
import loadErrorSvg from '$lib/assets/empty-state/load-error.svg?raw';
32
import { Icon, Button } from '@gitbutler/ui';
43
54
interface Props {
@@ -9,63 +8,46 @@
98
const { onSettingsBtnClick }: Props = $props();
109
</script>
1110

12-
<section class="not-available-banner__wrap">
11+
<div class="not-available-banner__wrapper">
1312
<div class="not-available-banner">
14-
<div class="not-available-banner__image">
15-
{@html loadErrorSvg}
16-
</div>
1713
<div class="not-available-banner__content">
1814
<h3 class="text-16 text-semibold">
1915
<span class="not-available-banner__icon">
2016
<Icon name="warning" />
2117
</span> Claude code can't be found
2218
</h3>
23-
<p class="text-13 text-body clr-text-2 m-bottom-8">
19+
<p class="text-13 text-body clr-text-2">
2420
Connect Claude Code to keep going with this session.
25-
<br />
26-
This can be configured in the settings.
2721
</p>
28-
<Button kind="outline" style="neutral" icon="mixer" type="button" onclick={onSettingsBtnClick}
29-
>Configure Claude Code…</Button
30-
>
3122
</div>
23+
<Button kind="outline" style="neutral" icon="mixer" type="button" onclick={onSettingsBtnClick}
24+
>Set up connection…</Button
25+
>
3226
</div>
33-
</section>
27+
</div>
3428

3529
<style lang="postcss">
36-
.not-available-banner__wrap {
30+
.not-available-banner__wrapper {
3731
display: flex;
38-
position: relative;
39-
padding: 12px;
40-
padding-top: 0;
41-
42-
&::before {
43-
position: absolute;
44-
bottom: 0;
45-
left: 0;
46-
width: 100%;
47-
height: calc(100% + 60px);
48-
background: linear-gradient(0deg, var(--clr-bg-1-muted) 70%, transparent 100%);
49-
content: '';
50-
pointer-events: none;
51-
}
32+
z-index: var(--z-ground);
33+
position: absolute;
34+
bottom: 0;
35+
left: 0;
36+
justify-content: center;
37+
width: 100%;
38+
padding: 16px;
5239
}
53-
5440
.not-available-banner {
5541
display: flex;
56-
z-index: var(--z-ground);
57-
align-items: center;
58-
width: 100%;
59-
padding: 28px;
42+
bottom: 16px;
43+
width: fit-content;
44+
padding: 16px;
6045
overflow: hidden;
6146
gap: 28px;
6247
border: 1px solid var(--clr-border-2);
6348
border-radius: var(--radius-ml);
6449
background-color: var(--clr-bg-1);
65-
}
66-
67-
.not-available-banner__image {
68-
flex-shrink: 0;
50+
box-shadow: var(--fx-shadow-l);
6951
}
7052
7153
.not-available-banner__content {
@@ -82,22 +64,10 @@
8264
color: var(--clr-theme-warn-element);
8365
}
8466
85-
@container chat (min-width: 800px) {
86-
.not-available-banner__wrap {
87-
position: absolute;
88-
bottom: 0;
89-
left: 0;
90-
justify-content: center;
91-
width: 100%;
92-
93-
&::before {
94-
display: none;
95-
}
96-
}
97-
67+
@container chat (max-width: 600px) {
9868
.not-available-banner {
99-
width: auto;
100-
max-width: 560px;
69+
flex-direction: column;
70+
gap: 16px;
10171
}
10272
}
10373
</style>

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

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -363,15 +363,15 @@
363363
<ReduxResult result={claudeAvailable.current} {projectId}>
364364
{#snippet children(claudeAvailable, { projectId })}
365365
{#if claudeAvailable.status === 'available' || hasExistingSessions}
366-
{@render main({ projectId })}
366+
{@render main({ projectId, available: claudeAvailable.status === 'available' })}
367367
{:else}
368368
{@render claudeNotAvailable()}
369369
{/if}
370370
{/snippet}
371371
</ReduxResult>
372372
</div>
373373

374-
{#snippet main({ projectId }: { projectId: string })}
374+
{#snippet main({ projectId, available }: { projectId: string; available?: boolean })}
375375
<CodegenSidebar>
376376
{#snippet actions()}
377377
<Button
@@ -381,7 +381,23 @@
381381
reversedDirection
382382
onclick={() => createBranchModal?.show()}>Add new</Button
383383
>
384-
<Button kind="outline" icon="mixer" size="tag" onclick={() => settingsModal?.show()} />
384+
<div class="flex relative">
385+
{#if !available}
386+
<svg
387+
viewBox="0 0 10 10"
388+
fill="none"
389+
xmlns="http://www.w3.org/2000/svg"
390+
class="settings-warning-icon"
391+
>
392+
<path
393+
d="M3.70898 1.66797C4.28964 0.685942 5.71035 0.685941 6.29102 1.66797L9.28613 6.7373C9.87685 7.7372 9.15651 8.99999 7.99512 9H2.00488C0.843494 8.99999 0.123153 7.7372 0.713867 6.7373L3.70898 1.66797Z"
394+
fill="#E89910"
395+
/>
396+
</svg>
397+
{/if}
398+
399+
<Button kind="outline" icon="mixer" size="tag" onclick={() => settingsModal?.show()} />
400+
</div>
385401
{/snippet}
386402

387403
{#snippet content()}
@@ -1026,4 +1042,13 @@
10261042
padding: 0 16px;
10271043
gap: 16px;
10281044
}
1045+
1046+
.settings-warning-icon {
1047+
z-index: 1;
1048+
position: absolute;
1049+
top: -2px;
1050+
right: -3px;
1051+
width: 9px;
1052+
height: 9px;
1053+
}
10291054
</style>

0 commit comments

Comments
 (0)