Skip to content

Commit e16589f

Browse files
iamdavidhilladamdotdevinBrendonovich
authored
tweak(ui): session spacing (#20839)
Co-authored-by: Adam <2363879+adamdotdevin@users.noreply.github.com> Co-authored-by: Brendan Allan <brendonovich@outlook.com>
1 parent 83e257b commit e16589f

7 files changed

Lines changed: 97 additions & 31 deletions

File tree

packages/opencode/.opencode/package-lock.json

Lines changed: 31 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/ui/src/components/collapsible.css

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

1111
&.tool-collapsible {
12-
--tool-content-gap: 8px;
12+
--tool-content-gap: 4px;
1313
gap: var(--tool-content-gap);
1414
}
1515

packages/ui/src/components/markdown.css

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
color: var(--text-strong);
77
font-family: var(--font-family-sans);
88
font-size: var(--font-size-base); /* 14px */
9-
line-height: var(--line-height-x-large);
9+
line-height: 160%;
1010

1111
/* Spacing for flow */
1212
> *:first-child {
@@ -23,11 +23,11 @@
2323
h4,
2424
h5,
2525
h6 {
26-
font-size: var(--font-size-base);
26+
font-size: 14px;
2727
color: var(--text-strong);
2828
font-weight: var(--font-weight-medium);
29-
margin-top: 2rem;
30-
margin-bottom: 0.75rem;
29+
margin-top: 0px;
30+
margin-bottom: 24px;
3131
line-height: var(--line-height-large);
3232
}
3333

@@ -40,7 +40,7 @@
4040

4141
/* Paragraphs */
4242
p {
43-
margin-bottom: 1rem;
43+
margin-bottom: 12px;
4444
}
4545

4646
/* Links */
@@ -58,10 +58,10 @@
5858
/* Lists */
5959
ul,
6060
ol {
61-
margin-top: 0.5rem;
62-
margin-bottom: 1rem;
61+
margin-top: 8px;
62+
margin-bottom: 12px;
6363
margin-left: 0;
64-
padding-left: 1.5rem;
64+
padding-left: 32px;
6565
list-style-position: outside;
6666
}
6767

@@ -75,7 +75,7 @@
7575
}
7676

7777
li {
78-
margin-bottom: 0.5rem;
78+
margin-bottom: 8px;
7979
}
8080

8181
li > p:first-child {
@@ -117,12 +117,12 @@
117117
hr {
118118
border: none;
119119
height: 0;
120-
margin: 2.5rem 0;
120+
margin: 40px 0;
121121
}
122122

123123
.shiki {
124124
font-size: 13px;
125-
padding: 8px 12px;
125+
padding: 12px;
126126
border-radius: 6px;
127127
border: 0.5px solid var(--border-weak-base);
128128
}
@@ -201,8 +201,8 @@
201201
}
202202

203203
pre {
204-
margin-top: 2rem;
205-
margin-bottom: 2rem;
204+
margin-top: 12px;
205+
margin-bottom: 32px;
206206
overflow: auto;
207207

208208
scrollbar-width: none;
@@ -229,7 +229,7 @@
229229
table {
230230
width: 100%;
231231
border-collapse: collapse;
232-
margin: 1.5rem 0;
232+
margin: 24px 0;
233233
font-size: var(--font-size-base);
234234
display: block;
235235
overflow-x: auto;
@@ -239,7 +239,7 @@
239239
td {
240240
/* Minimal borders for structure, matching TUI "lines" roughly but keeping it web-clean */
241241
border-bottom: 1px solid var(--border-weaker-base);
242-
padding: 0.75rem 0.5rem;
242+
padding: 12px;
243243
text-align: left;
244244
vertical-align: top;
245245
}

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

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -283,9 +283,9 @@
283283
line-height: var(--line-height-normal);
284284

285285
[data-component="markdown"] {
286-
margin-top: 24px;
286+
margin-top: 16px;
287287
font-style: normal;
288-
font-size: var(--font-size-base);
288+
font-size: 13px;
289289
color: var(--text-weak);
290290

291291
strong,
@@ -556,9 +556,12 @@
556556

557557
[data-component="exa-tool-output"] {
558558
width: 100%;
559-
padding-top: 8px;
560559
display: flex;
561560
flex-direction: column;
561+
font-family: var(--font-family-sans);
562+
font-size: var(--font-size-base);
563+
line-height: var(--line-height-large);
564+
color: var(--text-base);
562565
}
563566

564567
[data-slot="basic-tool-tool-subtitle"].exa-tool-query {
@@ -578,6 +581,8 @@
578581
[data-slot="exa-tool-link"] {
579582
display: block;
580583
max-width: 100%;
584+
font: inherit;
585+
line-height: inherit;
581586
color: var(--text-interactive-base);
582587
text-decoration: underline;
583588
text-underline-offset: 2px;
@@ -636,13 +641,13 @@
636641
}
637642

638643
[data-component="context-tool-group-list"] {
639-
padding-top: 6px;
644+
padding-top: 0;
640645
padding-right: 0;
641-
padding-bottom: 4px;
642-
padding-left: 13px;
646+
padding-bottom: 0;
647+
padding-left: 12px;
643648
display: flex;
644649
flex-direction: column;
645-
gap: 8px;
650+
gap: 4px;
646651

647652
[data-slot="context-tool-group-item"] {
648653
min-width: 0;

packages/ui/src/components/session-turn.css

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
align-items: flex-start;
2727
align-self: stretch;
2828
min-width: 0;
29-
gap: 18px;
29+
gap: 0px;
3030
overflow-anchor: none;
3131
}
3232

@@ -47,6 +47,7 @@
4747
display: flex;
4848
align-items: center;
4949
gap: 8px;
50+
margin-top: 12px;
5051
width: 100%;
5152
min-width: 0;
5253
color: var(--text-weak);
@@ -226,5 +227,5 @@
226227
}
227228

228229
[data-slot="session-turn-list"] {
229-
gap: 48px;
230+
gap: 24px;
230231
}

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

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,7 @@ const MD = "markdown.css"
568568
const MP = "message-part.css"
569569
const ST = "session-turn.css"
570570
const CL = "collapsible.css"
571+
const BT = "basic-tool.css"
571572

572573
/**
573574
* Source mapping for a CSS control.
@@ -607,10 +608,10 @@ const CSS_CONTROLS: CSSControl[] = [
607608
// --- Timeline spacing ---
608609
{
609610
key: "turn-gap",
610-
label: "Turn gap",
611+
label: "Above user messages",
611612
group: "Timeline Spacing",
612613
type: "range",
613-
initial: "48",
614+
initial: "32",
614615
selector: '[data-slot="session-turn-list"]',
615616
property: "gap",
616617
min: "0",
@@ -621,10 +622,10 @@ const CSS_CONTROLS: CSSControl[] = [
621622
},
622623
{
623624
key: "container-gap",
624-
label: "Container gap",
625+
label: "Below user messages",
625626
group: "Timeline Spacing",
626627
type: "range",
627-
initial: "18",
628+
initial: "0",
628629
selector: '[data-slot="session-turn-message-container"]',
629630
property: "gap",
630631
min: "0",
@@ -1040,12 +1041,40 @@ const CSS_CONTROLS: CSSControl[] = [
10401041
},
10411042

10421043
// --- Tool parts ---
1044+
{
1045+
key: "tool-subtitle-font-size",
1046+
label: "Subtitle font size",
1047+
group: "Tool Parts",
1048+
type: "range",
1049+
initial: "14",
1050+
selector: '[data-slot="basic-tool-tool-subtitle"]',
1051+
property: "font-size",
1052+
min: "10",
1053+
max: "22",
1054+
step: "1",
1055+
unit: "px",
1056+
source: { file: BT, anchor: '[data-slot="basic-tool-tool-subtitle"]', prop: "font-size", format: px },
1057+
},
1058+
{
1059+
key: "exa-output-font-size",
1060+
label: "Search output font size",
1061+
group: "Tool Parts",
1062+
type: "range",
1063+
initial: "14",
1064+
selector: '[data-component="exa-tool-output"]',
1065+
property: "font-size",
1066+
min: "10",
1067+
max: "22",
1068+
step: "1",
1069+
unit: "px",
1070+
source: { file: MP, anchor: '[data-component="exa-tool-output"]', prop: "font-size", format: px },
1071+
},
10431072
{
10441073
key: "tool-content-gap",
10451074
label: "Trigger/content gap",
10461075
group: "Tool Parts",
10471076
type: "range",
1048-
initial: "8",
1077+
initial: "4",
10491078
selector: '[data-component="collapsible"].tool-collapsible',
10501079
property: "--tool-content-gap",
10511080
min: "0",
@@ -1059,7 +1088,7 @@ const CSS_CONTROLS: CSSControl[] = [
10591088
label: "Explored tool gap",
10601089
group: "Explored Group",
10611090
type: "range",
1062-
initial: "14",
1091+
initial: "4",
10631092
selector: '[data-component="context-tool-group-list"]',
10641093
property: "gap",
10651094
min: "0",

session.json

Whitespace-only changes.

0 commit comments

Comments
 (0)