diff --git a/.cofoundy/context/agent-floor.md b/.cofoundy/context/agent-floor.md index 09d8967..cfde588 100644 --- a/.cofoundy/context/agent-floor.md +++ b/.cofoundy/context/agent-floor.md @@ -64,10 +64,10 @@ CTO reacts to events, not to chatter. - **If you rescue orphaned work, CLAIM it and tell the other side in the SAME movement — before opening the PR.** This already happened: the CTO rescued an orphan on a new branch *while* the lane, independently and correctly, opened its own — two PRs, identical tree. Both did the right thing; what was missing was a comparable identity before either PR existed. `orphan_guard.py claim --branch --base origin/main --actor "$COFOUNDY_AGENT" --notify ` → `0` claimed + announced, open your PR · `1` someone else already holds this tree, STOP · `3` claimed but the aviso FAILED, do **not** open the PR. `--notify` is mandatory because announcing is part of the act of rescuing, not a courtesy afterwards. → `skills/factory/references/site-lifecycle.md` §8.1 - **Orchestrator's half of that pair (it binds the orchestrator, not you): before merging it must affirm that the PR's `headRefOid` IS the branch's real remote head** — `gh pr view --json headRefOid` compared against `git ls-remote origin refs/heads/`, not the value it read a while ago. If they differ, you pushed after it looked, and merging there is exactly what orphans your commit. If your work goes missing this way, that is an orchestrator defect — report it, don't absorb it. - **Self-merge to the INTEGRATION branch on CI-green IF your scope is DISJOINT.** When your task touched only files YOU own per the ownership matrix (no shared files), open your MR there and set **auto-merge on CI-green** — you land your own lane, no orchestrator relay. Resolve the branch, never assume it: `git ls-remote --heads origin dev`. It is `dev` (per `handbook/governance/git-strategy.md`), **not `develop`** — this floor said `develop` until 2026-08-06 and no Cofoundy repo has ever had a branch by that name, so this rule silently pointed every lane at the gated trunk. -- **No integration branch → do NOT auto-merge. Open the MR and stop.** Landing on a gated trunk is the orchestrator's call, not yours: if that trunk requires up-to-date branches, your merge invalidates every sibling lane's PR and each one pays an update-and-rerun cycle. Say in your termination signal that the MR is open and unmerged, and why. (Measured in `inbox-ai` 2026-08-06: 12 open PRs, all based on `main`, `strict: true`, no `dev` — that pileup is this rule firing wrong.) +- **No integration branch → do NOT auto-merge. Open the MR and stop.** Landing on a gated trunk is the orchestrator's call, not yours: if that trunk requires up-to-date branches, your merge invalidates every sibling lane's PR and each one pays an update-and-rerun cycle. Say in your termination signal that the MR is open and unmerged, and why. (Measured in `tracta` 2026-08-06: 12 open PRs, all based on `main`, `strict: true`, no `dev` — that pileup is this rule firing wrong.) - **CI is the gate — and the gate is the command's exit code.** `gh pr checks ` exits non-zero while checks are still **pending**; a zero-length `statusCheckRollup` array reads as "no failures" when it means "no signal". Read `$?` of `gh` itself, never of a `tail` you piped it into, and never your own parse. - **Shared-file edits → flag, don't auto-merge.** If you touched a SHARED surface (the api-client barrel/index, `app.module`, prisma migrations, root `package.json`, anything multiple lanes edit) label your MR `needs-coordinated-merge` and STOP — the merge-coordinator sequences those (concurrent auto-merges on a shared file collide). Better: avoid shared-file edits by design (add your own file, not a line in a shared index). -- **A numbered file is a shared surface even though it is your OWN file — never derive its number from `main`.** Bitácoras (`docs/bitacora/NNN_slug.md`) and any other `NNN_`-prefixed sequence: reading `main` for "the highest N so far" is a read-modify-write against every sibling lane still in flight, and **git will not flag it** — you each write a *different* filename, so the merge is clean and the sequence is silently broken. Measured 2026-08-08 in `inbox-ai`: five duplicated numbers across 11 merged files (one of them tripled), plus three live PRs all claiming `052` — and the fifth landed the same day the bug was filed. Which numbers exactly is recorded as data (`slots.py::BITACORA_DEBT`), never as a list in prose: a restated list goes stale on its own. Ask the allocator instead; it reserves under a lock: +- **A numbered file is a shared surface even though it is your OWN file — never derive its number from `main`.** Bitácoras (`docs/bitacora/NNN_slug.md`) and any other `NNN_`-prefixed sequence: reading `main` for "the highest N so far" is a read-modify-write against every sibling lane still in flight, and **git will not flag it** — you each write a *different* filename, so the merge is clean and the sequence is silently broken. Measured 2026-08-08 in `tracta`: five duplicated numbers across 11 merged files (one of them tripled), plus three live PRs all claiming `052` — and the fifth landed the same day the bug was filed. Which numbers exactly is recorded as data (`slots.py::BITACORA_DEBT`), never as a list in prose: a restated list goes stale on its own. Ask the allocator instead; it reserves under a lock: ```bash python3 /skills/factory/scripts/slots.py bitacora --site "$COFOUNDY_AGENT" --json ``` diff --git a/.cofoundy/context/constraints/escalation-thresholds.yaml b/.cofoundy/context/constraints/escalation-thresholds.yaml index a869926..a5cb73a 100644 --- a/.cofoundy/context/constraints/escalation-thresholds.yaml +++ b/.cofoundy/context/constraints/escalation-thresholds.yaml @@ -88,7 +88,7 @@ scoped_to: worker_id: cto-d606f0 # DECISION DEL CTO 2026-09-04: NO se otorga auto_approve_main_deploy. -# Razon (finding H-5): inbox-ai (= Tracta, en produccion) consume +# Razon (finding H-5): Tracta (= Tracta, en produccion) consume # `github:cofoundy/ui#main` SIN PIN, en 139 archivos de su frontend. Todo merge a # main de este repo entra a su prod sin gate. El blast radius de un deploy a main # NO es "se redeploya Storybook": es la app que se factura a S/.150-250/mes. diff --git a/.cofoundy/context/decisions/2026-09-04-phase-5-tasks.md b/.cofoundy/context/decisions/2026-09-04-phase-5-tasks.md index f3a1592..fc8c0b0 100644 --- a/.cofoundy/context/decisions/2026-09-04-phase-5-tasks.md +++ b/.cofoundy/context/decisions/2026-09-04-phase-5-tasks.md @@ -300,8 +300,8 @@ estructura del DOM y no en color. → **B-5**. |---|---|---|---| | **B-1** | `tasks/T-003.md` | Bloque `## Acceptance`, los tres ítems | Retitular **`## Acceptance (falsable)`** y agregar gemelo a cada uno. **#1** → añadir: *«Gemelo anti-aliasing: retener `s1 = seek(tl,t1)`, luego `seek(tl,t2)` con `t2>t1`; `s1` NO debe haber cambiado, y `s1` ≠ `s2` en un campo nombrado. Un `seek` que devuelve el Map interno vivo DEBE poner esto rojo.»* **#2** → añadir: *«Gemelo negativo: `seek` a un `t` ANTERIOR al `react` ⇒ la reacción está ausente.»* **#3** → **reemplazar el benchmark de 2 ms** por: *«Instrumentar contador de pasos de fold por `seek`; afirmar ≤ `64 + log2(n)`. Gemelo de escalado: 500 vs 5000 pasos ⇒ costo sublineal. Un fold lineal sin checkpoints DEBE ponerlo rojo.»* (El wall-clock se conserva sólo como señal informativa, nunca como criterio.) | | **B-2** | `tasks/T-003.md` → n/a; **`tasks/T-006.md`** | `## Alcance`, la frase **«Tope de costo (A-1): si excede ~0,5 d, revertí a stub y avisá.»**; `scope.write`; `## Acceptance` #1 y #3 | (a) **Reemplazar el tope de tiempo por tope de alcance:** *«Cota dura, verificable leyendo el dato entregado: ≤6 cues por canal, ≤3 capas por cue, `wave` ∈ {sine, square, triangle, noise}. Orden de entrega OBLIGATORIO: (1) schema + `AudioSink` muteado, (2) cue packs. El "stub" es el caso degenerado de (1) con cero packs — se llega por resta, no se reconstruye. Si los packs no entran en la cota, PARÁ con (1) entregado y reportá en `.cofoundy/state/reports/skin.md`.»* (b) **Sacar `ChannelId` de T-006 y moverlo a T-005** (`adapters/**` es celda `W` de `channel`); T-006 conserva sólo el token CSS `--channel-imessage`. (c) **`--channel-imessage` + `ChannelId` son INCONDICIONALES y quedan FUERA de la cota** — son `mvp_scope.incluye` y no pueden caer como daño colateral del tope de audio. (d) **#1** → añadir: *«Gemelo positivo: con el sink DESMUTEADO, `scheduledNodes > 0` antes del seek y `=== 0` después. Un sink no-op DEBE poner esto rojo.»* (e) **#3** → reemplazar *«y suenan distinto»* por: *«los dos packs son deep-inequal como datos, y el digest del buffer PCM renderizado difiere entre canales. Gemelo positivo: el mismo pack dos veces ⇒ digest idéntico.»* | -| **B-3** | `tasks/T-007.md` | `## Acceptance` #2, la frase **«Criterio real: el fork `MobileComposer.tsx` (13 KB) de inbox-ai queda sin razón de ser.»** | Reemplazar por un instrumento en dos mitades, ambas rojas-capaces: *(i)* **Test mecánico:** simular `visualViewport` a altura de teclado (fake en jsdom o Playwright con viewport reducido) y afirmar que el bounding box del composer queda **dentro** del visual viewport; sin la resolución de `dvh`/`interactive-widget` DEBE fallar. *(ii)* **Checklist derivada del archivo real,** mismo patrón que A-4: enumerar los comportamientos de `products/cofoundy-platform/inbox-ai/frontend/src/components/conversation/MobileComposer.tsx` (verificado: 13 KB, existe) y afirmar cobertura ítem por ítem. **«Pierde su razón de ser» deja de ser prosa y pasa a ser una lista con casillas.** Esto instrumenta la `definicion_de_exito` #5. | -| **B-4** | `tasks/T-008.md` | `## Acceptance` #1 (el paréntesis) y #4 | (a) **Borrar el escape hatch** *«(o lleva adaptador documentado inline)»*. Reemplazar #1 por: *«La story de reemplazo se tipa contra la forma REAL: importar o transcribir literalmente `interface Message` de `products/cofoundy-platform/inbox-ai/frontend/src/lib/api.ts:229` (verificado) como fixture tipado; si la forma diverge, el typecheck DEBE fallar. Adaptador permitido sólo si el fixture de origen sigue siendo el tipo real.»* (b) **Cerrar la mitad huérfana de A-4:** añadir #5 → *«Calcular N y escribirlo: N = KB de `MessageBubble.tsx` + `MobileComposer.tsx` cubiertos por la story de reemplazo, registrado en `.cofoundy/state/reports/qa.md`. Sin N escrito, el criterio de éxito #4 sigue afirmándose.»* (c) **#4:** quitar de la acceptance de `qa` la anotación en `src/types/**` (celda ⛔ para las seis lanes) y reescribir: *«`COMPONENTS.md` actualizado; la deuda de los dos `Message` se **solicita** por `A` en `reports/qa.md` con el texto exacto propuesto para `src/types/message.ts:62` y `src/types/index.ts:28` — la aplica el CTO. La acceptance de qa se satisface con la solicitud, no con el write.»* | +| **B-3** | `tasks/T-007.md` | `## Acceptance` #2, la frase **«Criterio real: el fork `MobileComposer.tsx` (13 KB) de inbox-ai queda sin razón de ser.»** | Reemplazar por un instrumento en dos mitades, ambas rojas-capaces: *(i)* **Test mecánico:** simular `visualViewport` a altura de teclado (fake en jsdom o Playwright con viewport reducido) y afirmar que el bounding box del composer queda **dentro** del visual viewport; sin la resolución de `dvh`/`interactive-widget` DEBE fallar. *(ii)* **Checklist derivada del archivo real,** mismo patrón que A-4: enumerar los comportamientos de `projects/tracta/frontend/src/components/conversation/MobileComposer.tsx` (verificado: 13 KB, existe) y afirmar cobertura ítem por ítem. **«Pierde su razón de ser» deja de ser prosa y pasa a ser una lista con casillas.** Esto instrumenta la `definicion_de_exito` #5. | +| **B-4** | `tasks/T-008.md` | `## Acceptance` #1 (el paréntesis) y #4 | (a) **Borrar el escape hatch** *«(o lleva adaptador documentado inline)»*. Reemplazar #1 por: *«La story de reemplazo se tipa contra la forma REAL: importar o transcribir literalmente `interface Message` de `projects/tracta/frontend/src/lib/api.ts:229` (verificado) como fixture tipado; si la forma diverge, el typecheck DEBE fallar. Adaptador permitido sólo si el fixture de origen sigue siendo el tipo real.»* (b) **Cerrar la mitad huérfana de A-4:** añadir #5 → *«Calcular N y escribirlo: N = KB de `MessageBubble.tsx` + `MobileComposer.tsx` cubiertos por la story de reemplazo, registrado en `.cofoundy/state/reports/qa.md`. Sin N escrito, el criterio de éxito #4 sigue afirmándose.»* (c) **#4:** quitar de la acceptance de `qa` la anotación en `src/types/**` (celda ⛔ para las seis lanes) y reescribir: *«`COMPONENTS.md` actualizado; la deuda de los dos `Message` se **solicita** por `A` en `reports/qa.md` con el texto exacto propuesto para `src/types/message.ts:62` y `src/types/index.ts:28` — la aplica el CTO. La acceptance de qa se satisface con la solicitud, no con el write.»* | | **B-5** | `tasks/T-002.md` (agrega) y `tasks/T-005.md` (refuerza) | T-002 `## Acceptance`, **ítem nuevo #6**; T-005 `## Acceptance` #3 | (a) **T-002 #6 (nuevo, ola 1):** *«Test de fixture de caps: renderizar el mismo guion con un fixture que implemente los 16 campos difiriendo de WhatsApp en `tail: last`, `receiptGlyph: single-tick`, `reactions: own-row`; el DOM debe cambiar en las tres. **Gemelo positivo:** con el fixture WhatsApp, el DOM vuelve al render de referencia. Un layout hardcodeado DEBE ponerlo rojo — en la ola 1, antes de que `capture/` congele goldens.»* (b) **T-005 #3:** el grep se conserva como red barata pero deja de ser el detector primario; añadir: *«El detector de hardcode es el test de fixture de caps de T-002 #6, extendido a los dos adapters reales. El grep no caza `switch`, `==`, lookups por clave literal, ni un render mono-canal sin ramas.»* **Esto instrumenta además la `definicion_de_exito` #2** (diferencias estructurales, no de color). | | **B-6** | `tasks/T-002.md` | `## Acceptance`, **ítem nuevo #7** | *«El bundle construido de `element/` contiene **cero** React: afirmarlo sobre el grafo de imports del build (`react`/`react-dom` ausentes de las dependencias del bundle). Gemelo positivo: la misma sonda contra el bundle de `react/` DEBE dar positivo — un chequeo que nunca encuentra React no prueba nada.»* Instrumenta la `definicion_de_exito` #3 («las dos landings Astro lo montan sin agregar React»), que hoy no tiene ninguna sonda: `demo/index.html` abre igual aunque React venga empaquetado. | | **B-7** | `specs/file-ownership-matrix.md` §Olas + protocolo de reportes de lane | Fila de «Reportes» de la tabla de verificación de colisión | Hacer **medible** el tripwire `budget_overrun`, hoy infireable: *(i)* cada `.cofoundy/state/reports/{lane}.md` **DEBE** abrir con el campo `wall_clock_minutes:` — un reporte sin él es reporte incompleto; *(ii)* el CTO suma el acumulado **al cierre de cada ola**; *(iii)* **disparo duro:** si el acumulado cruza **24 h** en cualquier momento, `budget_overrun` escala **de inmediato**, sin terminar la ola; *(iv)* **disparo temprano:** al cierre de la ola 3 (6 de 8 tareas), si el acumulado supera **16 h**, escalar ahí — la cola (T-007 react+mobile, T-008 stories+tests+coverage+docs) no baja plausiblemente de 8 h, y 24 − 8 = 16. La cifra es derivada, no elegida. | @@ -391,7 +391,7 @@ veredicto a propósito. «nunca absorbas en silencio un pivot de scope»); precedencia operador > config de proyecto - `packages/ui/CLAUDE.md` — contrato `MobileBaseline`, SSOT de `COMPONENTS.md` - **Verificado en disco, no inferido:** - `products/cofoundy-platform/inbox-ai/frontend/src/components/conversation/MobileComposer.tsx` (13 KB, existe) · + `projects/tracta/frontend/src/components/conversation/MobileComposer.tsx` (13 KB, existe) · `…/frontend/src/lib/api.ts:229` (`interface Message`, la forma real para B-4) · `…/frontend/src/lib/messageGrouping.ts:25` (`groupKey`, el que el adapter adopta) diff --git a/COMPONENTS.md b/COMPONENTS.md index 1c12c06..da871d4 100644 --- a/COMPONENTS.md +++ b/COMPONENTS.md @@ -75,7 +75,7 @@ Most common needs first. Story URL pattern: `https://ui.cofoundy.dev/?path=/docs | **Docs MDX components** (allowlist for `docs-ai/content/*`) | see [Docs](#docs) (15 components) | Docs | `docs-*` | | Slot-composable client portal page | `ClientPortalPanel` | Docs | `docs-clientportalpanel` | | Wikilink hover preview in docs | `LinkPreviewProvider` | Docs | `docs-linkpreview` | -| Deterministic, seeded chat-conversation simulator (WhatsApp/Telegram look, byte-identical screenshots) | `ChatSim` (React), `` (custom element) | Chat Sim | `chatsim-channels`, `chatsim-states`, `chatsim-inboxai-replacement` | +| Deterministic, seeded chat-conversation simulator (WhatsApp/Telegram look, byte-identical screenshots) | `ChatSim` (React), `` (custom element) | Chat Sim | `chatsim-channels`, `chatsim-states`, `chatsim-tracta-replacement` | --- diff --git a/demo/chat-sim.bundle.js b/demo/chat-sim.bundle.js index 4ec58c7..6a6fbc7 100644 --- a/demo/chat-sim.bundle.js +++ b/demo/chat-sim.bundle.js @@ -553,7 +553,7 @@ var CfChatSim = (() => { avatarSide: "inbound", // T-028: WhatsApp Business's `interactive.type: "buttons"|"list"` — each its own native // message type with its own chrome (reply-buttons, and a scrollable list opened via a button). - // Both supported, nothing to constrain yet (inbox-ai capabilities.py/registry.py's model). + // Both supported, nothing to constrain yet (Tracta capabilities.py/registry.py's model). capabilities: { buttons: null, list: null diff --git a/demo/parity-t027.html b/demo/parity-t027.html index 8f9bb38..c89568c 100644 --- a/demo/parity-t027.html +++ b/demo/parity-t027.html @@ -8,7 +8,7 @@ T-027 acceptance evidence page — same no-build-step contract as index.html/chrome-axis.html (file:// only, checked-in bundle, no type="module"). - Left: WhatsApp, chrome="branded" with a Fovente-red consumer token + `loop` — this is + Left: WhatsApp, chrome="branded" with a brand-red consumer token + `loop` — this is exactly ChatDemo.astro's production case (auto-scroll via scrollId, loop, `service` encryption-notice/stop/done), reproduced through the real engine. Right: Telegram, chrome="fidelity", same script — the gemelo: `service` renders in both @@ -105,7 +105,7 @@

T-027 — scroll(scrollId) + loop + service + receipts + chrome="branded" + { "k": "post", "by": "out:ai", "text": "*Resumen de la reserva*\n• Sábado 8:00pm\n• 4 personas\n• Mesa junto a la ventana", "delayMs": 400 }, { "k": "post", "by": "in", "text": "Perfecto, confirmo", "delayMs": 1400 }, { "k": "receipt", "id": "m2", "to": "read", "delayMs": 0 }, - { "k": "post", "by": "out:ai", "text": "Paga aquí: pagos.fovente.pe/r/8x2", "media": { "link": true }, "delayMs": 700 }, + { "k": "post", "by": "out:ai", "text": "Paga aquí: pagos.ejemplo.pe/r/8x2", "media": { "link": true }, "delayMs": 700 }, { "k": "receipt", "id": "m5", "to": "sent", "delayMs": 400 }, { "k": "receipt", "id": "m5", "to": "delivered", "delayMs": 500 }, { "k": "post", "by": "system", "text": "TRACTA SE DETUVO · PAGO DECLARADO", "media": { "kind": "service", "variant": "warn" }, "delayMs": 900 }, @@ -138,7 +138,7 @@

T-027 — scroll(scrollId) + loop + service + receipts + chrome="branded" + { "k": "post", "by": "out:ai", "text": "*Resumen de la reserva*\n• Sábado 8:00pm\n• 4 personas\n• Mesa junto a la ventana", "delayMs": 900 }, { "k": "post", "by": "in", "text": "Perfecto, confirmo", "delayMs": 1400 }, { "k": "receipt", "id": "m2", "to": "read", "delayMs": 0 }, - { "k": "post", "by": "out:ai", "text": "Paga aquí: pagos.fovente.pe/r/8x2", "media": { "link": true }, "delayMs": 700 }, + { "k": "post", "by": "out:ai", "text": "Paga aquí: pagos.ejemplo.pe/r/8x2", "media": { "link": true }, "delayMs": 700 }, { "k": "receipt", "id": "m5", "to": "sent", "delayMs": 400 }, { "k": "receipt", "id": "m5", "to": "read", "delayMs": 500 }, { "k": "post", "by": "system", "text": "TRACTA SE DETUVO · PAGO DECLARADO", "media": { "kind": "service", "variant": "warn" }, "delayMs": 900 }, diff --git a/demo/rotation-badge-tag.html b/demo/rotation-badge-tag.html index 134e2b6..cd4ecf6 100644 --- a/demo/rotation-badge-tag.html +++ b/demo/rotation-badge-tag.html @@ -97,7 +97,7 @@

T-031 — alto fijo (gemelo: 2 guiones, mismo alto) + rotación + badge + et { "k": "post", "by": "out:ai", "text": "¿Es un evento de empresa o familiar?", "delayMs": 900 }, { "k": "post", "by": "in", "text": "familiar, ya me quedo con el clasico", "delayMs": 1500 }, { "k": "draft", "by": "out:ai", "chars": 30, "delayMs": 700 }, - { "k": "post", "by": "out:ai", "text": "Paga aquí: pagos.fovente.pe/r/8x2", "media": { "link": true }, "delayMs": 900 }, + { "k": "post", "by": "out:ai", "text": "Paga aquí: pagos.ejemplo.pe/r/8x2", "media": { "link": true }, "delayMs": 900 }, { "k": "flag", "key": "aiOn", "value": false, "delayMs": 300 }, { "k": "post", "by": "system", "text": "TRACTA SE DETUVO · PAGO DECLARADO", "media": { "kind": "service", "variant": "warn" }, "delayMs": 900 } ] @@ -138,7 +138,7 @@

T-031 — alto fijo (gemelo: 2 guiones, mismo alto) + rotación + badge + et { "k": "post", "by": "out:ai", "text": "¿Es un evento de empresa o familiar?", "delayMs": 900 }, { "k": "post", "by": "in", "text": "familiar, ya me quedo con el clasico", "delayMs": 1500 }, { "k": "draft", "by": "out:ai", "chars": 30, "delayMs": 700 }, - { "k": "post", "by": "out:ai", "text": "Paga aquí: pagos.fovente.pe/r/8x2", "media": { "link": true }, "delayMs": 900 }, + { "k": "post", "by": "out:ai", "text": "Paga aquí: pagos.ejemplo.pe/r/8x2", "media": { "link": true }, "delayMs": 900 }, { "k": "flag", "key": "aiOn", "value": false, "delayMs": 300 }, { "k": "post", "by": "system", "text": "TRACTA SE DETUVO · PAGO DECLARADO", "media": { "kind": "service", "variant": "warn" }, "delayMs": 900 } ] diff --git a/src/__tests__/chat-sim/inbox-message-adapter.test.ts b/src/__tests__/chat-sim/inbox-message-adapter.test.ts index a05780f..96ede23 100644 --- a/src/__tests__/chat-sim/inbox-message-adapter.test.ts +++ b/src/__tests__/chat-sim/inbox-message-adapter.test.ts @@ -2,7 +2,7 @@ // // Runtime behavior of stories/chat-sim/lib/inboxMessageAdapter.ts on top of the compile-time // check T-008 acceptance #1 asks for (the fixtures themselves are typed against the REAL -// inbox-ai `Message`, not a hand-copied mirror — see inboxMessageFixtures.ts). A type that +// Tracta `Message`, not a hand-copied mirror — see inboxMessageFixtures.ts). A type that // compiles proves the SHAPE lines up; these tests prove the VALUES map correctly. import { describe, expect, it } from 'vitest'; diff --git a/src/__tests__/chat-sim/stories-smoke.test.tsx b/src/__tests__/chat-sim/stories-smoke.test.tsx index 6d4a3e2..44afe33 100644 --- a/src/__tests__/chat-sim/stories-smoke.test.tsx +++ b/src/__tests__/chat-sim/stories-smoke.test.tsx @@ -10,7 +10,7 @@ import { describe, expect, it } from 'vitest'; import { render } from '@testing-library/react'; import { createElement } from 'react'; import { ChatSim } from '../../components/chat-sim'; -import * as InboxAIReplacement from '../../stories/chat-sim/InboxAIReplacement.stories'; +import * as TractaReplacement from '../../stories/chat-sim/TractaReplacement.stories'; import * as ChatSimStates from '../../stories/chat-sim/ChatSimStates.stories'; import * as ChatSimChannels from '../../stories/chat-sim/ChatSimChannels.stories'; @@ -27,7 +27,7 @@ function storiesOf(mod: StoryModule): Array<[string, Record]> { } describe.each([ - ['InboxAIReplacement', InboxAIReplacement as unknown as StoryModule], + ['TractaReplacement', TractaReplacement as unknown as StoryModule], ['ChatSimStates', ChatSimStates as unknown as StoryModule], ['ChatSimChannels', ChatSimChannels as unknown as StoryModule], ])('%s stories render without throwing', (_fileName, mod) => { diff --git a/src/__tests__/components/brand-ink-derives.test.tsx b/src/__tests__/components/brand-ink-derives.test.tsx index 0b86bf7..0b65cae 100644 --- a/src/__tests__/components/brand-ink-derives.test.tsx +++ b/src/__tests__/components/brand-ink-derives.test.tsx @@ -10,7 +10,7 @@ import { badgeVariants } from "../../components/ui/badge"; * clavado acá deja el relleno variable y la tinta constante — y sobre un * relleno claro el rótulo desaparece. Medido en el DOM vivo de Tracta antes * del arreglo: **1.68:1** con una marca amarilla, **2.61:1** en tema oscuro con - * la marca por defecto. → inbox-ai#617 + * la marca por defecto. → tracta#617 * * Este test se escribió contra la versión ROTA primero y falló ahí; si alguna * vez pasa sobre un `text-white` reintroducido, es este test el que está mal. diff --git a/src/components/chat-sim/adapters/__tests__/caps.test.ts b/src/components/chat-sim/adapters/__tests__/caps.test.ts index 0736b85..eaaf728 100644 --- a/src/components/chat-sim/adapters/__tests__/caps.test.ts +++ b/src/components/chat-sim/adapters/__tests__/caps.test.ts @@ -51,7 +51,7 @@ describe('isAllowedReactionEmoji', () => { // T-028 — key PRESENCE is the question, never the value's truthiness. A capability entry's // value is always `null` today ("supported, nothing to constrain"), so `set.buttons` alone -// would read as falsy even when supported — the exact footgun inbox-ai's own registry.py +// would read as falsy even when supported — the exact footgun Tracta's own registry.py // docstring warns about (`constraint_for(...) is None` does NOT mean unsupported). describe('hasCapability', () => { it('true when the key is present, even though its value is null', () => { diff --git a/src/components/chat-sim/adapters/__tests__/registry.test.ts b/src/components/chat-sim/adapters/__tests__/registry.test.ts index e63374c..3cd99cc 100644 --- a/src/components/chat-sim/adapters/__tests__/registry.test.ts +++ b/src/components/chat-sim/adapters/__tests__/registry.test.ts @@ -76,7 +76,7 @@ describe('T-012 acceptance — no 1:1 views counter', () => { }); // T-028 acceptance #1 — getAdapter(c).capabilities includes BUTTONS and LIST with their -// per-channel constraints (ported from inbox-ai's capabilities.py/registry.py model). +// per-channel constraints (ported from Tracta's capabilities.py/registry.py model). describe('T-028 acceptance #1 — getAdapter(c).capabilities', () => { it("whatsapp supports both buttons and list — reply-buttons and list message are each a native, distinct interactive type", () => { expect(getAdapter('whatsapp').capabilities).toEqual({ buttons: null, list: null }); diff --git a/src/components/chat-sim/adapters/caps.ts b/src/components/chat-sim/adapters/caps.ts index ddb33e5..9886765 100644 --- a/src/components/chat-sim/adapters/caps.ts +++ b/src/components/chat-sim/adapters/caps.ts @@ -1,4 +1,4 @@ -// adapters/caps.ts — leaf. Mirrors inbox-ai's capabilities.py: the reaction vocabulary + the ONE +// adapters/caps.ts — leaf. Mirrors Tracta's capabilities.py: the reaction vocabulary + the ONE // normalizeReactionEmoji, with zero imports of chat-sim's own runtime code so `whatsapp.ts` and // `telegram.ts` can depend on it without risk of the cycle api-contract.md warns about // (base -> capabilities -> whatsapp -> base). The `import type` below is erased at compile — it @@ -19,7 +19,7 @@ export function normalizeReactionEmoji(emoji: string): string { // Verbatim from https://core.telegram.org/bots/api#reactiontypeemoji (`ReactionTypeEmoji.emoji`), // last-fetched 2026-08-01 — the same 73 entries, same doc order, as -// inbox-ai/backend/src/services/channel_adapters/telegram_reactions.py. Telegram spells several +// tracta/backend/src/services/channel_adapters/telegram_reactions.py. Telegram spells several // of these WITHOUT U+FE0F (`❤`, `⚡`, `🕊`, `✍`, `☃`, the `🤷` family); every emoji picker // (ours included) emits the variation-selector form, so the set is stored normalized below — // comparing raw is a guaranteed miss. diff --git a/src/components/chat-sim/adapters/whatsapp.ts b/src/components/chat-sim/adapters/whatsapp.ts index 947a0fa..9b2bcf4 100644 --- a/src/components/chat-sim/adapters/whatsapp.ts +++ b/src/components/chat-sim/adapters/whatsapp.ts @@ -56,7 +56,7 @@ export const whatsapp: ChannelAdapter = { avatarSide: 'inbound', // T-028: WhatsApp Business's `interactive.type: "buttons"|"list"` — each its own native // message type with its own chrome (reply-buttons, and a scrollable list opened via a button). - // Both supported, nothing to constrain yet (inbox-ai capabilities.py/registry.py's model). + // Both supported, nothing to constrain yet (Tracta capabilities.py/registry.py's model). capabilities: { buttons: null, list: null, diff --git a/src/components/chat-sim/capture/capture.bundle.js b/src/components/chat-sim/capture/capture.bundle.js index 4e0a525..c7b5789 100644 --- a/src/components/chat-sim/capture/capture.bundle.js +++ b/src/components/chat-sim/capture/capture.bundle.js @@ -553,7 +553,7 @@ var CfChatSimCapture = (() => { avatarSide: "inbound", // T-028: WhatsApp Business's `interactive.type: "buttons"|"list"` — each its own native // message type with its own chrome (reply-buttons, and a scrollable list opened via a button). - // Both supported, nothing to constrain yet (inbox-ai capabilities.py/registry.py's model). + // Both supported, nothing to constrain yet (Tracta capabilities.py/registry.py's model). capabilities: { buttons: null, list: null diff --git a/src/components/chat-sim/core/__tests__/emoji-scan.test.ts b/src/components/chat-sim/core/__tests__/emoji-scan.test.ts index 362ee0c..d9b5788 100644 --- a/src/components/chat-sim/core/__tests__/emoji-scan.test.ts +++ b/src/components/chat-sim/core/__tests__/emoji-scan.test.ts @@ -13,7 +13,7 @@ // purity-test precedent for banned-globals-in-prose). // // One more exclusion beyond purity.test.ts's: `adapters/caps.ts` — Telegram's 73-emoji reaction -// ALLOWLIST (T-005, verified byte-identical to inbox-ai's prod `telegram_reactions.py`). Those +// ALLOWLIST (T-005, verified byte-identical to Tracta's prod `telegram_reactions.py`). Those // emoji are the reaction picker's actual values, not a per-channel glyph baked into a rendered // receipt/composer icon — banning them would break real, already-shipped, already-verified // product data. The bug this task fixes is specifically "a channel bakes a raw glyph character diff --git a/src/components/chat-sim/core/types.ts b/src/components/chat-sim/core/types.ts index bca8d4e..b7b1d26 100644 --- a/src/components/chat-sim/core/types.ts +++ b/src/components/chat-sim/core/types.ts @@ -133,7 +133,7 @@ export type AvatarSide = 'inbound' | 'none'; // // Key PRESENCE is the question, never a value's truthiness (`Partial`, not a total `Record`): // every entry's value is `null` today ("supported, nothing to constrain yet"), so absent-from-set -// is how "unsupported" is spelled. Mirrors inbox-ai's `Capability` StrEnum + `registry.py`'s +// is how "unsupported" is spelled. Mirrors Tracta's `Capability` StrEnum + `registry.py`'s // `Constraint | None` map. Use `hasCapability` (adapters/caps.ts) to ask, never `cap in set` or a // value-truthiness check by hand. // --------------------------------------------------------------------------- diff --git a/src/components/chat-sim/element/render.ts b/src/components/chat-sim/element/render.ts index c7b6bee..20b69e7 100644 --- a/src/components/chat-sim/element/render.ts +++ b/src/components/chat-sim/element/render.ts @@ -5,7 +5,7 @@ // the DOM must change; swap it back, the DOM must match the reference render byte-for-byte. // // `by: ActorId` doubles as the group key (adapter-interface-draft.md §groupKey): scripts use -// exactly 'in' | 'out:ai' | 'out:human:', the same three shapes inbox-ai's +// exactly 'in' | 'out:ai' | 'out:human:', the same three shapes Tracta's // lib/messageGrouping.ts:25 groups by. No separate cast/registry — the id already carries // direction + sender kind, so nothing here reinvents it. diff --git a/src/components/chat-sim/react/MOBILE-CHECKLIST.md b/src/components/chat-sim/react/MOBILE-CHECKLIST.md index 3974973..c01ada6 100644 --- a/src/components/chat-sim/react/MOBILE-CHECKLIST.md +++ b/src/components/chat-sim/react/MOBILE-CHECKLIST.md @@ -1,14 +1,14 @@ # Mobile composer checklist — T-007 acceptance #3 architecture-v1.md §8: *"Medible: el fork de `MobileComposer` queda sin razón de ser."* This is -that measurement, not an opinion. Source: `products/cofoundy-platform/inbox-ai/frontend/src/ +that measurement, not an opinion. Source: `projects/tracta/frontend/src/ components/conversation/MobileComposer.tsx` (13 KB, read in full 2026-09-04). One row per reason **the file itself declares** for existing — not reasons inferred from outside it. ## A finding before the table None of the seven reasons below is "the keyboard/viewport" — `MobileComposer.tsx` never mentions -`visualViewport`, `dvh`, or `interactive-widget` (grepped, zero hits across all of inbox-ai's +`visualViewport`, `dvh`, or `interactive-widget` (grepped, zero hits across all of Tracta's frontend, confirmed by team-lead). The fork exists for **layout and interaction-budget** reasons, not for a keyboard-resize bug it never attempted to fix. `useKeyboardInset.ts` (this task) closes the actual §8 gap — but that's an addition `react/` makes on top of the checklist below, not a row diff --git a/src/components/chat-sim/react/__tests__/mobile-checklist.test.ts b/src/components/chat-sim/react/__tests__/mobile-checklist.test.ts index 3bb1352..1f2f603 100644 --- a/src/components/chat-sim/react/__tests__/mobile-checklist.test.ts +++ b/src/components/chat-sim/react/__tests__/mobile-checklist.test.ts @@ -1,8 +1,8 @@ -// T-007 acceptance #3: "Checklist derivada del `MobileComposer.tsx` real (13 KB, inbox-ai): por +// T-007 acceptance #3: "Checklist derivada del `MobileComposer.tsx` real (13 KB, Tracta): por // cada razón que ese fork declara para existir, una fila con veredicto cubierto/no-cubierto." // -// This test does NOT read `products/cofoundy-platform/inbox-ai/...` at runtime: `packages/ui` and -// `inbox-ai` are separate repos in the Cofoundy workspace (see workspace CLAUDE.md's repo map), +// This test does NOT read `projects/tracta/...` at runtime: `packages/ui` and +// `tracta` are separate repos in the Cofoundy workspace (see workspace CLAUDE.md's repo map), // so a CI job that checks out only `packages/ui` would never have that path — a runtime read // would make this test fail for an environment reason, not a real regression. Instead, the exact // fragments below are literal quotes captured from that file on 2026-09-04 (same date @@ -17,7 +17,7 @@ import { describe, expect, it } from 'vitest'; const CHECKLIST_PATH = join(__dirname, '..', 'MOBILE-CHECKLIST.md'); // One literal fragment per declared reason, captured verbatim from MobileComposer.tsx -// (products/cofoundy-platform/inbox-ai/frontend/src/components/conversation/MobileComposer.tsx, +// (projects/tracta/frontend/src/components/conversation/MobileComposer.tsx, // 2026-09-04). Order matches the checklist table's row order. const DECLARED_REASON_FINGERPRINTS: readonly string[] = [ 'ajuste de CSS sobre el', // R1 — layout propio, no un parche sobre MessageComposer @@ -36,7 +36,7 @@ describe('T-007 acceptance #3 — mobile composer checklist is real, not prose', it('exists and cites the source file it was derived from', () => { expect(doc).toContain('MobileComposer.tsx'); - expect(doc).toContain('inbox-ai'); + expect(doc).toContain('Tracta'); }); it('has exactly one table row per declared reason, in order', () => { diff --git a/src/components/chat-sim/react/useKeyboardInset.ts b/src/components/chat-sim/react/useKeyboardInset.ts index aa6c5fd..39d9579 100644 --- a/src/components/chat-sim/react/useKeyboardInset.ts +++ b/src/components/chat-sim/react/useKeyboardInset.ts @@ -1,5 +1,5 @@ // react/useKeyboardInset.ts — the actual mobile-keyboard fix (architecture-v1.md §8 / T-007 -// acceptance #2). `MobileComposer.tsx` (inbox-ai, 13 KB fork) never touches `visualViewport` — +// acceptance #2). `MobileComposer.tsx` (Tracta, 13 KB fork) never touches `visualViewport` — // grepped, zero hits across its whole frontend — so THIS is new ground, not a port of anything. // // Two layers, deliberately BOTH present, because a consumer page may or may not set @@ -13,7 +13,7 @@ // 2. If the page does NOT (default `resizes-visual`, or an older engine): the layout viewport // stays full-height and `visualViewport` shrinks instead — THIS is the gap // `MobileComposer.tsx` never had to close because it relies entirely on native layout -// (architecture-v1.md §8's own framing) and inbox-ai apparently accepted that gap. The +// (architecture-v1.md §8's own framing) and Tracta apparently accepted that gap. The // fallback inset below (`innerHeight - visualViewport.height - offsetTop`) is what pulls the // composer back above the keyboard in that case. // diff --git a/src/components/chat-sim/styles.css b/src/components/chat-sim/styles.css index 2a89131..db67edf 100644 --- a/src/components/chat-sim/styles.css +++ b/src/components/chat-sim/styles.css @@ -4,7 +4,7 @@ * ALL tokens live under `.cf-chat-sim` — zero new declarations at `:root` (T-002 acceptance #2). * ZERO Tailwind utility classes anywhere in this family (T-002 acceptance #3) — every rule below * is a semantic class the element/ layer sets itself, styled here in plain CSS, the same - * language products/fovente-landingpage/src/components/ChatDemo.astro already speaks in + * language the retired first landing's ChatDemo.astro already speaks in * production (that continuity is deliberate — architecture-v1.md §12 point 4). * * Structure is adapter-driven, not channel-driven: every STRUCTURAL selector below keys off a @@ -759,7 +759,7 @@ infinite dot animation actually loop instead of restarting on every reconcile (the bug the old floating/`appendChild`-per-frame version had). It's a real bubble in the flow — same left/right rule as .cf-msg, same shape — not a floating pill. Numbers (5px dots, 3px gap, - 1.2s cycle, .18s stagger) match products/fovente-landingpage's global.css:444-451 exactly; + 1.2s cycle, .18s stagger) match the retired first landing's global.css:444-451 exactly; those are what read as WhatsApp instead of a generic spinner. */ .cf-typing-row { diff --git a/src/components/docs/Sitemap.tsx b/src/components/docs/Sitemap.tsx index f6b5100..cc3cc91 100644 --- a/src/components/docs/Sitemap.tsx +++ b/src/components/docs/Sitemap.tsx @@ -4,7 +4,7 @@ import { cva, type VariantProps } from 'class-variance-authority'; import { cn } from '../../utils/cn'; export interface SitemapNode { - /** Canonical path / slug (e.g. `/about`, `/products/inbox-ai`). */ + /** Canonical path / slug (e.g. `/about`, `/products/tracta`). */ path: string; /** Human-readable label rendered in the tree. */ label: string; diff --git a/src/components/ui/badge.tsx b/src/components/ui/badge.tsx index bf17d8f..2a6780c 100644 --- a/src/components/ui/badge.tsx +++ b/src/components/ui/badge.tsx @@ -16,7 +16,7 @@ const badgeVariants = cva( // Mismo motivo que en `button.tsx`: `--primary` es reasignable por la app // (Tracta lo ata al color del tenant), así que la tinta se deriva de él. // Las demás variantes conservan `text-white` a propósito — sus rellenos - // son colores FIJOS del sistema, no de marca. → inbox-ai#617 + // son colores FIJOS del sistema, no de marca. → tracta#617 default: "border-transparent bg-[var(--primary)] text-[var(--primary-foreground)] [a&]:hover:bg-[var(--primary)]/90", secondary: diff --git a/src/components/ui/button.tsx b/src/components/ui/button.tsx index 2c2a5f3..976b033 100644 --- a/src/components/ui/button.tsx +++ b/src/components/ui/button.tsx @@ -24,7 +24,7 @@ const buttonVariants = cva( // vivo de Tracta, tema oscuro: blanco sobre #D98D7D = 2.61:1, reprueba AA // en TODA acción primaria de la app. `--primary-foreground` ya existe en // `styles/index.css` y vale `#ffffff` en los dos temas, así que para quien - // no lo reasigne (TimelyAI, Landing) esto no mueve un píxel. → inbox-ai#617 + // no lo reasigne (TimelyAI, Landing) esto no mueve un píxel. → tracta#617 default: "bg-[var(--primary)] text-[var(--primary-foreground)] hover:bg-[var(--primary)]/90", destructive: "bg-[var(--destructive)] text-white hover:bg-[var(--destructive)]/90", outline: diff --git a/src/stories/chat-sim/ChatSimStates.stories.tsx b/src/stories/chat-sim/ChatSimStates.stories.tsx index 5c95653..302d702 100644 --- a/src/stories/chat-sim/ChatSimStates.stories.tsx +++ b/src/stories/chat-sim/ChatSimStates.stories.tsx @@ -53,7 +53,7 @@ export const Edit: Story = { }; /** chat-sim's `delete` removes the message from the visible thread — see - * `InboxAIReplacement.stories.tsx`'s `EditedAndDeletedDivergence` for why that's a named + * `TractaReplacement.stories.tsx`'s `EditedAndDeletedDivergence` for why that's a named * divergence from the real product's tombstone. Shown here alongside a second message so the * story isn't just an empty thread. */ export const Delete: Story = { diff --git a/src/stories/chat-sim/InboxAIReplacement.stories.tsx b/src/stories/chat-sim/TractaReplacement.stories.tsx similarity index 88% rename from src/stories/chat-sim/InboxAIReplacement.stories.tsx rename to src/stories/chat-sim/TractaReplacement.stories.tsx index d99721b..ef2f34d 100644 --- a/src/stories/chat-sim/InboxAIReplacement.stories.tsx +++ b/src/stories/chat-sim/TractaReplacement.stories.tsx @@ -1,17 +1,17 @@ -// stories/chat-sim/InboxAIReplacement.stories.tsx — T-008 acceptance #1. +// stories/chat-sim/TractaReplacement.stories.tsx — T-008 acceptance #1. // -// The fixtures below (inboxMessageFixtures.ts) are typed as the REAL inbox-ai `Message` -// (inbox-ai/frontend/src/lib/api.ts:229) via a plain cross-repo `import type` — no adapter, no +// The fixtures below (inboxMessageFixtures.ts) are typed as the REAL Tracta `Message` +// (tracta/frontend/src/lib/api.ts:229) via a plain cross-repo `import type` — no adapter, no // hand-copied mirror. If that interface's required fields ever change shape, this story stops -// compiling; there is no fallback path (see `__shims/inbox-ai-alias.d.ts` for the one thing that +// compiling; there is no fallback path (see `__shims/tracta-alias.d.ts` for the one thing that // IS shimmed, and why it doesn't loosen this). // -// "N KB reemplazables": inbox-ai/frontend/src/components/conversation/MessageBubble.tsx's own +// "N KB reemplazables": tracta/frontend/src/components/conversation/MessageBubble.tsx's own // `Ticks` (delivery-tick SVG, lines 1265-1286), `DeliveryStatus` (+ its `DELIVERY_STATUS_KEYS` // lookup, lines 1287-1364) and `ReactionPill` (lines 1125-1152) — the three blocks this replaces // end to end (receipt/read state + reactions). Measured with: // -// F=inbox-ai/frontend/src/components/conversation/MessageBubble.tsx +// F=tracta/frontend/src/components/conversation/MessageBubble.tsx // { sed -n '1125,1152p' "$F"; sed -n '1265,1286p' "$F"; sed -n '1287,1364p' "$F"; } | wc -c // => 4976 bytes (4.86 KB) // @@ -35,7 +35,7 @@ import { import '../../components/chat-sim/styles.css'; const meta: Meta = { - title: 'ChatSim/InboxAI Replacement', + title: 'ChatSim/Tracta Replacement', component: ChatSim, tags: ['autodocs'], parameters: { @@ -43,7 +43,7 @@ const meta: Meta = { description: { component: 'Replaces the receipt-tick, read-state and reaction rendering of `MessageBubble.tsx` ' + - '(inbox-ai) with `@cofoundy/ui/chat-sim`. Fixtures are typed against the real ' + + '(Tracta) with `@cofoundy/ui/chat-sim`. Fixtures are typed against the real ' + '`Message` interface — see the file header for the exact byte range replaced.', }, }, @@ -90,7 +90,7 @@ export const ReadReceipt: Story = { }, }; -/** `TELEGRAM_CHANNEL_POST` has no `views` count in the real `Message` shape — inbox-ai is a +/** `TELEGRAM_CHANNEL_POST` has no `views` count in the real `Message` shape — Tracta is a * 1:1 support inbox, not a broadcast channel, so there is no `view_count`-shaped field to map. * This story stays scoped to what IS derivable from `Message` (the delivery_status -> receipt * mapping, still exercised); `ChatSimStates.stories.tsx`'s `ViewsCounter` story is where the @@ -108,7 +108,7 @@ export const TelegramReceipt: Story = { /** * Two named divergences from the real product, both real findings (not silently patched over): * - * 1. **Edited.** inbox-ai's own `isEdited` check reads `message.metadata.edited === true` + * 1. **Edited.** Tracta's own `isEdited` check reads `message.metadata.edited === true` * (MessageBubble.tsx:182) — NOT `message.edited_at`, even though `Message` carries both. * `inboxMessageAdapter.ts` mirrors that exact field, on purpose (see its own comment) — a * mapper that used the more-obvious `edited_at` would compile fine and still not match diff --git a/src/stories/chat-sim/__shims/inbox-ai-alias.d.ts b/src/stories/chat-sim/__shims/tracta-alias.d.ts similarity index 76% rename from src/stories/chat-sim/__shims/inbox-ai-alias.d.ts rename to src/stories/chat-sim/__shims/tracta-alias.d.ts index c1e1b02..807b414 100644 --- a/src/stories/chat-sim/__shims/inbox-ai-alias.d.ts +++ b/src/stories/chat-sim/__shims/tracta-alias.d.ts @@ -1,14 +1,14 @@ -// Ambient shim for inbox-ai/frontend's `@/lib/auth` path alias. +// Ambient shim for tracta/frontend's `@/lib/auth` path alias. // -// InboxAIReplacement.stories.tsx type-checks its fixtures against the REAL -// `Message` interface at `inbox-ai/frontend/src/lib/api.ts:229` via a plain +// TractaReplacement.stories.tsx type-checks its fixtures against the REAL +// `Message` interface at `tracta/frontend/src/lib/api.ts:229` via a plain // cross-repo `import type`. That file's *own* top-level imports (`axios`, // `@/lib/auth`) are pulled into this package's `tsc` program the moment // anything imports from it — even a type-only import, since the checker // still needs to parse the whole module to find the exported symbol. // -// `axios` resolves fine (node module resolution walks up to inbox-ai's own -// node_modules). `@/lib/auth` does not: `@/*` is inbox-ai's OWN tsconfig +// `axios` resolves fine (node module resolution walks up to Tracta's own +// node_modules). `@/lib/auth` does not: `@/*` is Tracta's OWN tsconfig // alias, and packages/ui's tsconfig maps `@/*` to `./src/*` instead — there's // no `src/lib/auth` here. That is a module-resolution collision on an // import `Message` never touches, not a shape mismatch, so shimming it diff --git a/src/stories/chat-sim/lib/inboxMessageAdapter.ts b/src/stories/chat-sim/lib/inboxMessageAdapter.ts index 5c0d9ac..32a4948 100644 --- a/src/stories/chat-sim/lib/inboxMessageAdapter.ts +++ b/src/stories/chat-sim/lib/inboxMessageAdapter.ts @@ -1,5 +1,5 @@ // stories/chat-sim/lib/inboxMessageAdapter.ts — qa's own write cell (file-ownership-matrix.md: -// `src/stories/chat-sim/**` is `W` for qa). Turns a REAL inbox-ai `Message` (typed against the +// `src/stories/chat-sim/**` is `W` for qa). Turns a REAL Tracta `Message` (typed against the // actual interface, not a hand-copied mirror — T-008 acceptance #1) into the `SimStep[]` the // public chat-sim contract already understands (`post` / `receipt` / `edit` / `react`, // api-contract.md § "Tipos núcleo"). Nothing here reaches into chat-sim internals: every step @@ -9,12 +9,12 @@ // react/'s and core/'s internal shapes (`R`, not `W`, for qa per the ownership matrix), and // bypassing `compile`/`fold` would test a shortcut nobody ships, not the real replacement. -import type { Message } from '../../../../../../products/cofoundy-platform/inbox-ai/frontend/src/lib/api'; +import type { Message } from '../../../../../../projects/tracta/frontend/src/lib/api'; import type { ActorId, DeliveryState, SimStep } from '../../../components/chat-sim/core/types'; /** * `by: ActorId` convention (element/render.ts's own comment, api-contract.md's `Ev.draft` - * amendment): 'in' | 'out:ai' | 'out:human:' — the same three shapes inbox-ai's + * amendment): 'in' | 'out:ai' | 'out:human:' — the same three shapes Tracta's * `lib/messageGrouping.ts:25` groups by. Derived from `Message.direction` + `Message.sender`, * never invented. */ @@ -52,7 +52,7 @@ export interface ReactionInput { export interface MapMessageOptions { /** Reactions anchored to this message. NEVER read off `Message` — the real interface has no - * `reactions` field; inbox-ai's own `MessageBubbleProps.reactions` is a sibling prop, pulled + * `reactions` field; Tracta's own `MessageBubbleProps.reactions` is a sibling prop, pulled * out of the timeline upstream (`prepareTimeline`, MessageBubble.tsx:73-75). Mirroring that * split here (instead of inventing a `Message.reactions` that doesn't exist) is what keeps * this an honest replacement rather than a loosened one. */ @@ -71,7 +71,7 @@ export interface MapMessageOptions { * muted tombstone bubble (`SystemPlaceholder`, MessageBubble.tsx:1153-1179) in the deleted * message's place, while chat-sim's `delete` Ev removes the message from `SimState.order` * entirely (`fold.ts`'s visibility filter is `deleted === null`) — the thread behaves as if it - * never happened, not as if it happened-and-was-retracted. `InboxAIReplacement.stories.tsx` + * never happened, not as if it happened-and-was-retracted. `TractaReplacement.stories.tsx` * documents this at the story level; it is why the "N KB reemplazables" count in qa.md does NOT * include `SystemPlaceholder` — that block is not actually covered. */ diff --git a/src/stories/chat-sim/lib/inboxMessageFixtures.ts b/src/stories/chat-sim/lib/inboxMessageFixtures.ts index fb868c0..e19ab70 100644 --- a/src/stories/chat-sim/lib/inboxMessageFixtures.ts +++ b/src/stories/chat-sim/lib/inboxMessageFixtures.ts @@ -1,18 +1,18 @@ // stories/chat-sim/lib/inboxMessageFixtures.ts — qa's own write cell. // -// Representative inbox-ai `Message` objects, typed against the REAL interface -// (inbox-ai/frontend/src/lib/api.ts:229) — every required field is filled in explicitly, on +// Representative Tracta `Message` objects, typed against the REAL interface +// (tracta/frontend/src/lib/api.ts:229) — every required field is filled in explicitly, on // purpose: this is exactly what the "sin escape hatch" acceptance line is checking. Shared by -// InboxAIReplacement.stories.tsx (visual) and __tests__/chat-sim/inbox-message-adapter.test.ts +// TractaReplacement.stories.tsx (visual) and __tests__/chat-sim/inbox-message-adapter.test.ts // (behavioral) so both exercise the identical data. -import type { Message } from '../../../../../../products/cofoundy-platform/inbox-ai/frontend/src/lib/api'; +import type { Message } from '../../../../../../projects/tracta/frontend/src/lib/api'; const BASE_TS = '2026-09-04T15:00:00.000Z'; /** Plain inbound text — the simplest real row: a customer message, `queued` never applies * inbound (that's an outbound-only concept), so this is `delivered` (WhatsApp confirmed receipt - * server-side; inbox-ai never marks its own inbound rows `read` — that's the AGENT reading it). */ + * server-side; Tracta never marks its own inbound rows `read` — that's the AGENT reading it). */ export const INBOUND_TEXT: Message = { id: 'msg_1', conversation_id: 'conv_1', @@ -69,7 +69,7 @@ export const OUTBOUND_EDITED: Message = { /** Soft-deleted by the operator (#604) — `deleted_at` set, `channel_revoked: false` (WhatsApp * itself exposes no retraction; the customer's phone still shows it). See * `inboxMessageAdapter.ts`'s own doc comment for why chat-sim's `delete` Ev does NOT reproduce - * inbox-ai's real tombstone rendering, and why that's a named divergence, not a bug. */ + * Tracta's real tombstone rendering, and why that's a named divergence, not a bug. */ export const OUTBOUND_SOFT_DELETED: Message = { id: 'msg_4', conversation_id: 'conv_1', diff --git a/src/stories/docs/Sitemap.stories.tsx b/src/stories/docs/Sitemap.stories.tsx index da7aff2..7bc16f7 100644 --- a/src/stories/docs/Sitemap.stories.tsx +++ b/src/stories/docs/Sitemap.stories.tsx @@ -26,7 +26,7 @@ export const Default: Story = { intent: "informational", nav_group: "primary", children: [ - { path: "/products/inbox-ai", label: "Tracta" }, + { path: "/products/tracta", label: "Tracta" }, { path: "/products/agenda-ai", label: "Agenda AI" }, ], }, diff --git a/src/stories/navigation/NavDropdown.stories.tsx b/src/stories/navigation/NavDropdown.stories.tsx index 1aa9768..2f01017 100644 --- a/src/stories/navigation/NavDropdown.stories.tsx +++ b/src/stories/navigation/NavDropdown.stories.tsx @@ -1,563 +1,563 @@ -import type { Meta, StoryObj } from "@storybook/react"; -import * as React from "react"; - -import { - NavDropdown, - type NavDropdownItem, -} from "../../components/navigation/NavDropdown"; -import { VIEWPORT_MOBILE } from "../_shared/viewports"; - -const meta: Meta = { - title: "Navigation/NavDropdown", - component: NavDropdown, - tags: ["autodocs"], - parameters: { - layout: "centered", - docs: { - description: { - component: ` -A navigation dropdown component designed for navbar menus. - -## Features -- **Hover-to-open** on desktop, **click-to-open** on touch devices -- **150ms close delay** to prevent accidental closure -- **Keyboard navigation**: Arrow keys, Enter, Escape, Tab, Home, End -- **ARIA-compliant**: Proper roles, states, and keyboard support -- **Glassmorphism design**: Backdrop blur, subtle borders -- **Premium animations**: Smooth easing with scale and fade -- **Active state indicator**: Visual highlight for current page -- **Touch-friendly**: 44px minimum touch targets - -## Usage -\`\`\`tsx -import { NavDropdown } from '@cofoundy/ui' - - router.push(href)} -/> -\`\`\` - `, - }, - }, - }, - argTypes: { - variant: { - control: "radio", - options: ["dark", "light"], - description: "Theme variant", - }, - label: { - control: "text", - description: "Trigger button label", - }, - items: { - description: "Menu items array", - }, - onItemClick: { - action: "clicked", - description: "Callback when an item is clicked", - }, - }, - decorators: [ - (Story, context) => { - const isDark = context.args.variant === "dark"; - return ( -
- -
- ); - }, - ], -}; - -export default meta; -type Story = StoryObj; - -// Sample items for stories -const serviceItems: NavDropdownItem[] = [ - { - key: "landing", - href: "/servicios/landing-pages", - label: "Landing Pages", - description: "Tu landing lista en 7 días", - }, - { - key: "pollada", - href: "/servicios/pollada", - label: "Pollada Virtual", - description: "Portafolio desde S/.50", - }, - { - key: "chatbot", - href: "/servicios/chatbot", - label: "AI Chatbot", - description: "Automatiza tu atención 24/7", - }, - { - key: "fullstack", - href: "/servicios/fullstack", - label: "Desarrollo Fullstack", - description: "Apps a medida para tu negocio", - }, -]; - -const productItems: NavDropdownItem[] = [ - { - key: "timely", - href: "/productos/timely-ai", - label: "TimelyAI", - description: "Scheduling inteligente", - isActive: true, - }, - { - key: "inbox", - href: "/productos/inbox-ai", - label: "Tracta", - description: "Omnichannel inbox unificado", - }, - { - key: "pulse", - href: "/productos/pulse-ai", - label: "PulseAI", - description: "Voice agent para llamadas", - }, -]; - -// ============================================ -// Stories -// ============================================ - -export const Default: Story = { - args: { - label: "Servicios", - variant: "dark", - items: serviceItems, - }, -}; - -export const WithActiveItem: Story = { - args: { - label: "Productos", - variant: "dark", - items: productItems, - }, - parameters: { - docs: { - description: { - story: - "Items can have an `isActive` prop to indicate the current page. Shows a primary-colored left border and subtle background.", - }, - }, - }, -}; - -export const LightVariant: Story = { - args: { - label: "Servicios", - variant: "light", - items: serviceItems, - }, - parameters: { - docs: { - description: { - story: "Light variant for use on light backgrounds.", - }, - }, - }, -}; - -export const LightWithActive: Story = { - args: { - label: "Productos", - variant: "light", - items: productItems, - }, -}; - -export const MinimalItems: Story = { - args: { - label: "Resources", - variant: "dark", - items: [ - { key: "docs", href: "/docs", label: "Documentation" }, - { key: "blog", href: "/blog", label: "Blog" }, - ], - }, - parameters: { - docs: { - description: { - story: "Items without descriptions for a more compact menu.", - }, - }, - }, -}; - -export const CustomWidth: Story = { - args: { - label: "Solutions", - variant: "dark", - items: serviceItems, - menuClassName: "min-w-[360px]", - }, - parameters: { - docs: { - description: { - story: - "Use `menuClassName` to customize the dropdown width and other styles.", - }, - }, - }, -}; - -// Interactive demo with navbar context -export const InNavbar: Story = { - render: function Render() { - const [activeKey, setActiveKey] = React.useState("timely"); - - const items = productItems.map((item) => ({ - ...item, - isActive: item.key === activeKey, - })); - - return ( -
- {/* Simulated navbar */} - -
- Page content area. Click on Products dropdown to change active item. -
- Active product: {activeKey} -
-
- ); - }, - parameters: { - docs: { - description: { - story: - "Example of NavDropdown components used within a navbar context. The Products dropdown demonstrates interactive active state management.", - }, - }, - }, -}; - -// Mobile-first contract baseline — 375 px (iPhone SE). -// Verifies the 44 px tap-target claim from the component header against an -// actual mobile viewport. Required per packages/ui/CLAUDE.md. -export const MobileBaseline: Story = { - args: { - label: "Servicios", - variant: "dark", - items: serviceItems, - }, - parameters: { - viewport: VIEWPORT_MOBILE, - docs: { - description: { - story: - "Mobile baseline (375 px, iPhone SE). Trigger and menu items must keep ≥ 44×44 px touch targets — auditable visually at this viewport.", - }, - }, - }, -}; - -// Keyboard navigation demo -export const KeyboardNavigation: Story = { - args: { - label: "Keyboard Demo", - variant: "dark", - items: serviceItems, - }, - parameters: { - docs: { - description: { - story: ` -**Try these keyboard interactions:** -- **Tab** to focus the dropdown trigger -- **Enter/Space** to open the menu -- **Arrow Down/Up** to navigate items -- **Home/End** to jump to first/last item -- **Enter** to select an item -- **Escape** to close the menu -- **Tab** while open to close and move focus - `, - }, - }, - }, -}; - -// Touch device simulation -export const TouchBehavior: Story = { - args: { - label: "Tap to Open", - variant: "dark", - items: serviceItems, - }, - parameters: { - docs: { - description: { - story: - "On touch devices, the dropdown opens and closes on tap instead of hover. Test this on a mobile device or using browser dev tools touch simulation.", - }, - }, - }, -}; - -// ============================================ -// Featured Effects Stories -// ============================================ - -// Items with badge -const itemsWithBadge: NavDropdownItem[] = [ - { - key: "landing", - href: "/servicios/landing-pages", - label: "Landing Pages", - description: "Tu landing lista en 7 días", - }, - { - key: "pollada", - href: "/servicios/pollada", - label: "🍗 Pollada Virtual", - description: "¡Apoya al equipo! Desde S/.50", - badge: "Nuevo", - }, - { - key: "chatbot", - href: "/servicios/chatbot", - label: "AI Chatbot", - description: "Automatiza tu atención 24/7", - }, -]; - -export const WithBadge: Story = { - args: { - label: "Servicios", - variant: "dark", - items: itemsWithBadge, - }, - parameters: { - docs: { - description: { - story: "Items can have a `badge` prop to display a small tag (e.g., 'Nuevo', '🔥').", - }, - }, - }, -}; - -// Gold Shimmer Effect (card) -export const FeaturedShimmer: Story = { - args: { - label: "Servicios", - variant: "dark", - items: [ - { - key: "landing", - href: "/servicios/landing-pages", - label: "Landing Pages", - description: "Tu landing lista en 7 días", - }, - { - key: "pollada", - href: "/servicios/pollada", - label: "🍗 Pollada Virtual", - description: "¡Apoya al equipo! Desde S/.50", - badge: "Nuevo", - featured: "shimmer", - }, - { - key: "chatbot", - href: "/servicios/chatbot", - label: "AI Chatbot", - description: "Automatiza tu atención 24/7", - }, - ], - }, - parameters: { - docs: { - description: { - story: "**Gold Shimmer** - Horizontal gold light sweep animation on the card.", - }, - }, - }, -}; - -// Brand Gradient Border Effect (card) -export const FeaturedGradientBorder: Story = { - args: { - label: "Servicios", - variant: "dark", - items: [ - { - key: "landing", - href: "/servicios/landing-pages", - label: "Landing Pages", - description: "Tu landing lista en 7 días", - }, - { - key: "pollada", - href: "/servicios/pollada", - label: "🍗 Pollada Virtual", - description: "¡Apoya al equipo! Desde S/.50", - badge: "Nuevo", - featured: "gradient-border", - }, - { - key: "chatbot", - href: "/servicios/chatbot", - label: "AI Chatbot", - description: "Automatiza tu atención 24/7", - }, - ], - }, - parameters: { - docs: { - description: { - story: "**Brand Gradient Border** - Animated rotating border with Cofoundy brand colors.", - }, - }, - }, -}; - -// Both effects comparison -export const AllFeaturedEffects: Story = { - render: () => ( -
-
-

Gold Shimmer (Card)

- -
-
-

Brand Gradient Border (Card)

- -
-
- ), - parameters: { - docs: { - description: { - story: "Comparison of both featured effects side by side.", - }, - }, - }, -}; - -// Gold Glow Text Effect (ShimmerText on label) -export const FeaturedGoldGlow: Story = { - args: { - label: "Servicios", - variant: "dark", - items: [ - { - key: "landing", - href: "/servicios/landing-pages", - label: "Landing Pages", - description: "Tu landing lista en 7 días", - }, - { - key: "pollada", - href: "/servicios/pollada", - label: "🍗 Pollada Virtual", - description: "¡Apoya al equipo! Desde S/.50", - badge: "Nuevo", - featured: "gold-glow", - }, - { - key: "chatbot", - href: "/servicios/chatbot", - label: "AI Chatbot", - description: "Automatiza tu atención 24/7", - }, - ], - }, - parameters: { - docs: { - description: { - story: "**Gold Glow** - Animated shimmer effect on the text itself using ShimmerText component.", - }, - }, - }, -}; - -// Light mode featured -export const FeaturedLightMode: Story = { - args: { - label: "Servicios", - variant: "light", - items: [ - { - key: "landing", - href: "/servicios/landing-pages", - label: "Landing Pages", - description: "Tu landing lista en 7 días", - }, - { - key: "pollada", - href: "/servicios/pollada", - label: "🍗 Pollada Virtual", - description: "¡Apoya al equipo! Desde S/.50", - badge: "Nuevo", - featured: "shimmer", - }, - { - key: "chatbot", - href: "/servicios/chatbot", - label: "AI Chatbot", - description: "Automatiza tu atención 24/7", - }, - ], - }, - parameters: { - docs: { - description: { - story: "Featured effects also work in light mode.", - }, - }, - }, -}; +import type { Meta, StoryObj } from "@storybook/react"; +import * as React from "react"; + +import { + NavDropdown, + type NavDropdownItem, +} from "../../components/navigation/NavDropdown"; +import { VIEWPORT_MOBILE } from "../_shared/viewports"; + +const meta: Meta = { + title: "Navigation/NavDropdown", + component: NavDropdown, + tags: ["autodocs"], + parameters: { + layout: "centered", + docs: { + description: { + component: ` +A navigation dropdown component designed for navbar menus. + +## Features +- **Hover-to-open** on desktop, **click-to-open** on touch devices +- **150ms close delay** to prevent accidental closure +- **Keyboard navigation**: Arrow keys, Enter, Escape, Tab, Home, End +- **ARIA-compliant**: Proper roles, states, and keyboard support +- **Glassmorphism design**: Backdrop blur, subtle borders +- **Premium animations**: Smooth easing with scale and fade +- **Active state indicator**: Visual highlight for current page +- **Touch-friendly**: 44px minimum touch targets + +## Usage +\`\`\`tsx +import { NavDropdown } from '@cofoundy/ui' + + router.push(href)} +/> +\`\`\` + `, + }, + }, + }, + argTypes: { + variant: { + control: "radio", + options: ["dark", "light"], + description: "Theme variant", + }, + label: { + control: "text", + description: "Trigger button label", + }, + items: { + description: "Menu items array", + }, + onItemClick: { + action: "clicked", + description: "Callback when an item is clicked", + }, + }, + decorators: [ + (Story, context) => { + const isDark = context.args.variant === "dark"; + return ( +
+ +
+ ); + }, + ], +}; + +export default meta; +type Story = StoryObj; + +// Sample items for stories +const serviceItems: NavDropdownItem[] = [ + { + key: "landing", + href: "/servicios/landing-pages", + label: "Landing Pages", + description: "Tu landing lista en 7 días", + }, + { + key: "pollada", + href: "/servicios/pollada", + label: "Pollada Virtual", + description: "Portafolio desde S/.50", + }, + { + key: "chatbot", + href: "/servicios/chatbot", + label: "AI Chatbot", + description: "Automatiza tu atención 24/7", + }, + { + key: "fullstack", + href: "/servicios/fullstack", + label: "Desarrollo Fullstack", + description: "Apps a medida para tu negocio", + }, +]; + +const productItems: NavDropdownItem[] = [ + { + key: "timely", + href: "/productos/timely-ai", + label: "TimelyAI", + description: "Scheduling inteligente", + isActive: true, + }, + { + key: "inbox", + href: "/productos/tracta", + label: "Tracta", + description: "Omnichannel inbox unificado", + }, + { + key: "pulse", + href: "/productos/pulse-ai", + label: "PulseAI", + description: "Voice agent para llamadas", + }, +]; + +// ============================================ +// Stories +// ============================================ + +export const Default: Story = { + args: { + label: "Servicios", + variant: "dark", + items: serviceItems, + }, +}; + +export const WithActiveItem: Story = { + args: { + label: "Productos", + variant: "dark", + items: productItems, + }, + parameters: { + docs: { + description: { + story: + "Items can have an `isActive` prop to indicate the current page. Shows a primary-colored left border and subtle background.", + }, + }, + }, +}; + +export const LightVariant: Story = { + args: { + label: "Servicios", + variant: "light", + items: serviceItems, + }, + parameters: { + docs: { + description: { + story: "Light variant for use on light backgrounds.", + }, + }, + }, +}; + +export const LightWithActive: Story = { + args: { + label: "Productos", + variant: "light", + items: productItems, + }, +}; + +export const MinimalItems: Story = { + args: { + label: "Resources", + variant: "dark", + items: [ + { key: "docs", href: "/docs", label: "Documentation" }, + { key: "blog", href: "/blog", label: "Blog" }, + ], + }, + parameters: { + docs: { + description: { + story: "Items without descriptions for a more compact menu.", + }, + }, + }, +}; + +export const CustomWidth: Story = { + args: { + label: "Solutions", + variant: "dark", + items: serviceItems, + menuClassName: "min-w-[360px]", + }, + parameters: { + docs: { + description: { + story: + "Use `menuClassName` to customize the dropdown width and other styles.", + }, + }, + }, +}; + +// Interactive demo with navbar context +export const InNavbar: Story = { + render: function Render() { + const [activeKey, setActiveKey] = React.useState("timely"); + + const items = productItems.map((item) => ({ + ...item, + isActive: item.key === activeKey, + })); + + return ( +
+ {/* Simulated navbar */} + +
+ Page content area. Click on Products dropdown to change active item. +
+ Active product: {activeKey} +
+
+ ); + }, + parameters: { + docs: { + description: { + story: + "Example of NavDropdown components used within a navbar context. The Products dropdown demonstrates interactive active state management.", + }, + }, + }, +}; + +// Mobile-first contract baseline — 375 px (iPhone SE). +// Verifies the 44 px tap-target claim from the component header against an +// actual mobile viewport. Required per packages/ui/CLAUDE.md. +export const MobileBaseline: Story = { + args: { + label: "Servicios", + variant: "dark", + items: serviceItems, + }, + parameters: { + viewport: VIEWPORT_MOBILE, + docs: { + description: { + story: + "Mobile baseline (375 px, iPhone SE). Trigger and menu items must keep ≥ 44×44 px touch targets — auditable visually at this viewport.", + }, + }, + }, +}; + +// Keyboard navigation demo +export const KeyboardNavigation: Story = { + args: { + label: "Keyboard Demo", + variant: "dark", + items: serviceItems, + }, + parameters: { + docs: { + description: { + story: ` +**Try these keyboard interactions:** +- **Tab** to focus the dropdown trigger +- **Enter/Space** to open the menu +- **Arrow Down/Up** to navigate items +- **Home/End** to jump to first/last item +- **Enter** to select an item +- **Escape** to close the menu +- **Tab** while open to close and move focus + `, + }, + }, + }, +}; + +// Touch device simulation +export const TouchBehavior: Story = { + args: { + label: "Tap to Open", + variant: "dark", + items: serviceItems, + }, + parameters: { + docs: { + description: { + story: + "On touch devices, the dropdown opens and closes on tap instead of hover. Test this on a mobile device or using browser dev tools touch simulation.", + }, + }, + }, +}; + +// ============================================ +// Featured Effects Stories +// ============================================ + +// Items with badge +const itemsWithBadge: NavDropdownItem[] = [ + { + key: "landing", + href: "/servicios/landing-pages", + label: "Landing Pages", + description: "Tu landing lista en 7 días", + }, + { + key: "pollada", + href: "/servicios/pollada", + label: "🍗 Pollada Virtual", + description: "¡Apoya al equipo! Desde S/.50", + badge: "Nuevo", + }, + { + key: "chatbot", + href: "/servicios/chatbot", + label: "AI Chatbot", + description: "Automatiza tu atención 24/7", + }, +]; + +export const WithBadge: Story = { + args: { + label: "Servicios", + variant: "dark", + items: itemsWithBadge, + }, + parameters: { + docs: { + description: { + story: "Items can have a `badge` prop to display a small tag (e.g., 'Nuevo', '🔥').", + }, + }, + }, +}; + +// Gold Shimmer Effect (card) +export const FeaturedShimmer: Story = { + args: { + label: "Servicios", + variant: "dark", + items: [ + { + key: "landing", + href: "/servicios/landing-pages", + label: "Landing Pages", + description: "Tu landing lista en 7 días", + }, + { + key: "pollada", + href: "/servicios/pollada", + label: "🍗 Pollada Virtual", + description: "¡Apoya al equipo! Desde S/.50", + badge: "Nuevo", + featured: "shimmer", + }, + { + key: "chatbot", + href: "/servicios/chatbot", + label: "AI Chatbot", + description: "Automatiza tu atención 24/7", + }, + ], + }, + parameters: { + docs: { + description: { + story: "**Gold Shimmer** - Horizontal gold light sweep animation on the card.", + }, + }, + }, +}; + +// Brand Gradient Border Effect (card) +export const FeaturedGradientBorder: Story = { + args: { + label: "Servicios", + variant: "dark", + items: [ + { + key: "landing", + href: "/servicios/landing-pages", + label: "Landing Pages", + description: "Tu landing lista en 7 días", + }, + { + key: "pollada", + href: "/servicios/pollada", + label: "🍗 Pollada Virtual", + description: "¡Apoya al equipo! Desde S/.50", + badge: "Nuevo", + featured: "gradient-border", + }, + { + key: "chatbot", + href: "/servicios/chatbot", + label: "AI Chatbot", + description: "Automatiza tu atención 24/7", + }, + ], + }, + parameters: { + docs: { + description: { + story: "**Brand Gradient Border** - Animated rotating border with Cofoundy brand colors.", + }, + }, + }, +}; + +// Both effects comparison +export const AllFeaturedEffects: Story = { + render: () => ( +
+
+

Gold Shimmer (Card)

+ +
+
+

Brand Gradient Border (Card)

+ +
+
+ ), + parameters: { + docs: { + description: { + story: "Comparison of both featured effects side by side.", + }, + }, + }, +}; + +// Gold Glow Text Effect (ShimmerText on label) +export const FeaturedGoldGlow: Story = { + args: { + label: "Servicios", + variant: "dark", + items: [ + { + key: "landing", + href: "/servicios/landing-pages", + label: "Landing Pages", + description: "Tu landing lista en 7 días", + }, + { + key: "pollada", + href: "/servicios/pollada", + label: "🍗 Pollada Virtual", + description: "¡Apoya al equipo! Desde S/.50", + badge: "Nuevo", + featured: "gold-glow", + }, + { + key: "chatbot", + href: "/servicios/chatbot", + label: "AI Chatbot", + description: "Automatiza tu atención 24/7", + }, + ], + }, + parameters: { + docs: { + description: { + story: "**Gold Glow** - Animated shimmer effect on the text itself using ShimmerText component.", + }, + }, + }, +}; + +// Light mode featured +export const FeaturedLightMode: Story = { + args: { + label: "Servicios", + variant: "light", + items: [ + { + key: "landing", + href: "/servicios/landing-pages", + label: "Landing Pages", + description: "Tu landing lista en 7 días", + }, + { + key: "pollada", + href: "/servicios/pollada", + label: "🍗 Pollada Virtual", + description: "¡Apoya al equipo! Desde S/.50", + badge: "Nuevo", + featured: "shimmer", + }, + { + key: "chatbot", + href: "/servicios/chatbot", + label: "AI Chatbot", + description: "Automatiza tu atención 24/7", + }, + ], + }, + parameters: { + docs: { + description: { + story: "Featured effects also work in light mode.", + }, + }, + }, +}; diff --git a/src/stories/ui/Sidebar.stories.tsx b/src/stories/ui/Sidebar.stories.tsx index 8761e75..4c2ffad 100644 --- a/src/stories/ui/Sidebar.stories.tsx +++ b/src/stories/ui/Sidebar.stories.tsx @@ -1113,7 +1113,7 @@ export const CofoundyAppSidebar: Story = { // Tracta Dual Sidebar Pattern // Icon sidebar + Inbox list + Main content -export const InboxAISidebar: Story = { +export const TractaSidebar: Story = { render: () => { const [selectedMail, setSelectedMail] = React.useState(0); const [mobileOpen, setMobileOpen] = React.useState(false);