Skip to content

Commit 388550d

Browse files
authored
feat(ui): refactor Claude resume UI into a styled copy-button component with improved layout and readonly code styling (#9840)
1 parent 562520b commit 388550d

File tree

1 file changed

+41
-23
lines changed

1 file changed

+41
-23
lines changed

apps/desktop/src/components/RuleFiltersEditor.svelte

Lines changed: 41 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
let claudeCodeSessionId = $state<string | undefined>(
4343
initialFilterValues.claudeCodeSessionId ?? undefined
4444
);
45-
let claudeResumeCommand = $derived(
45+
const claudeResumeCommand = $derived(
4646
claudeCodeSessionId ? `claude --resume ${claudeCodeSessionId}` : undefined
4747
);
4848
@@ -295,17 +295,18 @@
295295
{#if ruleFilterTypes.includes('claudeCodeSessionId')}
296296
{@render ruleFilterRow('claudeCodeSessionId')}
297297
{#if claudeResumeCommand}
298-
<div class="text-12 text-body">Resume command</div>
299-
<div class="claude-command-copy-box m-top-12">
300-
<p>{claudeResumeCommand}</p>
301-
<button
302-
type="button"
303-
class="claude-command--copy-icon"
304-
onclick={() => copyToClipboard(claudeResumeCommand)}
305-
>
298+
<button
299+
class="claude-command-copy"
300+
type="button"
301+
onclick={() => copyToClipboard(claudeResumeCommand)}
302+
>
303+
<p class="text-12 clr-text-3">Resume session command:</p>
304+
<code class="claude-command-copy__code">{claudeResumeCommand}</code>
305+
306+
<i class="claude-command-copy__icon">
306307
<Icon name="copy" />
307-
</button>
308-
</div>
308+
</i>
309+
</button>
309310
{/if}
310311
{/if}
311312

@@ -319,28 +320,45 @@
319320
/>
320321

321322
<style lang="postcss">
322-
.claude-command-copy-box {
323+
.claude-command-copy {
323324
display: flex;
324-
padding: 8px 10px;
325-
gap: 10px;
325+
position: relative;
326+
flex-direction: column;
327+
margin-top: 10px;
328+
padding: 12px;
329+
gap: 6px;
326330
border: 1px solid var(--clr-border-3);
327331
border-radius: var(--radius-m);
328332
background-color: var(--clr-bg-1-muted);
329-
color: var(--clr-text-1);
330-
font-size: 12px;
331-
font-family: var(--fontfamily-mono);
332-
word-break: break-all;
333-
user-select: text;
333+
text-align: left;
334+
335+
&:hover {
336+
& .claude-command-copy__icon {
337+
color: var(--clr-text-2);
338+
}
339+
& .claude-command-copy__code {
340+
opacity: 0.8;
341+
}
342+
}
334343
}
335344
336-
.claude-command--copy-icon {
345+
.claude-command-copy__icon {
337346
display: flex;
347+
position: absolute;
348+
top: 8px;
349+
right: 8px;
338350
color: var(--clr-text-3);
339351
transition: color var(--transition-fast);
352+
}
340353
341-
&:hover {
342-
color: var(--clr-text-2);
343-
}
354+
.claude-command-copy__code {
355+
font-size: 12px;
356+
line-height: 1.5;
357+
font-family: var(--fontfamily-mono);
358+
word-break: break-all;
359+
opacity: 0.6;
360+
transition: opacity var(--transition-fast);
361+
user-select: text;
344362
}
345363
346364
.rule-filter-row {

0 commit comments

Comments
 (0)