You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte-kit-vice/docs/audit/theming/chat-message.md

110 lines
8.6 KiB

# chat-message — alcance de tema: análisis y propuesta
> Generado por `node --import tsx/esm scripts/theming-census.ts --report`.
> Lo **medido** y la **propuesta** se regeneran; el **Veredicto** (§5) se conserva.
> Vista de conjunto: [README](./README.md) · método y protocolo:
> [`PLAN-theming.md`](../../process/PLAN-theming.md) §1, §2, §7.
- **Medido**: 2026-08-20 · **Alcance**: **82%** — 63 de 77 knobs por token público
- **Knobs de apariencia**: 84 — público 63 · privado 2 · global 6 · literal 6 · sistema 7 _(fuera del ratio)_
- **Contrato hoy** (`lib/recipes/base.ts`): 75 pública(s) — `gap`, `row-gap-run`, `row-gap-group`, `gutter-inline-size`, `bubble-padding-inline-sm`, `bubble-padding-inline-md`, `bubble-padding-inline-lg`, `bubble-padding-block-sm`, `bubble-padding-block-md`, `bubble-padding-block-lg`, `bubble-radius`, `bubble-radius-run`, `bubble-tail-radius`, `bubble-max-inline-size`, `bubble-font-size-sm`, `bubble-font-size-md`, `bubble-font-size-lg`, `bubble-line-height`, `bubble-bg-in`, `bubble-fg-in`, `bubble-bg-out`, `bubble-fg-out`, `bubble-shadow`, `header-gap`, `header-font-size`, `header-font-weight`, `header-fg`, `meta-gap`, `meta-font-size`, `meta-fg`, `status-size`, `status-fg`, `read-status-fg`, `failed-status-fg`, `read-by-gap`, `read-by-font-size`, `read-by-fg`, `read-by-margin`, `emphasize-bg`, `emphasize-radius`, `emphasize-duration`, `reply-padding-inline`, `reply-padding-block`, `reply-accent-size`, `reply-radius`, `reply-bg`, `reply-accent`, `reply-font-size`, `reaction-gap`, `reaction-height`, `reaction-padding-inline`, `reaction-radius`, `reaction-font-size`, `reaction-bg`, `reaction-border`, `reaction-shadow`, `reaction-overlap`, `reaction-pressed-bg`, `reaction-pressed-border`, `reaction-pressed-fg`, `quick-react-gap`, `quick-react-pad`, `quick-react-size`, `quick-react-emoji-size`, `quick-react-hover-bg`, `quick-react-hover-scale`, `actions-bg`, `actions-border`, `actions-shadow`, `actions-radius`, `actions-padding`, `mentioned-bg`, `mentioned-accent`, `actions-gap`, `actions-offset`
- **Eje `size`**: sí · **ficheros**: `chat-message.css`
## 1. Knobs fuera de alcance
### 1.1 Directo a primitivo global (6)
| # | fichero:línea | selector | propiedad | valor |
| ---: | --- | --- | --- | --- |
| 1 | `chat-message.css:38` | `[data-chat-message]:focus-visible` | `border-radius` | `var(--radius-sm)` |
| 2 | `chat-message.css:226` | `[data-chat-message][data-mentioned] [data-chat-message-bubble]` | `color` | `var(--color-content-primary)` |
| 3 | `chat-message.css:289` | `[data-chat-message-reply]` | `color` | `var(--color-content-secondary)` |
| 4 | `chat-message.css:328` | `[data-chat-message-reaction], [data-chat-message-reaction-add]` | `gap` | `var(--space-1)` |
| 5 | `chat-message.css:334` | `[data-chat-message-reaction], [data-chat-message-reaction-add]` | `color` | `var(--color-content-primary)` |
| 6 | `chat-message.css:407` | `[data-chat-message-quick-react]` | `border-radius` | `var(--radius-full)` |
### 1.2 A través de un privado (2)
| # | fichero:línea | selector | propiedad | valor |
| ---: | --- | --- | --- | --- |
| 1 | `chat-message.css:145` | `[data-chat-message-bubble]` | `background` | `var(--_chat-message-bubble-bg)` |
| 2 | `chat-message.css:146` | `[data-chat-message-bubble]` | `color` | `var(--_chat-message-bubble-fg)` |
### 1.3 Literales (6)
| # | fichero:línea | selector | propiedad | valor |
| ---: | --- | --- | --- | --- |
| 1 | `chat-message.css:355` | `[data-chat-message-reaction] svg, [data-chat-message-reaction-add] svg` | `inline-size` | `1.1em` |
| 2 | `chat-message.css:356` | `[data-chat-message-reaction] svg, [data-chat-message-reaction-add] svg` | `block-size` | `1.1em` |
| 3 | `chat-message.css:379` | `[data-popover-content][data-chat-message-quick-reactions]` | `inline-size` | `max-content` |
| 4 | `chat-message.css:409` | `[data-chat-message-quick-react]` | `line-height` | `1` |
| 5 | `chat-message.css:478` | `[data-chat-message]:hover [data-chat-message-actions], [data-chat-message]:focus-within [data-chat-message-actions]` | `opacity` | `1` |
| 6 | `chat-message.css:484` | `[data-chat-message-actions]` | `opacity` | `1` |
## 2. Sistema transversal (7) — informativo, fuera del ratio
Un tema los alcanza **a nivel de sistema**, por diseño (recipe-contract §2).
| # | fichero:línea | selector | propiedad | valor |
| ---: | --- | --- | --- | --- |
| 1 | `chat-message.css:36` | `[data-chat-message]:focus-visible` | `outline` | `var(--focus-ring-width) solid var(--focus-ring-color)` |
| 2 | `chat-message.css:270` | `[data-chat-message][data-delivery='sending'] [data-chat-message-bubble]` | `opacity` | `var(--opacity-muted)` |
| 3 | `chat-message.css:296` | `[data-chat-message-reply]:hover` | `background-image` | `linear-gradient(var(--state-hover), var(--state-hover))` |
| 4 | `chat-message.css:300` | `[data-chat-message-reply]:focus-visible` | `outline` | `var(--focus-ring-width) solid var(--focus-ring-color)` |
| 5 | `chat-message.css:342` | `[data-chat-message-reaction]:hover, [data-chat-message-reaction-add]:hover` | `background-image` | `linear-gradient(var(--state-hover), var(--state-hover))` |
| 6 | `chat-message.css:347` | `[data-chat-message-reaction]:focus-visible, [data-chat-message-reaction-add]:focus-visible` | `outline` | `var(--focus-ring-width) solid var(--focus-ring-color)` |
| 7 | `chat-message.css:424` | `[data-chat-message-quick-react]:focus-visible` | `outline` | `var(--focus-ring-width) solid var(--focus-ring-color)` |
## 3. Privados de la receta — ¿de dónde sale su valor?
| privado | declaraciones | valor(es) | origen | ¿deriva de un público? |
| --- | ---: | --- | --- | :-: |
| `--_chat-message-bubble-bg` | 2 | `var(--chat-message-bubble-bg-in)`, `var(--chat-message-bubble-bg-out)` | public | **sí** |
| `--_chat-message-bubble-fg` | 2 | `var(--chat-message-bubble-fg-in)`, `var(--chat-message-bubble-fg-out)` | public | **sí** |
## 4. Propuesta de corrección
- **Tiene eje `size`**: los tokens dimensionales van por talla (`{part}-{eje}-{k}`) apuntando al bundle `--size-{k}-*`, nunca al primitivo crudo (theming §5; el guard `recipe-css-contract` prohíbe el primitivo).
### 4.1 Tokens a declarar en `lib/recipes/base.ts` (9)
Valor **verbatim** del CSS de hoy: el default no se mueve, sólo cambia quién
puede moverlo. Nombres derivados de recipe-contract §1 (ejes lógicos, talla
al final) y theming §6.7 (slots de color, modificador delante). Un token con
DOS valores distintos es una colisión de nombre: son dos knobs, o el nombre
no distingue lo que debería — se marca `⚠`.
| token (`--chat-message-…`) | scope TSC | valor propuesto | usos |
| --- | --- | --- | ---: |
| `radius` | `root` | `var(--radius-sm)` | 1 |
| `bubble-fg` | `root` | `var(--color-content-primary)` | 1 |
| `reply-fg` | `root` | `var(--color-content-secondary)` | 1 |
| `reaction-gap` _(ya existe)_ | `root` | `var(--space-1)` | 1 |
| `reaction-fg` | `root` | `var(--color-content-primary)` | 1 |
| `reaction-width` | `root` | `1.1em` | 1 |
| `reaction-height` _(ya existe)_ | `root` | `1.1em` | 1 |
| `quick-reactions-width` | `root` | `max-content` | 1 |
| `quick-react-radius` | `root` | `var(--radius-full)` | 1 |
### 4.2 Sin nombre mecánico (5)
- **ya alcanzable: el privado `--_chat-message-bubble-bg` deriva de un público (`var(--chat-message-bubble-bg-in)`, `var(--chat-message-bubble-bg-out)`) — sin acción; el censo lo cuenta como no alcanzable por el límite del regex** — 1: `background`.
- **ya alcanzable: el privado `--_chat-message-bubble-fg` deriva de un público (`var(--chat-message-bubble-fg-in)`, `var(--chat-message-bubble-fg-out)`) — sin acción; el censo lo cuenta como no alcanzable por el límite del regex** — 1: `color`.
- **⚠ decisión: `1` es un valor identidad o geometría de layout, no un knob de tema — el perímetro de «knob» es D-TH.2, sin firmar** — 3: `line-height`, `opacity`.
### 4.4 Lo que hay que comprobar a mano (PLAN-theming §1.3 · §7.4)
- [ ] **Privado que no deriva de un público** — §3 lo marca; el privado debe leer el público o desaparecer.
- [ ] **Velo o acento en el nodo equivocado** (`archetype: 'item'` en un envoltorio, un `background` en shorthand que mata la capa de estado) — se mide desde el píxel hacia arriba.
- [ ] **Doble animación** al mover un sello a una superficie con animación propia — registro de `animationstart`/`animationend`.
- [ ] **Diff de computed = 0** en reposo · hover · abierto · disabled · foco, por talla, antes y después.
- [ ] **Centinela por token nuevo**: valor imposible en el root → el nodo lo sigue. Si no, el token miente.
## 5. Veredicto
<!-- veredicto:start -->
_(pendiente — lo escribe el autor; se conserva al regenerar)_
<!-- veredicto:end -->

Powered by TurnKey Linux.