diff --git a/docs/sentrapedia-ui.md b/docs/sentrapedia-ui.md index 3d9668b..9a4ee81 100644 --- a/docs/sentrapedia-ui.md +++ b/docs/sentrapedia-ui.md @@ -174,3 +174,30 @@ Lanjutan audit (#5, #6, #9-#12), status REVIEW: - Catatan usang "Hubungkan AI Clinical" pada jawaban pertanyaan dihapus. Verifikasi: vitest 849 lulus, 23 dilewati (data privat); lint dan typecheck bersih; tinggi toolbar diukur di browser pada 1440, 1210, 1024 (satu baris) dan 390 px (dua baris, sesuai desain HP). + +## Design audit fixes (2026-11-27) + +From the 2026-11-26 design audit (recommendations 1-4; token migration waits for the brand decision). All in `src/app/globals.css` unless named. + +- Mode chips wrap at 760px and below, so every chip is visible on a phone; wider screens keep the scrolling row with its fade. +- An unconfigured analysis service reads "Layanan analisis belum tersambung. Pertanyaan Anda tetap tersimpan; …" (`src/lib/aadi/gateway.ts`), and the composer shows the message and its recovery actions ("Coba lagi", "Susun draf SOAP lokal") as separate elements, the actions as buttons (`src/components/composer.tsx`). +- The composer and feedback fields, links and selects carry the 2px `--workspace-focus` ring. +- At 760px and below sidebar rows, encounter rows, icon buttons and the feedback field reach `--target-min` (44px). `--submenu-row` sets the encounter row height, its tree line and the active-branch indicator together (`src/components/sidebar-submenu.tsx`). +- Above 760px the home composer's `/` picker opens below it; on a phone and in chat it opens upward. +- At 600px and below dialog actions stack full width in DOM order, so focus order matches what is seen. + +Tests: `tests/ui/design-audit-fixes.test.tsx`, plus the NOT_CONFIGURED wording in `tests/aadi-guardrails.test.ts`. Browser check at 390/768/1440 px with Playwright and axe-core (0 violations on the audited screens). + +## Design standard (Gaffer, 2026-11-26) + +The current "Glass" look is the approved design standard for the workspace: Geist for text and Plus Jakarta Sans for titles, the Tosca accent (`--color-action-primary` #40e0d0, `--workspace-accent-ink` #086b61), `--radius-control` 8px and `--radius-structure` 12px, and the overrides in `src/app/globals.css` `:root`. There is no planned migration to the Swiss foundation look (Archivo, 0/2px radii, ink primary). The admission pages (`src/app/auth.css`) keep the marketing site's Inter voice on purpose. + +`src/app/sentra-tokens.css` (Sentraverse UI Foundation Tokens v1.0) is still imported and supplies the semantic variables that `globals.css` overrides. Its values are not the standard where `globals.css` overrides them. These groups are defined there but unused by the workspace as of 2026-11-26: + +- Spacing `--space-1…9`: components use literal px values. +- Motion `--motion-duration-*`, `--motion-easing-standard`: transitions use literal durations. +- Breakpoints 640/1024/1440 (comment only): media queries use their own widths, mainly 600, 760, 900 and 1200px. +- Type `--font-family-*`, `--font-size-*`, `--letter-spacing-*`: the workspace uses `--font-body`, `--font-title` and its own `--text-*` scale. +- Dark theme `[data-theme="dark"]`: nothing sets `data-theme`, so the workspace is light only. + +Used from it: `--target-min` (44px touch targets), and the semantic colour names that `globals.css` re-points. Code changes keep following `globals.css`; whether the unused groups are adopted or removed is a separate decision. diff --git a/src/app/globals.css b/src/app/globals.css index 06fbae1..e78d3f3 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -435,11 +435,11 @@ label.button:has(input:focus-visible) { outline: 2px solid var(--workspace-focus .submenu-section[data-open="true"] .submenu-body { grid-template-rows: 1fr; opacity: 1; } .submenu-clip { min-height: 0; overflow: hidden; } .submenu-items { position: relative; padding: 0 0 6px 14px; } -.submenu-item { height: 34px; display: flex; align-items: center; position: relative; gap: 2px; opacity: 0; transform: translateY(-4px); transition: opacity 280ms ease-out, transform 280ms cubic-bezier(.23, 1, .32, 1); } +.submenu-item { height: var(--submenu-row); display: flex; align-items: center; position: relative; gap: 2px; opacity: 0; transform: translateY(-4px); transition: opacity 280ms ease-out, transform 280ms cubic-bezier(.23, 1, .32, 1); } .submenu-section[data-open="true"] .submenu-item { opacity: 1; transform: translateY(0); transition-delay: calc(40ms + min(var(--item-order), 8) * 35ms); } .submenu-item::before { content: ""; position: absolute; left: -10px; top: 0; height: 100%; border-left: 1px solid var(--color-border-subtle); } -.submenu-item:last-child::before { height: 17px; } -.submenu-item::after { content: ""; position: absolute; left: -10px; top: 9px; width: 9px; height: 8px; border-left: 1px solid var(--color-border-subtle); border-bottom: 1px solid var(--color-border-subtle); border-bottom-left-radius: var(--radius); pointer-events: none; } +.submenu-item:last-child::before { height: calc(var(--submenu-row) / 2); } +.submenu-item::after { content: ""; position: absolute; left: -10px; top: calc(var(--submenu-row) / 2 - 8px); width: 9px; height: 8px; border-left: 1px solid var(--color-border-subtle); border-bottom: 1px solid var(--color-border-subtle); border-bottom-left-radius: var(--radius); pointer-events: none; } .submenu-item > button:first-child { min-width: 0; flex: 1; height: 32px; display: flex; align-items: center; gap: 7px; padding: 6px; border-radius: var(--radius); text-align: left; font-size: var(--text-sm); } .submenu-item > button:first-child > span:first-of-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; } .submenu-item:hover > button:first-child, .submenu-item[data-active="true"] > button:first-child { background: var(--workspace-accent-soft); color: var(--workspace-accent-ink); } @@ -814,3 +814,36 @@ label.button:has(input:focus-visible) { outline: 2px solid var(--workspace-focus html[data-printing] [data-print-target] .message-actions, html[data-printing] [data-print-target] .pipeline-trace { display: none; } html[data-printing] [data-print-target]::before { content: attr(data-print-status); display: block; margin-bottom: 12px; font-size: 12px; font-weight: 600; color: var(--color-text-secondary); } } + +/* Design audit fixes (2026-11-27; audit findings H1, H2, H3, S1, D1, D2). */ +/* One encounter-row height drives the row, its tree line and the active-branch indicator (sidebar-submenu.tsx). */ +:root { --submenu-row: 34px; } +/* The composer and feedback fields draw no ring of their own, so the field box carries the same 2px ring as buttons. */ +.composer:focus-within, .feedback:focus-within { outline: 2px solid var(--workspace-focus); outline-offset: 2px; } +a:focus-visible, select:focus-visible { outline: 2px solid var(--workspace-focus); outline-offset: 2px; } +/* Analysis error: the message, then its recovery actions as real buttons on their own row. */ +.form-warning-message { margin: 0; } +.form-warning-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; } +.form-warning-actions .button { min-height: 32px; padding: 4px 11px; background: var(--workspace-white); color: var(--color-text-primary); font-size: var(--text-sm); } +/* On a wide screen the home composer sits near the top of the canvas, so the / picker opens below it. On a phone the + composer sits low, so the picker keeps opening upward, as the chat composer's always does. */ +@media (min-width: 761px) { .home-content .slash-picker { top: calc(100% + 4px); bottom: auto; } } +@media (max-width: 760px) { + :root { --submenu-row: var(--target-min); } + /* Every mode chip stays visible on a phone: the row wraps instead of scrolling behind a fade. */ + .chip-row { flex-wrap: wrap; overflow-x: visible; mask-image: none; } + .chip-row::after { content: none; } + .main-nav > button, .main-nav > a { height: auto; min-height: var(--target-min); } + .small-icon { min-width: var(--target-min); min-height: var(--target-min); } + .submenu-heading > button:first-child { min-height: var(--target-min); } + .sidebar .icon-button { min-width: var(--target-min); min-height: var(--target-min); } + .empty-text { min-height: var(--target-min); align-items: center; } + .feedback { height: auto; min-height: var(--target-min); } + .feedback button { min-width: var(--target-min); } + .submenu-item > button:first-child { height: auto; min-height: var(--target-min); } +} +@media (max-width: 600px) { + /* Stacked in DOM order, so the focus order matches what is seen; the destructive action stands apart at the top. */ + .dialog-footer { flex-direction: column; align-items: stretch; } + .dialog-footer .push-left { margin: 0 0 8px; } +} diff --git a/src/components/composer.tsx b/src/components/composer.tsx index adbc060..5e6f3e1 100644 --- a/src/components/composer.tsx +++ b/src/components/composer.tsx @@ -75,7 +75,7 @@ export function Composer(props: Props) { {dictation.error &&

{dictation.error}

} {props.aadiEnabled &&

Sebelum mengirim ke layanan AI, hapus identitas pasien dari pertanyaan, catatan, dan konteks.

} {props.mismatch &&

Data usia/jenis kelamin berbeda dari encounter ini.

} - {props.aadiEnabled && props.analysisError &&

{props.analysisError} {props.prompt.trim() && !props.busy && <> {props.onFallback && }}

} + {props.aadiEnabled && props.analysisError &&

{props.analysisError}

{props.prompt.trim() && !props.busy &&
{props.onFallback && }
}
} {/* Options are the rows themselves: focus stays in the textarea, which points at the active row. */} {slashOpen &&
{groups.map((group, g) =>
{group.options.map((item, i) => { const at = groups.slice(0, g).reduce((n, earlier) => n + earlier.options.length, 0) + i; return
event.preventDefault()} onClick={() => choose(item.key)}>{item.label}{item.key === current ? : item.hint && {item.hint}}
; })}
)}{!options.length &&

Tidak ada templat yang cocok.

}
} ; diff --git a/src/components/sidebar-submenu.tsx b/src/components/sidebar-submenu.tsx index f01c569..8b905fd 100644 --- a/src/components/sidebar-submenu.tsx +++ b/src/components/sidebar-submenu.tsx @@ -24,7 +24,7 @@ export function SidebarSubmenu({ sections, initialSection }: { sections: Submenu
{section.action}
- {selectedIndex >= 0 &&