Skip to content

Commit af2ccc9

Browse files
committed
chore(app): more spacing controls
1 parent a76be69 commit af2ccc9

4 files changed

Lines changed: 57 additions & 9 deletions

File tree

packages/ui/src/components/collapsible.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
overflow: visible;
1010

1111
&.tool-collapsible {
12-
gap: 8px;
12+
--tool-content-gap: 8px;
13+
gap: var(--tool-content-gap);
1314
}
1415

1516
[data-slot="collapsible-trigger"] {

packages/ui/src/components/message-part.css

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -636,14 +636,17 @@
636636
}
637637

638638
[data-component="context-tool-group-list"] {
639-
padding: 6px 0 4px 0;
639+
padding-top: 6px;
640+
padding-right: 0;
641+
padding-bottom: 4px;
642+
padding-left: 13px;
640643
display: flex;
641644
flex-direction: column;
642-
gap: 2px;
645+
gap: 8px;
643646

644647
[data-slot="context-tool-group-item"] {
645648
min-width: 0;
646-
padding: 6px 0;
649+
padding: 0;
647650
}
648651
}
649652

@@ -1154,8 +1157,8 @@
11541157
position: sticky;
11551158
top: var(--sticky-accordion-top, 0px);
11561159
z-index: 20;
1157-
height: 40px;
1158-
padding-bottom: 8px;
1160+
height: calc(32px + var(--tool-content-gap));
1161+
padding-bottom: var(--tool-content-gap);
11591162
background-color: var(--background-stronger);
11601163
}
11611164
}

packages/ui/src/components/message-part.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ function ContextToolGroup(props: { parts: ToolPart[]; busy?: boolean }) {
790790
const summary = createMemo(() => contextToolSummary(props.parts))
791791

792792
return (
793-
<Collapsible open={open()} onOpenChange={setOpen} variant="ghost">
793+
<Collapsible open={open()} onOpenChange={setOpen} variant="ghost" class="tool-collapsible">
794794
<Collapsible.Trigger>
795795
<div data-component="context-tool-group-trigger">
796796
<span

packages/ui/src/components/timeline-playground.stories.tsx

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,7 @@ function compactionPart(): CompactionPart {
567567
const MD = "markdown.css"
568568
const MP = "message-part.css"
569569
const ST = "session-turn.css"
570+
const CL = "collapsible.css"
570571

571572
/**
572573
* Source mapping for a CSS control.
@@ -1039,6 +1040,48 @@ const CSS_CONTROLS: CSSControl[] = [
10391040
},
10401041

10411042
// --- Tool parts ---
1043+
{
1044+
key: "tool-content-gap",
1045+
label: "Trigger/content gap",
1046+
group: "Tool Parts",
1047+
type: "range",
1048+
initial: "8",
1049+
selector: '[data-component="collapsible"].tool-collapsible',
1050+
property: "--tool-content-gap",
1051+
min: "0",
1052+
max: "24",
1053+
step: "1",
1054+
unit: "px",
1055+
source: { file: CL, anchor: "&.tool-collapsible {", prop: "--tool-content-gap", format: px },
1056+
},
1057+
{
1058+
key: "context-tool-gap",
1059+
label: "Explored tool gap",
1060+
group: "Explored Group",
1061+
type: "range",
1062+
initial: "14",
1063+
selector: '[data-component="context-tool-group-list"]',
1064+
property: "gap",
1065+
min: "0",
1066+
max: "40",
1067+
step: "1",
1068+
unit: "px",
1069+
source: { file: MP, anchor: '[data-component="context-tool-group-list"]', prop: "gap", format: px },
1070+
},
1071+
{
1072+
key: "context-tool-indent",
1073+
label: "Explored indent",
1074+
group: "Explored Group",
1075+
type: "range",
1076+
initial: "0",
1077+
selector: '[data-component="context-tool-group-list"]',
1078+
property: "padding-left",
1079+
min: "0",
1080+
max: "48",
1081+
step: "1",
1082+
unit: "px",
1083+
source: { file: MP, anchor: '[data-component="context-tool-group-list"]', prop: "padding-left", format: px },
1084+
},
10421085
{
10431086
key: "bash-max-height",
10441087
label: "Shell output max-height",
@@ -1099,8 +1142,9 @@ function Playground() {
10991142
const el = (root.querySelector(sample(ctrl)) ?? root.querySelector(ctrl.selector)) as HTMLElement | null
11001143
if (!el) continue
11011144
const styles = getComputedStyle(el)
1102-
// Use bracket access — getPropertyValue doesn't resolve shorthands
1103-
const raw = (styles as any)[ctrl.property] as string
1145+
const raw = ctrl.property.startsWith("--")
1146+
? styles.getPropertyValue(ctrl.property).trim()
1147+
: ((styles as any)[ctrl.property] as string)
11041148
if (!raw) continue
11051149
// Shorthands may return "24px 0px" — take the first value
11061150
const num = parseFloat(raw.split(" ")[0])

0 commit comments

Comments
 (0)