Julien Gautier 65671d9512
CI / scan (pull_request) Successful in 3m51s
CI / commits (pull_request) Successful in 3m53s
CI / check (pull_request) Successful in 4m18s
CI / a11y (pull_request) Successful in 2m28s
CI / perf (pull_request) Successful in 5m59s
feat(portal-shell): chatbot widget — SSE-bridged AI assistant with full a11y uplift
Closes the AI relay chantier opened by ADR-0024 by landing the SPA
side: a floating-launcher + dialog-panel chatbot that consumes the
BFF's POST /api/ai/chat SSE endpoint shipped in #196.

Stargate's POC widget was rebuilt from scratch rather than ported —
its drag UX, missing aria-live, and minimal screen-reader contract
did not meet ADR-0016's WCAG 2.2 AA + targeted AAA bar.

Key UX + a11y decisions:

- No drag. Stargate's mouse-only floating-bubble drag had no
  keyboard equivalent; replaced with a fixed bottom-right launcher
  + windowed/fullscreen toggle.
- role=dialog + aria-modal=false (non-modal) so the page stays
  operable behind the panel; focus returns to the launcher on
  close via a viewChild + effect pair.
- role=log + aria-live=polite + aria-relevant=additions on the
  message list, so screen readers announce incoming tokens
  without re-reading the full history. Typing-dots animation is
  decorative (aria-hidden) and gated on prefers-reduced-motion.
- Every interactive element honours the 44 × 44 touch-target
  minimum (launcher, header buttons, send/stop, citation chips).
- Stop button visible during streaming, wired to AbortController →
  ChatClient → upstream LLM cancel.
- Citations rendered as inline footnote chips; clicking opens a
  side-panel sibling component with source + score + snippet.
- All strings tagged with $localize per ADR-0019; FR + EN catalogue
  entries added.
- 5 new icons in the shared registry: maximize-2, message-circle,
  minimize-2, send, square, x.

Architecture:

- ChatbotApiService — native fetch (HttpClient buffers streaming)
  + ReadableStream parser + manual CSRF cookie read + AbortSignal.
- SSE parser — pure function with CRLF tolerance, partial-frame
  reassembly, and well-formed JSON / passthrough decoding.
- ChatbotService — signal-based state (view / messages / streaming
  / selected citation) with stop() / send() actions; ephemeral
  conversation per session reload.
- ChatbotHost component — host of the widget; ChatbotCitationPanel
  extracted as a sibling component to stay under
  anyComponentStyle budget (raised from 5/6 to 6/8 KB to match
  portal-admin's posture).
- Lazy-loaded via @defer (on idle) in app.html so the chatbot's
  ~27 KB lazy chunk does not weigh on the initial bundle.

Tests: 27 new specs covering the SSE parser (8), API service (5),
state service (10), and host component (12 — launcher / dialog /
empty state / messages / log live region / input / citation panel).
2026-05-19 23:37:10 +02:00

Documentation index

This is the entry point to all project documentation. It is maintained automatically: any addition, rename, or removal of a .md file under docs/ must be reflected here in the same change.

Conventions

  • Documentation is written in English.
  • One topic per file. Group related files into a folder when there are three or more.
  • Cross-reference with relative links so they keep working in GitHub, IDEs, and exported sites.
  • For architectural decisions, do not add them here — they belong in decisions/ as MADR 4.0.0 ADRs.

Sections

Daily development

  • development.md — repo layout, prerequisites, initial setup, daily commands, observability dev-loop (Jaeger UI, log ↔ trace correlation), dependency updates (Renovate), conventional commit cycle. Day-to-day reference for working on the project.

Architecture

  • architecture.md — cross-cutting Mermaid diagrams: C4 system context, C4 containers, Nx module boundaries, CI/CD pipeline. Single-decision diagrams (auth sequence, ERD, etc.) live inline in their ADR.

Onboarding & environment

Setup guides for new contributors:

Operations & runbooks

Empty — to be populated when we deploy.

Security, performance, accessibility

Empty — placeholders to be filled with rationale docs alongside their corresponding ADRs.

S
Description
No description provided
Readme 42 MiB
Languages
TypeScript 85.3%
JavaScript 5.4%
SCSS 4.3%
HTML 3.9%
Shell 0.8%
Other 0.3%