toga-ai 1.0.628 → 1.0.629
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: session
|
|
3
|
+
slug: talos-shared-component
|
|
4
|
+
title: Talos shared AI-assistant component (blox) + supply integration
|
|
5
|
+
author: apeterson
|
|
6
|
+
repos: [toga-blox, toga25-supply]
|
|
7
|
+
framework: "2.0"
|
|
8
|
+
client: shared
|
|
9
|
+
status: active
|
|
10
|
+
created: 2026-08-20
|
|
11
|
+
updated: 2026-08-20
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
# Session: talos-shared-component
|
|
15
|
+
**Date:** 2026-08-20
|
|
16
|
+
**Project/Repo:** toga-blox + toga25-supply (2.0)
|
|
17
|
+
**Task:** Build Talos (AI assistant: header launcher button + slide-out chat panel) as a shared, fully-themeable blox component (TRUE-80692) and wire it into toga25-supply for all clients (TRUE-80693), UI-shell-only with a stub onSend.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## What WORKED
|
|
22
|
+
- New `src/components/Talos/` in toga-blox-npm: TalosLauncher, TalosPanel, TalosMessage, types.ts, theme.ts, helpers.tsx, stub.ts, Talos.module.css, index.ts — exported from `src/components/index.ts`. `npm run build` clean; files land in `dist/components/Talos/`. TS typecheck clean.
|
|
23
|
+
- Pure-UI + injected adapter design: `TalosAdapter` = onSend(text)=>Promise<TalosResponse>, onOpenRecord(id), onAction(key), onDockWidthChange(px), onAttach(). No window.* globals. `createTalosStubAdapter()` ships for backend-free demos.
|
|
24
|
+
- Controlled state: open/expanded/width owned by host via onOpenChange/onExpandedChange/onWidthChange.
|
|
25
|
+
- Full CSS tokenization: every color/font-size/weight/line-height/radius/shadow/dimension is `var(--talos-*, default)`. Talos.module.css IS the default theme.
|
|
26
|
+
- Theme override model: typed `TalosTheme` (theme.ts) + `talosThemeToVars()` applied as inline `--talos-*` on launcher/panel/scrim roots; unset keys fall through to defaults. Any --talos-* is also overridable via host CSS.
|
|
27
|
+
- Supply wiring (AppLayout.tsx): owns talosOpen/Expanded/Width/DockWidth state, memoized stub adapter (onOpenRecord -> navigate `/sales-orders?sales-orders=<id>`; onAction "approvals" -> `/sales-orders`; onDockWidthChange -> reserve width). Launcher in Header via new presentational `talosLauncher` slot + `.headerActions` flex wrapper; TalosPanel at app root. Enabled for ALL clients. Owl asset copied to supply `src/assets/talos-owl.png`, passed as branding.avatarSrc (fixes button + welcome orb + message avatar). Plus Jakarta Sans loaded in supply `src/index.css`. Supply typecheck: 0 errors.
|
|
28
|
+
- Header-overlap bug fixed: dock-width reservation moved to the OUTER app wrapper (marginRight) so the header shifts with content and the launcher/avatar stay visible.
|
|
29
|
+
- Two ecc:react-reviewer passes applied (quality + fidelity-vs-prototype). See Decisions.
|
|
30
|
+
- Committed + pushed both branches: toga-blox TRUE-80692 (commit 2c34dec1), toga25-supply TRUE-80693 (commit a346833). Upstreams set.
|
|
31
|
+
- Captured to KB: 2 feature docs published to _main (2.0/apps/toga-blox/features/talos-assistant.md, 2.0/apps/toga25-supply/features/talos-integration.md).
|
|
32
|
+
|
|
33
|
+
## What did NOT work — DO NOT RETRY THESE
|
|
34
|
+
- Fetching the claude.ai `/design/p/...` design URL via WebFetch or the Chrome DevTools MCP browser: blocked by Cloudflare bot challenge (`cf-mitigated: challenge`) + a login/human-check that fails in an automation-controlled browser. Not an auth-cookie issue. Resolution: user downloaded the bundle locally (`~/Downloads/TOGa Supply (Pipeline)/demo/talos.jsx`). Do not re-attempt remote fetch of design URLs.
|
|
35
|
+
- Reserving dock width only on `<main>`: leaves the header's right edge under the fixed docked panel, hiding the launcher + avatar (blox Header is normal-flow, NOT fixed). Must reserve on the outer wrapper instead.
|
|
36
|
+
- Keeping `window.dispatchEvent(new Event("resize"))` on resize drag-end (from prototype): flagged CRITICAL as adapter-bypass; removed. Host gets width via onWidthChange/onDockWidthChange instead — do not re-add.
|
|
37
|
+
|
|
38
|
+
## Not tried yet (candidates for next session)
|
|
39
|
+
- Spacing-token pass: ~38 padding/gap/margin literals in Talos.module.css are still hardcoded, so density is NOT themeable. Add `--talos-space-*` tokens and/or a `density` preset prop ("comfortable"|"compact") — awaiting UX/UI input (handoff recap given to team).
|
|
40
|
+
- Structural variants: launcher `variant` ("icon"|"pill") and/or optional panel-mode props (e.g. drop expanded mode for a small Desk side chat) — awaiting UX input.
|
|
41
|
+
- Real `onSend` backend adapter (this ticket is UI-shell + stub only) — separate later ticket.
|
|
42
|
+
- Publish toga-blox TRUE-80692 to npm (per `_sandbox-dev` dist-tag workflow) so consumers other than supply (which uses the local symlink) get Talos.
|
|
43
|
+
- Wire a supply-specific `theme` object if supply should diverge from the default look (currently uses default).
|
|
44
|
+
- Approvals action only routes to `/sales-orders`; deeper auto-apply of the approvals filter (local page state, not URL) is not wired.
|
|
45
|
+
|
|
46
|
+
## Current file state
|
|
47
|
+
| File | Status | Notes |
|
|
48
|
+
|------|--------|-------|
|
|
49
|
+
| toga-blox src/components/Talos/*.tsx,.ts,.css | Created | Full component; committed TRUE-80692; built to dist |
|
|
50
|
+
| toga-blox src/components/index.ts | Modified | Added `export * from "./Talos"` |
|
|
51
|
+
| toga25-supply src/layout/AppLayout/AppLayout.tsx | Modified | Talos state + stub adapter + launcher/panel mount + dock-width reservation + owl branding |
|
|
52
|
+
| toga25-supply src/components/Header/Header.tsx | Modified | `talosLauncher` slot prop (committed earlier in 2ea8d3f) |
|
|
53
|
+
| toga25-supply src/components/Header/Header.module.css | Modified | `.headerActions` flex wrapper |
|
|
54
|
+
| toga25-supply src/index.css | Modified | Plus Jakarta Sans @import |
|
|
55
|
+
| toga25-supply src/assets/talos-owl.png | Created | Owl asset from design bundle |
|
|
56
|
+
|
|
57
|
+
## Decisions made
|
|
58
|
+
- UI-shell only this ticket: build component + adapter, wire supply with stub onSend; real backend later. Rejected: wiring a live backend now (out of scope).
|
|
59
|
+
- Injected props/context adapter (no window.* globals). Rejected: the prototype's window.__* bridge (implicit coupling, not reusable).
|
|
60
|
+
- Fully tokenized styling; Talos.module.css is the DEFAULT theme; consumers override via typed `TalosTheme` prop and/or raw --talos-* CSS. Rejected: (a) hardcoded literals; (b) stripping all defaults so every consumer must ship a full theme (renders unstyled standalone).
|
|
61
|
+
- Font loaded by the HOST (supply index.css), not a forced @import inside the shared CSS; component default family is "Plus Jakarta Sans". Rationale: avoids a network/CSP side effect in the shared lib while still giving prototype typography.
|
|
62
|
+
- Review pass 1 (quality) fixes: removed hardcoded "JB" -> branding.userInitials + glyph; removed window resize dispatch; per-conversation busy guard; resize listeners in an effect (cleanup + rAF throttle + keyboard role="separator"); ESC handler via ref; diffed dock-width broadcast (avoids inline-adapter re-render loop); composer aria-label; SSR-safe portal; memoized TalosMessage + handlers.
|
|
63
|
+
- Review pass 2 (fidelity): restored 11px card radius (own `--talos-radius-card` token); restored attach/paper-clip button wired to optional onAttach. Deliberately KEPT OUT: window resize dispatch and the brand "online" status row (dead CSS in the prototype too).
|
|
64
|
+
|
|
65
|
+
## Blockers
|
|
66
|
+
None. Both branches pushed; KB captured. Next work is UX-input-gated (density/variants) or a separate ticket (real backend, blox npm publish).
|
|
67
|
+
|
|
68
|
+
## Exact next step
|
|
69
|
+
> When UX/UI returns input on density: do the spacing-token pass in `toga-blox-npm/src/components/Talos/Talos.module.css` (tokenize the ~38 padding/gap/margin literals into `--talos-space-*`) and add a `density?: "comfortable" | "compact"` prop to TalosPanel that swaps a spacing preset; expose the new tokens in `TalosTheme` (theme.ts). Then `npm run build`. Separately, when ready for other consumers: publish toga-blox TRUE-80692 to npm via the `_sandbox-dev` dist-tag workflow.
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
_Saved by /session-save on 2026-08-20_
|
package/package.json
CHANGED