Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ frontend/ Next.js 16. Lee Supabase con la clave anon, bajo RLS.
api/hooks/ los mismos, envueltos en TanStack Query
components/ atoms / organisms / screens
lib/ui.ts TODA conversión de unidades, en un solo sitio
styles/colors.css TODOS los colores (tema claro y oscuro), en un solo sitio
lib/pallet.ts geometría del dibujo; el tamaño del palé NO es fijo
lib/supabase.ts los tipos, que son la mitad del contrato

Expand Down Expand Up @@ -209,10 +210,18 @@ evolución en vez de borrón y cuenta nueva.

- Python 3.11, type hints en las firmas públicas. TypeScript estricto en el front.
- Unidades SI en el dato, milímetros y grados en la pantalla.
- **Colores solo como variables, y definidas en un único archivo:** `frontend/styles/colors.css`.
Ningún otro archivo (CSS, TS, TSX) lleva `#hex`, `rgb()`, `hsl()` ni un color con nombre;
consume `var(--…)`. Un color con transparencia es otra variable de ese archivo, calculada
con `color-mix` desde la base. `npm run lint` lo comprueba (`scripts/check-colors.mjs`).
- Nombres de código en inglés; comentarios y documentos en castellano.
- Commits pequeños, con números cuando toquen comportamiento.
- El diseño de referencia es `docs/design/observality-platform-design.html`: un bundle
autoextraíble con 11 tableros. Se abre en el navegador.
autoextraíble con 11 tableros. Se abre en el navegador. Manda en la **estructura y el
contenido** de cada pantalla; **no** en el aspecto: la identidad visual es la del logo de
STACKSPECT (blanco y negro, esquinas suaves, Plus Jakarta Sans y Geist Mono), con tema
claro y oscuro. El color con significado (estados, oracle, sembrado, causas de fallo) se
conserva en los dos temas. `npm run lint:contrast` garantiza el contraste AA.

---

Expand Down
Binary file modified frontend/app/favicon.ico
Binary file not shown.
103 changes: 40 additions & 63 deletions frontend/app/globals.css
Original file line number Diff line number Diff line change
@@ -1,55 +1,23 @@
/*
* Sistema visual de la plataforma. Los valores salen literales del tablero
* "Lenguaje visual" de docs/design/, no son aproximaciones.
* Estilos globales de la plataforma. Los colores NO se definen aquí: viven todos en
* styles/colors.css, y este archivo (como cualquier otro) solo los consume con `var(--…)`.
*
* Sala de control industrial: fondo oscuro, sin adornos, sin degradados. La interfaz
* se compromete con un solo tema a propósito —es un panel de planta, no un documento—
* y por eso pinta todos sus colores explícitamente en vez de heredar ninguno.
* Lenguaje visual: limpio y amable. Superficies blancas (o casi negras) con esquinas
* suaves, mucho aire, poco borde y ninguna sombra que grite. Texto en una sans redondeada;
* magnitudes en una mono suave, con cifras de ancho fijo para que no bailen en vivo.
*/

:root {
/* Neutros */
--bg: #0F1214;
--surface: #161A1E;
--topbar: #141A1E;
--border: #232B31;
--border-soft: #1F272C;
--border-hard: #3E4B56;
--row-alt: #171C21;
--row-hover: #1A2026;

--text: #E6EAED;
--text-2: #9FAAB2;
--text-3: #8B979F;
--text-4: #6E7A82;
--text-5: #46525A;

/* Azul acero: SOLO selección e interacción. Nunca significa estado. */
--select: #5B9DD9;
--link: #6FA8D8;

/* Semántica de color: tres significados y ninguno más. */
--ok: #2FBF71;
--warn: #E8A93A;
--bad: #F2544B;

/* Números que no son de verdad. Molestan a la vista a propósito. */
--oracle: #E5399B;
--synthetic: #B77BF3;

/* Una identidad de color por causa de fallo, constante en toda la aplicación.
Se reconocen de un vistazo al pasar de una pantalla a otra. */
--f-no_detection: #7A8B99;
--f-grasp_slip: #C9A227;
--f-ik_unreachable: #5B9DD9;
--f-wrong_placement: #8C7AE6;
--f-collision: #B5485E;
--f-stack_collapse: #FF7A45;
--f-timeout: #4A5A66;
--f-overhang_violation: #00A9A5;
--f-place_inaccurate: #A0785A;

color-scheme: dark;
/* Radios: tres tamaños y nada más. Los controles pequeños, las tarjetas y lo grande. */
--radius-1: 8px;
--radius-2: 12px;
--radius-3: 16px;
--radius-pill: 999px;

/* Espaciado de página: el aire que rodea las pantallas. */
--page-gap: 20px;
--page-pad: 32px;
--topbar-h: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
Expand All @@ -60,45 +28,54 @@ body {
min-height: 100%;
background: var(--bg);
color: var(--text);
font-family: var(--font-plex-sans), system-ui, sans-serif;
font-family: var(--font-sans), system-ui, sans-serif;
font-size: 14px;
line-height: 1.4;
line-height: 1.45;
-webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: #9CC6E8; }
/* Un cambio de tema se nota, pero no deslumbra: los colores se funden. */
body, header, main, section, table, td, th, select, button, label {
transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

a {
color: var(--link);
text-decoration: underline;
text-decoration-color: var(--border-hard);
text-underline-offset: 3px;
}
a:hover { color: var(--link-hover); text-decoration-color: currentColor; }

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

:focus-visible { outline: 2px solid var(--select); outline-offset: 1px; }
:focus-visible { outline: 2px solid var(--select); outline-offset: 2px; border-radius: 4px; }

/* ── piezas compartidas ─────────────────────────────────────────────────── */
/* ── piezas heredadas ────────────────────────────────────────────────────
Las usan Episode.tsx y Runs.tsx, que esperan a las rutas de detalle. Los componentes
nuevos no las necesitan: llevan su propio módulo. */

.card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius-3);
box-shadow: var(--elev-1);
display: flex;
flex-direction: column;
min-width: 0;
}

/* Etiquetas y cabeceras: condensada, versal, muy espaciada. */
.label {
font-family: var(--font-plex-condensed), var(--font-plex-sans), sans-serif;
font-size: 11px;
font-weight: 600;
letter-spacing: 0.13em;
text-transform: uppercase;
font-family: var(--font-sans), system-ui, sans-serif;
font-size: 12.5px;
font-weight: 500;
color: var(--text-3);
}

.mono { font-family: var(--font-plex-mono), ui-monospace, monospace; }
.mono { font-family: var(--font-mono), ui-monospace, monospace; }

/* Toda magnitud física. Monoespaciada y con cifras de ancho fijo para que al
refrescarse en vivo las columnas no bailen. */
.num {
font-family: var(--font-plex-mono), ui-monospace, monospace;
font-family: var(--font-mono), ui-monospace, monospace;
font-variant-numeric: tabular-nums;
}

Expand Down
Binary file added frontend/app/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 29 additions & 21 deletions frontend/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,43 +1,51 @@
import type { Metadata } from "next";
import { IBM_Plex_Mono, IBM_Plex_Sans, IBM_Plex_Sans_Condensed } from "next/font/google";
import { Geist_Mono, Plus_Jakarta_Sans } from "next/font/google";
import "@/styles/colors.css";
import "./globals.css";
import { AppHeader } from "@/components/screens/AppHeader";
import { Providers } from "./providers";

/* Las tres voces del diseño, cada una con su trabajo:
Sans para el texto de interfaz, Condensed para etiquetas y cabeceras en versal,
y Mono para TODA magnitud física, commit y semilla. */
const plexSans = IBM_Plex_Sans({
variable: "--font-plex-sans",
/* Dos voces, cada una con su trabajo:
Plus Jakarta Sans para el texto de interfaz —redondeada y amable, sin perder seriedad—
y Geist Mono para TODA magnitud física, commit y semilla. */
const sans = Plus_Jakarta_Sans({
variable: "--font-sans",
subsets: ["latin"],
weight: ["400", "500", "600"],
});

const plexCondensed = IBM_Plex_Sans_Condensed({
variable: "--font-plex-condensed",
subsets: ["latin"],
weight: ["500", "600"],
weight: ["400", "500", "600", "700"],
});

const plexMono = IBM_Plex_Mono({
variable: "--font-plex-mono",
const mono = Geist_Mono({
variable: "--font-mono",
subsets: ["latin"],
weight: ["400", "500", "600", "700"],
weight: ["400", "500", "600"],
});

export const metadata: Metadata = {
title: "Observabilidad de paletizado",
title: "STACKSPECT · Observabilidad de paletizado",
description:
"Monitorización de ejecuciones del brazo paletizador: centro de gravedad, " +
"estabilidad y curva de mejora entre commits.",
};

/* Fija el tema ANTES del primer pintado, para que no parpadee: el que eligió el usuario y,
si no eligió, el del sistema. Va como script en la cabecera y no como efecto de React,
que llegaría tarde. */
const THEME_SCRIPT = `(function () {
var theme;
try { theme = localStorage.getItem("theme"); } catch (e) {}
if (theme !== "light" && theme !== "dark") {
theme = window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches
? "dark" : "light";
}
document.documentElement.dataset.theme = theme;
})();`;

export default function RootLayout({ children }: LayoutProps<"/">) {
return (
<html
lang="es"
className={`${plexSans.variable} ${plexCondensed.variable} ${plexMono.variable}`}
>
<html lang="es" className={`${sans.variable} ${mono.variable}`} suppressHydrationWarning>
<head>
<script dangerouslySetInnerHTML={{ __html: THEME_SCRIPT }} />
</head>
<body>
<Providers>
<AppHeader />
Expand Down
10 changes: 5 additions & 5 deletions frontend/components/Episode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ export function CogTrace({ states, height = 220, cursor }: {

{[hi, 0, lo].map((v) => (
<text key={v} x={padL - 8} y={Y(v) + 3.5} textAnchor="end" fontSize={9.5}
fill="var(--text-5)" fontFamily="var(--font-plex-mono), monospace">
fill="var(--text-4)" fontFamily="var(--font-mono), monospace">
{v > 0 ? "+" : ""}{v.toFixed(0)}
</text>
))}
<text x={padL - 8} y={padT - 4} textAnchor="end" fontSize={9}
fill="var(--text-5)" fontFamily="var(--font-plex-mono), monospace">mm</text>
fill="var(--text-4)" fontFamily="var(--font-mono), monospace">mm</text>

<path d={line} fill="none" stroke="var(--select)" strokeWidth={1.8} />

Expand All @@ -72,12 +72,12 @@ export function CogTrace({ states, height = 220, cursor }: {
fill={`var(--${stabilityState(v / 1000)})`} />
))}

<text x={padL} y={height - 7} fontSize={9.5} fill="var(--text-5)"
fontFamily="var(--font-plex-mono), monospace">
<text x={padL} y={height - 7} fontSize={9.5} fill="var(--text-4)"
fontFamily="var(--font-mono), monospace">
paquete 1
</text>
<text x={w - padR} y={height - 7} textAnchor="end" fontSize={9.5}
fill="var(--text-5)" fontFamily="var(--font-plex-mono), monospace">
fill="var(--text-4)" fontFamily="var(--font-mono), monospace">
paquete {states.length}
</text>
</svg>
Expand Down
18 changes: 9 additions & 9 deletions frontend/components/atoms/Badge/Badge.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
display: inline-flex;
align-items: center;
gap: 7px;
padding: 3px 9px;
padding: 4px 12px;
border: 1px solid currentColor;
font-family: var(--font-plex-condensed), sans-serif;
font-size: 11px;
border-radius: var(--radius-pill);
font-family: var(--font-sans), system-ui, sans-serif;
font-size: 12px;
font-weight: 600;
letter-spacing: 0.13em;
text-transform: uppercase;
white-space: nowrap;
}
.neutral { color: var(--text-3); }
.ok { color: var(--ok); }
.bad { color: var(--bad); }
.ok { color: var(--ok); background: var(--ok-fill); }
.bad { color: var(--bad); background: var(--bad-fill-soft); }
.oracle { color: var(--oracle); }
.synthetic { color: var(--synthetic); }

.oracle { background: repeating-linear-gradient(135deg, rgba(229, 57, 155, 0.16) 0 7px, transparent 7px 14px); }
.synthetic { background: repeating-linear-gradient(135deg, rgba(183, 123, 243, 0.16) 0 7px, transparent 7px 14px); }
/* Los números que no son de verdad molestan a la vista a propósito. */
.oracle { background: repeating-linear-gradient(135deg, var(--oracle-stripe) 0 7px, transparent 7px 14px); }
.synthetic { background: repeating-linear-gradient(135deg, var(--synthetic-stripe) 0 7px, transparent 7px 14px); }
18 changes: 10 additions & 8 deletions frontend/components/atoms/Button/Button.module.css
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
.button {
font: inherit;
font-size: 13px;
font-size: 13.5px;
font-weight: 500;
cursor: pointer;
background: none;
border: 0;
padding: 0;
}
.button:disabled { cursor: not-allowed; opacity: 0.5; }
.button:disabled { cursor: not-allowed; opacity: 0.45; }

/* El azul acero marca interacción, y esto es interacción. */
.link { color: var(--select); }
.link:hover:not(:disabled) { color: var(--link); text-decoration: underline; }
.link { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.link:hover:not(:disabled) { color: var(--link-hover); }

.outline {
color: var(--text);
border: 1px solid var(--border-hard);
padding: 6px 12px;
background: var(--surface);
border: 1px solid var(--control-border);
border-radius: var(--radius-1);
padding: 8px 16px;
}
.outline:hover:not(:disabled) { border-color: var(--select); color: var(--select); }
.outline:hover:not(:disabled) { background: var(--row-hover); }
3 changes: 3 additions & 0 deletions frontend/components/atoms/Card/Card.module.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
.card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--radius-3);
box-shadow: var(--elev-1);
overflow: hidden; /* lo de dentro respeta las esquinas redondeadas */
display: flex;
flex-direction: column;
min-width: 0;
Expand Down
15 changes: 8 additions & 7 deletions frontend/components/atoms/Checkbox/Checkbox.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,25 @@

.box {
appearance: none;
width: 16px;
height: 16px;
width: 18px;
height: 18px;
margin: 0;
border: 1px solid var(--border-hard);
background: transparent;
border: 1.5px solid var(--control-border);
border-radius: 5px;
background: var(--surface);
cursor: inherit;
display: grid;
place-content: center;
}
.box:hover:not(:disabled) { border-color: var(--select); }

/* El azul acero marca selección: es justo su trabajo aquí. */
/* La tinta marca la selección: es justo su trabajo aquí. */
.box:checked { background: var(--select); border-color: var(--select); }
.box:checked::after {
content: "";
width: 4px;
height: 8px;
border: solid var(--bg);
height: 9px;
border: solid var(--on-select);
border-width: 0 2px 2px 0;
transform: translateY(-1px) rotate(45deg);
}
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/atoms/Divider/Divider.module.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.divider { background: var(--border-hard); flex-shrink: 0; display: block; }
.divider { background: var(--border); flex-shrink: 0; display: block; }
.horizontal { height: 1px; width: 100%; }
.vertical { width: 1px; height: 26px; }
.vertical { width: 1px; height: 24px; }
Loading
Loading