Skip to content

Add Chart.js-based chart renderer and enforce immediate visual output#71

Merged
Abdulmuiz44 merged 1 commit into
codex/ui-redesignfrom
codex/add-chart.js-support-to-tera
Apr 8, 2026
Merged

Add Chart.js-based chart renderer and enforce immediate visual output#71
Abdulmuiz44 merged 1 commit into
codex/ui-redesignfrom
codex/add-chart.js-support-to-tera

Conversation

@Abdulmuiz44
Copy link
Copy Markdown
Collaborator

Motivation

  • Provide a first-class, always-rendering chart pipeline by switching the client chart renderer to Chart.js so visuals requested by users reliably render in-browser.
  • Ensure the LLM-driven visual workflow produces a visual immediately when the user explicitly asks for one, aligning system prompts across client and backend.

Description

  • Replaced the previous Recharts-based renderer with a Chart.js canvas implementation in components/visuals/ChartRenderer.tsx, including Chart.js registration, chart-type normalization, data/series inference, nested-series flattening, themed options, and canvas export support (toBase64Image).
  • Updated system prompt behavior in lib/mistral.ts and backend-server/src/services/mistral.ts so an explicit user request for a visual causes the model to generate the visual immediately in the required json:tera-ui format.
  • Added chart.js to package.json and updated the lockfile (pnpm-lock.yaml) so Chart.js is installed and available to the client renderer.
  • Preserved download/export UX by switching the download implementation to Chart.js canvas export and kept the existing chart configuration compatibility (line/bar/area/pie/radar/scatter/composed aliases).

Testing

  • Ran type checking with pnpm run type-check, which completed successfully.
  • Installed Chart.js with pnpm add chart.js@^4.4.3 (lockfile shows chart.js@4.5.1) and validated the dependency was added to package.json and pnpm-lock.yaml.
  • Ran lint with pnpm run lint, which failed due to an unrelated configuration error: Invalid project directory provided, no such directory: /workspace/Tera/lint.

Codex Task

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@Abdulmuiz44 Abdulmuiz44 merged commit 2103f39 into codex/ui-redesign Apr 8, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant