Skip to content

Commit e1effb9

Browse files
perf(ui): lazy-load chat goal styles
1 parent 326b809 commit e1effb9

2 files changed

Lines changed: 199 additions & 199 deletions

File tree

‎ui/src/styles/chat/composer-progress.css‎

Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,205 @@
4949
margin-bottom: calc(0px - var(--chat-composer-shell-gap) - var(--chat-progress-underlap));
5050
}
5151

52+
.agent-chat__goal {
53+
align-self: center;
54+
display: flex;
55+
flex-direction: column;
56+
max-width: calc(100% - 20px);
57+
min-width: 0;
58+
margin: 0 auto 8px;
59+
padding: 5px 8px;
60+
color: color-mix(in srgb, var(--text) 82%, var(--muted));
61+
background: color-mix(in srgb, var(--bg-elevated) 84%, transparent);
62+
border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
63+
border-radius: var(--radius-lg);
64+
font-size: 12px;
65+
line-height: 1.25;
66+
}
67+
68+
.agent-chat__goal-row {
69+
display: grid;
70+
grid-template-columns: var(--chat-stack-icon-size, 14px) minmax(0, 1fr) auto auto;
71+
align-items: center;
72+
min-width: 0;
73+
column-gap: 8px;
74+
}
75+
76+
.agent-chat__goal-icon {
77+
display: inline-flex;
78+
align-items: center;
79+
justify-content: center;
80+
width: var(--chat-stack-icon-size, 14px);
81+
height: 18px;
82+
flex-shrink: 0;
83+
}
84+
85+
.agent-chat__goal-icon svg {
86+
width: var(--chat-stack-icon-size, 14px);
87+
height: var(--chat-stack-icon-size, 14px);
88+
stroke: currentColor;
89+
fill: none;
90+
stroke-width: 1.7px;
91+
stroke-linecap: round;
92+
stroke-linejoin: round;
93+
}
94+
95+
.agent-chat__goal-copy,
96+
.agent-chat__goal-label,
97+
.agent-chat__goal-objective {
98+
min-width: 0;
99+
overflow: hidden;
100+
text-overflow: ellipsis;
101+
white-space: nowrap;
102+
}
103+
104+
.agent-chat__goal-copy {
105+
display: flex;
106+
align-items: baseline;
107+
gap: 8px;
108+
}
109+
110+
.agent-chat__goal-label {
111+
flex: 0 0 auto;
112+
color: var(--chat-text);
113+
font-size: 13px;
114+
font-weight: 400;
115+
line-height: 1.45;
116+
}
117+
118+
.agent-chat__goal-objective {
119+
flex: 1 1 auto;
120+
color: var(--muted);
121+
}
122+
123+
.agent-chat__goal[data-expanded="true"] .agent-chat__goal-label {
124+
font-weight: 600;
125+
}
126+
127+
.agent-chat__goal[data-expanded="true"]
128+
:is(.agent-chat__goal-icon, .agent-chat__goal-objective, .agent-chat__goal-elapsed) {
129+
display: none;
130+
}
131+
132+
.agent-chat__goal[data-expanded="true"] .agent-chat__goal-row {
133+
grid-template-columns: minmax(0, 1fr) auto;
134+
}
135+
136+
.agent-chat__goal-elapsed {
137+
flex-shrink: 0;
138+
color: var(--muted);
139+
font-feature-settings: "tnum" 1;
140+
font-variant-numeric: tabular-nums;
141+
}
142+
143+
.agent-chat__goal-actions {
144+
display: flex;
145+
align-items: center;
146+
flex-shrink: 0;
147+
gap: 2px;
148+
}
149+
150+
.agent-chat__goal-action {
151+
display: inline-flex;
152+
align-items: center;
153+
justify-content: center;
154+
width: 24px;
155+
height: 24px;
156+
padding: 0;
157+
color: var(--muted);
158+
background: none;
159+
border: none;
160+
border-radius: var(--radius-sm);
161+
}
162+
163+
.agent-chat__goal-action:hover {
164+
color: var(--text);
165+
background: color-mix(in srgb, var(--text) 10%, transparent);
166+
}
167+
168+
.agent-chat__goal-action svg {
169+
width: 14px;
170+
height: 14px;
171+
stroke: currentColor;
172+
fill: none;
173+
stroke-width: 1.75px;
174+
stroke-linecap: round;
175+
stroke-linejoin: round;
176+
}
177+
178+
.agent-chat__goal-detail {
179+
display: block;
180+
interpolate-size: allow-keywords;
181+
block-size: 0;
182+
overflow: hidden;
183+
opacity: 0;
184+
transform: translateY(-4px);
185+
transition:
186+
block-size 180ms cubic-bezier(0.23, 1, 0.32, 1),
187+
opacity 140ms cubic-bezier(0.23, 1, 0.32, 1),
188+
transform 180ms cubic-bezier(0.23, 1, 0.32, 1);
189+
}
190+
191+
.agent-chat__goal-detail[data-expanded="true"] {
192+
block-size: auto;
193+
opacity: 1;
194+
transform: translateY(0);
195+
}
196+
197+
.agent-chat__goal-detail-content {
198+
display: flex;
199+
flex-direction: column;
200+
gap: 5px;
201+
padding: 0 18px 14px;
202+
color: var(--text);
203+
}
204+
205+
@media (prefers-reduced-motion: reduce) {
206+
.agent-chat__goal-detail {
207+
transform: none;
208+
transition: none;
209+
}
210+
}
211+
212+
.agent-chat__goal-detail-objective {
213+
font-size: 13px;
214+
font-weight: 500;
215+
line-height: 1.45;
216+
white-space: pre-wrap;
217+
overflow-wrap: anywhere;
218+
}
219+
220+
.agent-chat__goal-detail-note,
221+
.agent-chat__goal-detail-meta {
222+
color: var(--muted);
223+
font-size: 12px;
224+
line-height: 1.4;
225+
overflow-wrap: anywhere;
226+
}
227+
228+
.agent-chat__goal--active {
229+
color: var(--text);
230+
background: var(--chat-composer-surface, var(--card));
231+
border-color: color-mix(in srgb, var(--text-strong) 11%, var(--border));
232+
}
233+
234+
.agent-chat__goal--active .agent-chat__goal-icon,
235+
.agent-chat__goal--active .agent-chat__goal-actions {
236+
color: var(--muted);
237+
}
238+
239+
.agent-chat__goal--blocked,
240+
.agent-chat__goal--budget_limited,
241+
.agent-chat__goal--usage_limited {
242+
color: var(--warn);
243+
background: color-mix(in srgb, var(--warn) 10%, var(--card));
244+
border-color: color-mix(in srgb, var(--warn) 30%, var(--border));
245+
}
246+
247+
.agent-chat__goal--complete {
248+
color: color-mix(in srgb, var(--ok) 72%, var(--text));
249+
}
250+
52251
.agent-chat__goal-float {
53252
--chat-goal-underlap: 18px;
54253

0 commit comments

Comments
 (0)