Skip to content

feat(chat): generative UI structured components (PR #210 rebased on develop) - #415

Draft
esafwan wants to merge 1 commit into
developfrom
task/PR-210-repair
Draft

feat(chat): generative UI structured components (PR #210 rebased on develop)#415
esafwan wants to merge 1 commit into
developfrom
task/PR-210-repair

Conversation

@esafwan

@esafwan esafwan commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Problem

Repairs #210 (Generative UI: structured component system for rich chat responses). The original branch was 4 months stale and bot-authored; 14 of 16 files were conflict-free, and the one conflicting file (MessageContentWithArtifacts.tsx) is re-implemented here against develop's shared parsing pipeline (parseMessagePreview). Docs-only commits (docs/evaluations/*) deliberately not carried over.

Scope (14 files, +943)

  • frontend/src/components/chat/ui-components/: uiComponentParser.ts (relocated parser, import paths adjusted to develop's layout) + renderers (ProgressCard, StatsCard, etc.)
  • MessageContentWithArtifacts.tsx: re-implemented against the shared pipeline
  • types/artifact.types.ts and chat integration wiring

Key decisions

Agent contributions

Intake dossier + repair (cherry-pick + conflict re-implementation + verification) by the release-orchestration pipeline; the pipeline verified the diff (14 files, in-scope).

Tests executed

  • npx tsc -b, npx vite build, npx eslint on changed dirs — all green.
  • Isolated bench 16_ro: yarn build green, /huf serves 200.

Risks and limitations

  • Renderer coverage is the PR's original set; new artifact kinds need new renderers (by design).
  • Not exercised with a live agent producing structured components — a chat smoke with a component-emitting agent is recommended before undrafting.
  • Import-path divergence from the original PR means cherry-picking future upstream changes onto this branch needs care.

Rollback

Revert the branch; chat falls back to plain message rendering.

Remaining work

Cherry-picked from PR #210 (dev/huf-generative-ui-evaluation-ec71, commit
20ea060) onto develop. Re-implements the MessageContentWithArtifacts
integration against develop's shared parsing pipeline
(parseMessagePreviewContent + messageId prop + safe decodeHtmlEntities)
instead of the PR's pre-refactor shape; UI components are extracted first,
preserving parse order UI -> JSX -> web-preview -> artifact.

Parser relocated from frontend/src/utils/uiComponentParser.ts to
frontend/src/components/chat/ui-components/uiComponentParser.ts to stay
within the allowed change scope. Fixes latent TS2339 union-type errors in
Area/Line chart renderers and a stale 'lazy-loaded' comment in registry.ts.

Docs commits 5b928aa and a55b25e (docs/evaluations/*) intentionally
omitted: outside allowed scope.
Comment on lines +28 to +30
return raw
.replace(/"/g, '"')
.replace(/&/g, '&')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants