Skip to content

Commit 5ec5d1d

Browse files
committed
chore(app): debug window
1 parent d2c765e commit 5ec5d1d

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

packages/app/src/components/debug-bar.tsx

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,19 @@ const bad = (n: number | undefined, limit: number, low = false) => {
4949

5050
const session = (path: string) => path.includes("/session")
5151

52-
function Cell(props: { bad?: boolean; dim?: boolean; label: string; tip: string; value: string }) {
52+
function Cell(props: { bad?: boolean; dim?: boolean; label: string; tip: string; value: string; wide?: boolean }) {
5353
return (
54-
<Tooltip value={props.tip} placement="left">
55-
<div class="flex w-full flex-col items-center px-0.5 py-1 text-center">
56-
<div class="text-[7px] font-black uppercase tracking-[0.04em] opacity-70 leading-none">{props.label}</div>
54+
<Tooltip value={props.tip} placement="top">
55+
<div
56+
classList={{
57+
"flex min-h-[42px] w-full min-w-0 flex-col items-center justify-center rounded-[8px] bg-white/5 px-0.5 py-1 text-center": true,
58+
"col-span-2": !!props.wide,
59+
}}
60+
>
61+
<div class="text-[10px] leading-none font-black uppercase tracking-[0.04em] opacity-70">{props.label}</div>
5762
<div
5863
classList={{
59-
"text-[9px] font-semibold leading-none tabular-nums": true,
64+
"text-[13px] leading-none font-bold tabular-nums sm:text-[14px]": true,
6065
"text-text-on-critical-base": !!props.bad,
6166
"opacity-70": !!props.dim,
6267
}}
@@ -355,10 +360,13 @@ export function DebugBar() {
355360
return (
356361
<aside
357362
aria-label="Development performance diagnostics"
358-
class="pointer-events-auto h-full min-h-0 w-[36px] shrink-0 overflow-y-auto text-text-on-interactive-base no-scrollbar sm:w-[38px]"
359-
style={{ "background-color": "color-mix(in srgb, var(--icon-interactive-base) 42%, black)" }}
363+
class="pointer-events-auto fixed bottom-3 right-3 z-50 w-[308px] max-w-[calc(100vw-1.5rem)] overflow-hidden rounded-xl border p-0.5 text-text-on-interactive-base shadow-[var(--shadow-lg-border-base)] sm:bottom-4 sm:right-4 sm:w-[324px]"
364+
style={{
365+
"background-color": "color-mix(in srgb, var(--icon-interactive-base) 42%, black)",
366+
"border-color": "color-mix(in srgb, white 14%, transparent)",
367+
}}
360368
>
361-
<div class="flex min-h-full flex-col gap-0.5 py-2 font-mono">
369+
<div class="grid grid-cols-5 gap-px font-mono">
362370
<Cell
363371
label="NAV"
364372
tip="Last completed route transition touching a session page, measured from router start until the first paint after it settles."
@@ -425,6 +433,7 @@ export function DebugBar() {
425433
value={heapv()}
426434
bad={bad(heap(), 0.8)}
427435
dim={state.heap.used === undefined}
436+
wide
428437
/>
429438
</div>
430439
</aside>

0 commit comments

Comments
 (0)