Skip to content

Commit 20e0350

Browse files
committed
Refactor UI components and remove deprecated elements for improved clarity
- Updated `smoke-disciplinas-browser.mjs` to enhance the online status check by removing the status badge dependency and focusing on the send button and message input. - Refactored CSS in `discipline-panel.css` and `theme.css` to remove outdated styles related to the active discipline badge, improving overall design consistency. - Adjusted `entrance.js` and `ui.js` to eliminate references to the status badge and active discipline badge, streamlining the initialization process. - Enhanced `StatusBadge.js` to maintain API compatibility while removing UI elements, ensuring cleaner code and better maintainability. - Updated `index.html` to reflect the removal of the active discipline badge and status badge, improving accessibility and user experience.
1 parent 4936506 commit 20e0350

15 files changed

Lines changed: 175 additions & 200 deletions

bin/smoke-disciplinas-browser.mjs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,9 @@ async function preparePage(page) {
158158
async function waitForOnline(page, timeoutMs = 90_000) {
159159
await page.waitForFunction(
160160
() => {
161-
const badge = document.getElementById("status-badge");
162161
const send = document.getElementById("send-button");
163-
return badge?.textContent?.trim() === "Online" && send && !send.disabled;
162+
const input = document.getElementById("message-input");
163+
return send && !send.disabled && input;
164164
},
165165
{ timeout: timeoutMs },
166166
);
@@ -210,9 +210,9 @@ async function askQuestion(page, question, index, disciplineId) {
210210
await page.waitForTimeout(200);
211211

212212
const feBeforeSend = await page.evaluate(() => ({
213-
status: document.getElementById("status-badge")?.textContent?.trim(),
214-
activeDiscipline: document.querySelector(".active-discipline-badge__label")?.textContent?.trim() || null,
215-
activeBadgeVisible: document.getElementById("active-discipline-badge")?.hidden === false,
213+
sendReady: Boolean(document.getElementById("send-button") && !document.getElementById("send-button")?.disabled),
214+
activeDiscipline: document.querySelector(".silo-pill__name")?.textContent?.trim() || null,
215+
siloPillVisible: document.getElementById("silo-pill")?.hidden === false,
216216
scopeItems: document.querySelectorAll("#scope-menu-list .scope-option").length,
217217
sendDisabled: document.getElementById("send-button")?.disabled,
218218
}));
@@ -255,7 +255,6 @@ async function askQuestion(page, question, index, disciplineId) {
255255
richSources: botRow?.querySelectorAll(".source-card--rich").length || 0,
256256
sourcesHeading: botRow?.querySelector(".message-sources__heading")?.textContent?.trim() || null,
257257
sourceMeta,
258-
status: document.getElementById("status-badge")?.textContent?.trim(),
259258
pinVisible: document.getElementById("context-pin-badge")?.hidden === false,
260259
thinkingSeen: !!document.querySelector(".thinking-indicator"),
261260
};
@@ -269,7 +268,6 @@ async function askQuestion(page, question, index, disciplineId) {
269268
feAfter = await page.evaluate(() => ({
270269
userText: document.querySelector(".message-row.user .message")?.textContent?.trim(),
271270
botLen: [...document.querySelectorAll(".message-row.bot .message")].pop()?.textContent?.length || 0,
272-
status: document.getElementById("status-badge")?.textContent?.trim(),
273271
}));
274272
}
275273

@@ -296,11 +294,11 @@ async function askQuestion(page, question, index, disciplineId) {
296294
pageErrors,
297295
networkLog,
298296
checks: {
299-
statusOnline: (feAfter.status || feBeforeSend.status) === "Online",
297+
sendReady: feBeforeSend.sendReady,
300298
userMessageMatch: feAfter.userText === question,
301299
gotBotReply: (feAfter.botLen || 0) > 20,
302300
scopeMenuPopulated: feBeforeSend.scopeItems >= 7,
303-
activeBadgeWhenCommand: !hasCommand || feBeforeSend.activeBadgeVisible,
301+
siloPillWhenCommand: !hasCommand || feBeforeSend.siloPillVisible,
304302
hasSources: (feAfter.richSources || 0) > 0 || (sources.length || 0) > 0,
305303
},
306304
},
@@ -380,7 +378,7 @@ async function main() {
380378
(r) =>
381379
r.frontend.consoleErrors.length ||
382380
r.frontend.pageErrors.length ||
383-
!r.frontend.checks.statusOnline ||
381+
!r.frontend.checks.sendReady ||
384382
!r.frontend.checks.gotBotReply,
385383
).length,
386384
byDiscipline: DISCIPLINES.map((d) => {

frontend/assets/css/discipline-panel.css

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -160,19 +160,6 @@
160160
background: var(--brand-surface);
161161
}
162162

163-
.active-discipline-badge {
164-
cursor: pointer;
165-
}
166-
167-
.active-discipline-badge:focus-visible {
168-
outline: 2px solid var(--brand-primary);
169-
outline-offset: 2px;
170-
}
171-
172-
.active-discipline-badge--panel-open {
173-
box-shadow: 0 0 0 1px var(--brand-primary);
174-
}
175-
176163
@media (prefers-reduced-motion: reduce) {
177164
.discipline-panel {
178165
transition: none;

frontend/assets/css/entrance.css

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ body.ui-landing .app .entrance-suggestion {
105105
font-size: 0.92rem;
106106
font-weight: 600;
107107
line-height: 1.35;
108-
color: #e4e4e7;
108+
color: var(--text);
109109
word-wrap: break-word;
110110
overflow-wrap: anywhere;
111111
}
@@ -114,7 +114,7 @@ body.ui-landing .app .entrance-suggestion {
114114
font-size: 0.84rem;
115115
font-weight: 500;
116116
line-height: 1.3;
117-
color: #f4f4f5;
117+
color: var(--white);
118118
}
119119

120120
/* Keep all the real UI above the globe backdrop. */
@@ -165,7 +165,7 @@ body.ui-landing .app .entrance-suggestion {
165165
font-size: 0.72rem;
166166
letter-spacing: 0.42em;
167167
font-weight: 600;
168-
color: #ffffff;
168+
color: var(--white);
169169
opacity: 0.85;
170170
margin-bottom: 14px;
171171
}
@@ -175,7 +175,7 @@ body.ui-landing .app .entrance-suggestion {
175175
line-height: 1.12;
176176
font-weight: 700;
177177
letter-spacing: -0.01em;
178-
background: linear-gradient(120deg, #ffffff 0%, #d9dadf 45%, #a9aab0 100%);
178+
background: linear-gradient(120deg, var(--white) 0%, #d9dadf 45%, #a9aab0 100%);
179179
-webkit-background-clip: text;
180180
background-clip: text;
181181
color: transparent;
@@ -219,7 +219,7 @@ body.ui-landing .app .entrance-suggestion {
219219

220220
.entrance-discipline-pills .cmd-pill:hover {
221221
border-color: var(--brand-primary);
222-
color: #fff;
222+
color: var(--white);
223223
background: var(--brand-surface);
224224
}
225225

frontend/assets/css/theme.css

Lines changed: 46 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
/* Brand accent: #B0933E — use tokens, never hardcode. Error red is semantic only (--error). */
33
:root {
44
--bg: #0a0a0a;
5+
--white: #F5F5F5;
56
--surface: #27272A;
67
--surface-2: #2F2F33;
78
--border: #3F3F46;
@@ -13,7 +14,7 @@
1314
--accent: var(--brand-primary);
1415
--color-hint: var(--text-muted);
1516
--color-code-inline: #D4BC82;
16-
--text: #E4E4E7;
17+
--text: var(--white);
1718
--text-muted: #B4B4BC;
1819
--bot-bg: #27272A;
1920
--error: #F87171;
@@ -157,7 +158,7 @@ body.ui-landing .header-conversation-label {
157158
margin-bottom: 0;
158159
}
159160

160-
/* Pinned-context badge — same look as the silo: gray bg, white icon + text. */
161+
/* Pinned-context badge — same look as the silo: gray bg, bright icon + text. */
161162
.context-pin-badge {
162163
display: inline-flex;
163164
align-items: center;
@@ -186,68 +187,6 @@ body.ui-landing .header-conversation-label {
186187
white-space: nowrap;
187188
}
188189

189-
.header-badge {
190-
font-size: 11px;
191-
font-weight: 600;
192-
padding: 3px 8px;
193-
border: 1px solid var(--border);
194-
color: var(--text-muted);
195-
text-transform: uppercase;
196-
border-radius: var(--radius-2xl);
197-
}
198-
199-
.header-badge.online {
200-
border-color: var(--success);
201-
color: var(--success);
202-
}
203-
204-
.header-badge.warning {
205-
border-color: var(--warning);
206-
color: var(--warning);
207-
background: var(--warning-bg);
208-
}
209-
210-
/* ===== Disciplina activa (header) ===== */
211-
.active-discipline-badge {
212-
display: inline-flex;
213-
align-items: center;
214-
gap: 8px;
215-
max-width: min(52vw, 320px);
216-
padding: 4px 10px;
217-
border: 1px solid var(--accent);
218-
background: var(--brand-surface);
219-
font-size: 11px;
220-
font-weight: 500;
221-
color: var(--text);
222-
overflow: hidden;
223-
}
224-
225-
.active-discipline-badge[hidden] {
226-
display: none;
227-
}
228-
229-
.active-discipline-badge__dot {
230-
width: 7px;
231-
height: 7px;
232-
border-radius: 50%;
233-
background: var(--accent);
234-
flex-shrink: 0;
235-
box-shadow: 0 0 8px var(--brand-muted);
236-
}
237-
238-
.active-discipline-badge__label {
239-
overflow: hidden;
240-
text-overflow: ellipsis;
241-
white-space: nowrap;
242-
}
243-
244-
.active-discipline-badge__cmd {
245-
font-family: var(--font-mono);
246-
font-size: 10px;
247-
color: var(--text-muted);
248-
flex-shrink: 0;
249-
}
250-
251190
/* ===== Chat Area ===== */
252191
.chat-box {
253192
overflow-y: auto;
@@ -439,18 +378,9 @@ body.ui-landing .header-conversation-label {
439378
.message-toolbar {
440379
display: flex;
441380
gap: 6px;
442-
opacity: 0;
443-
pointer-events: none;
444-
transition: opacity 0.15s ease;
445381
margin-top: 2px;
446382
}
447383

448-
.message-row:hover .message-toolbar,
449-
.message-row:focus-within .message-toolbar {
450-
opacity: 1;
451-
pointer-events: auto;
452-
}
453-
454384
.message-row.user .message-toolbar {
455385
justify-content: flex-end;
456386
max-width: 82%;
@@ -462,18 +392,48 @@ body.ui-landing .header-conversation-label {
462392
}
463393

464394
.message-toolbar__btn {
465-
font-size: 10px;
466-
padding: 2px 8px;
467-
border: 1px solid var(--border);
395+
display: inline-flex;
396+
align-items: center;
397+
justify-content: center;
398+
width: 28px;
399+
height: 28px;
400+
padding: 0;
401+
border: none;
468402
border-radius: var(--radius-sm);
469403
background: transparent;
470404
color: var(--text-muted);
471405
cursor: pointer;
406+
transition: opacity 0.15s ease;
472407
}
473408

474-
.message-toolbar__btn:hover {
475-
color: var(--text);
476-
border-color: var(--brand-muted);
409+
.message-toolbar__icon {
410+
display: block;
411+
width: 14px;
412+
height: 14px;
413+
object-fit: contain;
414+
opacity: 0.72;
415+
pointer-events: none;
416+
transition: opacity 0.22s cubic-bezier(0.22, 1, 0.36, 1),
417+
transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
418+
transform: scale(1);
419+
}
420+
421+
.message-toolbar__icon--fade {
422+
opacity: 0 !important;
423+
transform: scale(0.88);
424+
}
425+
426+
.message-toolbar__btn:hover .message-toolbar__icon {
427+
opacity: 1;
428+
}
429+
430+
.message-toolbar__btn--copied .message-toolbar__icon {
431+
opacity: 1;
432+
}
433+
434+
.message-toolbar__btn:focus-visible {
435+
outline: 2px solid var(--brand-primary);
436+
outline-offset: 2px;
477437
}
478438

479439
.acl-disclaimer-collapsible {
@@ -595,12 +555,6 @@ body.ui-landing .header-conversation-label {
595555
animation: fade-in-up 1s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
596556
}
597557

598-
body.chat-active .input-area {
599-
max-width: min(var(--chat-read-max), 82%);
600-
margin-left: 24px;
601-
margin-right: auto;
602-
}
603-
604558
body.chat-active .composer-wrap {
605559
max-width: 100%;
606560
}
@@ -787,16 +741,10 @@ body.chat-active .composer-wrap {
787741

788742
#send-button.send-button--streaming::after {
789743
content: "";
790-
width: 16px;
791-
height: 16px;
792-
border: 2px solid rgba(10, 10, 10, 0.25);
793-
border-top-color: var(--brand-on-primary);
794-
border-radius: 50%;
795-
animation: send-spin 0.75s linear infinite;
796-
}
797-
798-
@keyframes send-spin {
799-
to { transform: rotate(360deg); }
744+
width: 14px;
745+
height: 14px;
746+
border-radius: 2px;
747+
background: var(--brand-on-primary);
800748
}
801749

802750
.composer-input--streaming {
@@ -1702,7 +1650,7 @@ body.chat-active .app-shell {
17021650
border: none;
17031651
border-radius: var(--radius-md);
17041652
background: transparent;
1705-
color: #E1E2E6;
1653+
color: var(--text);
17061654
cursor: pointer;
17071655
flex-shrink: 0;
17081656
transition: background 0.15s ease, opacity 0.15s ease;
@@ -1829,7 +1777,7 @@ body.chat-active .app-shell {
18291777
border: none;
18301778
border-radius: var(--radius-md);
18311779
background: transparent;
1832-
color: #E1E2E6;
1780+
color: var(--text);
18331781
cursor: pointer;
18341782
transition: background 0.15s ease;
18351783
}
@@ -2305,11 +2253,6 @@ textarea:focus-visible,
23052253
padding: 5px;
23062254
}
23072255

2308-
body.chat-active .input-area {
2309-
margin-left: 16px;
2310-
max-width: min(var(--chat-read-max), 94%);
2311-
}
2312-
23132256
.input-row {
23142257
gap: 6px;
23152258
padding: 3px 4px 3px 3px;
@@ -2361,12 +2304,9 @@ textarea:focus-visible,
23612304
transform: none;
23622305
}
23632306

2364-
#send-button.send-button--streaming::after {
2365-
animation: none;
2366-
}
2367-
23682307
.scroll-to-bottom-fab,
23692308
.message-toolbar,
2309+
.message-toolbar__icon,
23702310
.conversation-sidebar__menu-trigger,
23712311
.code-copy-btn {
23722312
transition: none;
Lines changed: 2 additions & 2 deletions
Loading
Lines changed: 4 additions & 0 deletions
Loading

frontend/assets/images/ok_icon.svg

Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 4 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)