Skip to content

feat(ui): inline result charts for agent answers#330

Open
Manushpm8 wants to merge 5 commits into
NVIDIA-AI-Blueprints:developfrom
Manushpm8:feat/inline-result-charts
Open

feat(ui): inline result charts for agent answers#330
Manushpm8 wants to merge 5 commits into
NVIDIA-AI-Blueprints:developfrom
Manushpm8:feat/inline-result-charts

Conversation

@Manushpm8

@Manushpm8 Manushpm8 commented Jul 13, 2026

Copy link
Copy Markdown

What this does

Lets the agent present numeric answers (rankings, trends, distributions, gains/losses, single metrics) as inline charts instead of walls of text or tables. The agent writes a small JSON chart spec in its reply; the frontend renders it as a styled inline SVG. No code execution and no new runtime dependencies.

How it works

  1. The agent emits a fenced chart (or chart-carousel) block of JSON in its answer.
  2. MarkdownRenderer detects that fence and hands it to the new ResultChart module.
  3. The spec is validated (Zod), normalized, and rendered as an SVG chart.
  4. If a spec is malformed, it falls back to a normal code block, so nothing breaks.

Inline result charts (transparent cards, dark theme)

Chart types

bar, hbar, line, area, grouped-bar, delta (diverging gains/losses), KPI-only cards, and a pageable chart-carousel. One answer can contain several charts.

Correctness and safety

  • Safe-by-default axes: magnitude bars start at zero, axis ticks compact large numbers, and rankings that exceed the row cap show a disclosed "top N of M" note (never a silent drop).
  • Missing points render as gaps, never as an implied zero.
  • Each chart has a "Show data" toggle and a CSV export; the CSV neutralizes spreadsheet formula injection while preserving real negative values.
  • The spec's colors are a fixed enum and all text is escaped React content, so an agent-authored spec has no injection surface.

Where the numbers come from

The renderer is tool agnostic: it charts whatever numbers a tool returns, so it works today with web search and will work with any future data source. A generic chart contract was added to the shallow researcher and deep-research writer prompts (no dataset-specific coupling) and is guarded by a test.

Testing

  • 100% statement, branch, function, and line coverage on the ResultChart module, enforced by a scoped Vitest threshold (global coverage is unaffected).
  • Type-check, lint, the full frontend test suite, and the prompt-contract pytest all pass.
  • Verified end to end in a browser against a live agent: a real query produced a chart spec that rendered as an inline bar chart with the Show data and CSV controls.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added interactive result charts in markdown, including chart carousels, KPI-only cards, tooltips, legends, and data-table views with toggle controls.
    • Added CSV export for chart data with safe filenames and protected CSV formula injection.
    • Added automatic detection and fenced rendering for agent-emitted chart specs (including bare JSON lines).
  • Documentation
    • Updated agent prompt guidance to enforce the chart JSON contract and carousel/chart placement rules.
  • Bug Fixes
    • Added graceful fallbacks for malformed chart fences and improved degenerate/flat ranking handling.
  • Tests
    • Expanded rendering and parsing coverage, plus added thorough chart component/unit tests and stricter chart module coverage thresholds.

Render agent-authored ```chart / ```chart-carousel JSON specs as themed inline
SVG so numeric answers (rankings, trends, distributions, gains/losses, single
metrics) read as charts, not walls of prose or tables.

- New self-contained ResultChart module (frontends/ui/.../ResultChart): a Zod
  spec contract, pure parse/normalize/scale/geometry/render layers, and a thin
  SVG shell. Chart types: bar, hbar, line, area, grouped-bar, delta, KPI-only,
  and a pageable chart-carousel. Per-chart "Show data" toggle and CSV export
  (CSV neutralizes spreadsheet formula injection).
- MarkdownRenderer routes ```chart fences to the renderer and falls back to a
  code block when a spec is malformed; multiple charts per answer are supported.
- Safe-by-default rendering: zero-baseline magnitude bars, compacted axis ticks,
  disclosed top-N truncation for rankings, gaps (never zero) for missing points.
- Generic chart contract added to the shallow researcher and deep-research
  writer prompts; a pytest guards the embedded examples against schema drift.
- 100% statement/branch/function/line coverage for the module, enforced by a
  scoped vitest threshold.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Manush Maheshwari <manushm@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Jul 13, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

Changes

Result chart pipeline

Layer / File(s) Summary
Chart contracts and data preparation
frontends/ui/src/shared/components/ResultChart/types.ts, parse.ts, normalize.ts, scale.ts, geometry.ts, palette.ts
Adds validated chart, carousel, and KPI schemas; parsing, normalization, truncation, scaling, geometry, formatting, palette utilities, and public exports.
SVG renderer engine
frontends/ui/src/shared/components/ResultChart/renderers/*
Adds typed drawing marks, axis helpers, vertical and horizontal bar renderers, line/area renderers, renderer registration, and renderer tests.
Interactive chart UI
frontends/ui/src/shared/components/ResultChart/*.tsx, frontends/ui/src/app/globals.css
Adds chart blocks, SVG rendering, KPI cards, data tables, toolbars, CSV export, carousel navigation, accessibility behavior, styling, and tests.
Markdown and agent integration
frontends/ui/src/shared/components/MarkdownRenderer/*, src/aiq_agent/agents/*/prompts/*.j2, tests/aiq_agent/agents/test_result_chart_prompt.py, frontends/ui/vitest.config.ts
Recognizes chart fences and bare chart JSON, documents chart output requirements, validates prompt examples, and enforces complete chart-module coverage.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant AgentPrompt
  participant MarkdownRenderer
  participant ChartBlock
  participant ResultChart
  participant ChartToolbar
  participant ChartDataTable

  AgentPrompt->>MarkdownRenderer: emit chart or chart-carousel JSON
  MarkdownRenderer->>ChartBlock: normalize and pass fence contents
  ChartBlock->>ResultChart: parse and render chart specification
  ResultChart->>ChartToolbar: render data and CSV controls
  ChartToolbar->>ChartDataTable: toggle accessible data table
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers the feature, but it does not follow the required template and omits the DCO sign-off, validation checklist, reviewer start point, and related issues. Rewrite the PR description using the required template, add the exact DCO sign-off, complete the validation checklist, and include reviewer-start and related-issues sections.
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title follows Conventional Commits and accurately summarizes the inline chart rendering change.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Biome (2.5.3)
frontends/ui/src/app/globals.css

File contains syntax errors that prevent linting: Line 155: Tailwind-specific syntax is disabled.; Line 168: Tailwind-specific syntax is disabled.; Line 172: Tailwind-specific syntax is disabled.; Line 176: Tailwind-specific syntax is disabled.; Line 180: Tailwind-specific syntax is disabled.; Line 184: Tailwind-specific syntax is disabled.; Line 188: Tailwind-specific syntax is disabled.; Line 192: Tailwind-specific syntax is disabled.; Line 196: Tailwind-specific syntax is disabled.; Line 200: Tailwind-specific syntax is disabled.; Line 208: Tailwind-specific syntax is disabled.; Line 212: Tailwind-specific syntax is disabled.; Line 216: Tailwind-specific syntax is disabled.; Line 220: Tailwind-specific syntax is disabled.; Line 225: Tailwind-specific syntax is disabled.; Line 231: Tailwind-specific syntax is disabled.; Line 235: Tailwind-specific syntax is disabled.; Line 239: Tailwind-specific syntax is disabled.; Line 247: Tailwind-specific syntax is disabled.; Line 251: Tailwind-specific syntax is disabled.; Line 255: Tailwind-specific syntax is disabled.; Line 259: Tailwind-specific syntax is disabled.; Line 263: Tailwind-specific syntax is disabled.; Line 267: Tailwind-specific syntax is disabled.; Line 271: Tailwind-specific syntax is disabled.; Line 275: Tailwind-specific syntax is disabled.; Line 279: Tailwind-specific syntax is disabled.; Line 283: Tailwind-specific syntax is disabled.


Comment @coderabbitai help to get the list of available commands.

@Manushpm8
Manushpm8 marked this pull request as ready for review July 13, 2026 20:07

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 9

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@frontends/ui/src/app/globals.css`:
- Around line 391-396: Update the .result-chart-kpi.tone-warn and
.result-chart-kpi.tone-alarm styles to use the existing semantic feedback theme
tokens for warning and danger text colors instead of hardcoded hex values,
preserving the current tone-specific behavior.

In `@frontends/ui/src/shared/components/ResultChart/ChartBlock.tsx`:
- Around line 19-35: Memoize the parsing and normalization pipeline inside
ChartBlock using raw as the dependency, including parseCarouselSpec,
parseChartSpec, degenerateKpis, normalizeChart, and parseKpiSpec. Keep the
existing rendering precedence and fallback behavior unchanged while returning
the memoized result for unchanged raw content.

In `@frontends/ui/src/shared/components/ResultChart/ChartToolbar.spec.tsx`:
- Around line 17-19: Move the URL global cleanup from the test body into the
existing ChartToolbar afterEach hook, ensuring vi.unstubAllGlobals() runs even
when assertions fail. Keep the cleanup alongside vi.restoreAllMocks() and remove
the now-redundant inline cleanup from the affected test.

In `@frontends/ui/src/shared/components/ResultChart/ChartToolbar.tsx`:
- Around line 18-26: Connect the disclosure control to its data region: in
frontends/ui/src/shared/components/ResultChart/ChartToolbar.tsx lines 18-26, add
a matching aria-controls value to the toggle button; in
frontends/ui/src/shared/components/ResultChart/ChartDataTable.tsx line 13, add
the same value as an id on the role="region" div.

In `@frontends/ui/src/shared/components/ResultChart/renderers/bar.ts`:
- Around line 41-43: Update the single-series value-label placement in the bar
renderer around the marks.push call to branch on value >= 0: keep positive
labels above the bar, but place negative labels below its tip with the
appropriate offset and anchor, matching the behavior of renderHbar. Ensure
labels remain connected to the bar for both value directions.

In `@frontends/ui/src/shared/components/ResultChart/renderers/hbar.ts`:
- Around line 19-46: Align delta chart legend behavior with the sign-based bar
colors in renderHbar: update the ResultChart legend logic to suppress the
per-series legend when spec.type is "delta" (or otherwise provide a sign-based
legend). Preserve the existing series legend for non-delta charts and keep the
current GAIN/LOSS bar coloring unchanged.

In `@frontends/ui/src/shared/components/ResultChart/ResultChart.tsx`:
- Around line 136-180: Update the interactive rect and dot marks in the
ResultChart rendering switch to be keyboard focusable and expose the same
tooltip behavior on focus and blur as on mouse movement and leave. Reuse the
existing tipHandlers integration and preserve the ChartDataTable fallback and
current visual rendering.

In `@src/aiq_agent/agents/shallow_researcher/prompts/researcher.j2`:
- Around line 36-60: Extract the duplicated “Presenting Data (Charts)” guidance
into a shared Jinja partial, preserving the chart contract, schema, and examples
byte-for-byte; update
src/aiq_agent/agents/shallow_researcher/prompts/researcher.j2 lines 36-60 and
src/aiq_agent/agents/deep_researcher/prompts/writer.j2 lines 105-129 to include
it, using a template variable only for required per-agent wording differences.

In `@tests/aiq_agent/agents/test_result_chart_prompt.py`:
- Around line 36-42: Extend the prompt contract tests to extract and validate
chart-carousel examples, not just detect the substring. Add a carousel fence
matcher and a helper alongside _chart_examples, then update
test_prompt_chart_examples_match_the_schema to require a non-empty charts list
and apply the existing full-chart schema assertions to every carousel entry.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: adfe0d1e-8feb-4ff6-84b9-aa0410ecbf62

📥 Commits

Reviewing files that changed from the base of the PR and between 34b35f5 and ad7de73.

📒 Files selected for processing (44)
  • frontends/ui/src/app/globals.css
  • frontends/ui/src/shared/components/MarkdownRenderer/MarkdownRenderer.chart.spec.tsx
  • frontends/ui/src/shared/components/MarkdownRenderer/MarkdownRenderer.tsx
  • frontends/ui/src/shared/components/ResultChart/ChartBlock.spec.tsx
  • frontends/ui/src/shared/components/ResultChart/ChartBlock.tsx
  • frontends/ui/src/shared/components/ResultChart/ChartDataTable.spec.tsx
  • frontends/ui/src/shared/components/ResultChart/ChartDataTable.tsx
  • frontends/ui/src/shared/components/ResultChart/ChartKpi.spec.tsx
  • frontends/ui/src/shared/components/ResultChart/ChartKpi.tsx
  • frontends/ui/src/shared/components/ResultChart/ChartToolbar.spec.tsx
  • frontends/ui/src/shared/components/ResultChart/ChartToolbar.tsx
  • frontends/ui/src/shared/components/ResultChart/ResultChart.spec.tsx
  • frontends/ui/src/shared/components/ResultChart/ResultChart.tsx
  • frontends/ui/src/shared/components/ResultChart/ResultChartCarousel.spec.tsx
  • frontends/ui/src/shared/components/ResultChart/ResultChartCarousel.tsx
  • frontends/ui/src/shared/components/ResultChart/export-csv.spec.ts
  • frontends/ui/src/shared/components/ResultChart/export-csv.ts
  • frontends/ui/src/shared/components/ResultChart/geometry.spec.ts
  • frontends/ui/src/shared/components/ResultChart/geometry.ts
  • frontends/ui/src/shared/components/ResultChart/index.ts
  • frontends/ui/src/shared/components/ResultChart/normalize.spec.ts
  • frontends/ui/src/shared/components/ResultChart/normalize.ts
  • frontends/ui/src/shared/components/ResultChart/palette.spec.ts
  • frontends/ui/src/shared/components/ResultChart/palette.ts
  • frontends/ui/src/shared/components/ResultChart/parse.spec.ts
  • frontends/ui/src/shared/components/ResultChart/parse.ts
  • frontends/ui/src/shared/components/ResultChart/renderers/axis.spec.ts
  • frontends/ui/src/shared/components/ResultChart/renderers/axis.ts
  • frontends/ui/src/shared/components/ResultChart/renderers/bar.spec.ts
  • frontends/ui/src/shared/components/ResultChart/renderers/bar.ts
  • frontends/ui/src/shared/components/ResultChart/renderers/hbar.spec.ts
  • frontends/ui/src/shared/components/ResultChart/renderers/hbar.ts
  • frontends/ui/src/shared/components/ResultChart/renderers/index.spec.ts
  • frontends/ui/src/shared/components/ResultChart/renderers/index.ts
  • frontends/ui/src/shared/components/ResultChart/renderers/line.spec.ts
  • frontends/ui/src/shared/components/ResultChart/renderers/line.ts
  • frontends/ui/src/shared/components/ResultChart/renderers/types.ts
  • frontends/ui/src/shared/components/ResultChart/scale.spec.ts
  • frontends/ui/src/shared/components/ResultChart/scale.ts
  • frontends/ui/src/shared/components/ResultChart/types.ts
  • frontends/ui/vitest.config.ts
  • src/aiq_agent/agents/deep_researcher/prompts/writer.j2
  • src/aiq_agent/agents/shallow_researcher/prompts/researcher.j2
  • tests/aiq_agent/agents/test_result_chart_prompt.py
📜 Review details
🧰 Additional context used
📓 Path-based instructions (6)
frontends/ui/**/*.{js,ts,jsx,tsx,vue}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Run npm lint, type-check, and build validation for UI changes in frontends/ui

Files:

  • frontends/ui/src/shared/components/ResultChart/palette.spec.ts
  • frontends/ui/src/shared/components/MarkdownRenderer/MarkdownRenderer.chart.spec.tsx
  • frontends/ui/src/shared/components/ResultChart/ChartDataTable.spec.tsx
  • frontends/ui/vitest.config.ts
  • frontends/ui/src/shared/components/ResultChart/ChartBlock.tsx
  • frontends/ui/src/shared/components/ResultChart/ChartToolbar.tsx
  • frontends/ui/src/shared/components/ResultChart/ChartDataTable.tsx
  • frontends/ui/src/shared/components/ResultChart/renderers/types.ts
  • frontends/ui/src/shared/components/ResultChart/renderers/index.ts
  • frontends/ui/src/shared/components/ResultChart/ChartKpi.tsx
  • frontends/ui/src/shared/components/ResultChart/renderers/index.spec.ts
  • frontends/ui/src/shared/components/ResultChart/ChartToolbar.spec.tsx
  • frontends/ui/src/shared/components/ResultChart/geometry.spec.ts
  • frontends/ui/src/shared/components/ResultChart/renderers/bar.spec.ts
  • frontends/ui/src/shared/components/ResultChart/ChartKpi.spec.tsx
  • frontends/ui/src/shared/components/ResultChart/renderers/hbar.spec.ts
  • frontends/ui/src/shared/components/ResultChart/renderers/line.spec.ts
  • frontends/ui/src/shared/components/ResultChart/types.ts
  • frontends/ui/src/shared/components/ResultChart/export-csv.ts
  • frontends/ui/src/shared/components/ResultChart/normalize.spec.ts
  • frontends/ui/src/shared/components/ResultChart/ResultChartCarousel.tsx
  • frontends/ui/src/shared/components/ResultChart/renderers/bar.ts
  • frontends/ui/src/shared/components/ResultChart/geometry.ts
  • frontends/ui/src/shared/components/ResultChart/palette.ts
  • frontends/ui/src/shared/components/ResultChart/ResultChart.spec.tsx
  • frontends/ui/src/shared/components/ResultChart/export-csv.spec.ts
  • frontends/ui/src/shared/components/ResultChart/parse.spec.ts
  • frontends/ui/src/shared/components/ResultChart/ResultChart.tsx
  • frontends/ui/src/shared/components/ResultChart/renderers/hbar.ts
  • frontends/ui/src/shared/components/ResultChart/index.ts
  • frontends/ui/src/shared/components/ResultChart/ResultChartCarousel.spec.tsx
  • frontends/ui/src/shared/components/ResultChart/ChartBlock.spec.tsx
  • frontends/ui/src/shared/components/MarkdownRenderer/MarkdownRenderer.tsx
  • frontends/ui/src/shared/components/ResultChart/renderers/axis.ts
  • frontends/ui/src/shared/components/ResultChart/scale.spec.ts
  • frontends/ui/src/shared/components/ResultChart/scale.ts
  • frontends/ui/src/shared/components/ResultChart/renderers/line.ts
  • frontends/ui/src/shared/components/ResultChart/parse.ts
  • frontends/ui/src/shared/components/ResultChart/normalize.ts
  • frontends/ui/src/shared/components/ResultChart/renderers/axis.spec.ts
frontends/ui/**/*.{ts,tsx,jsx,js}

📄 CodeRabbit inference engine (AGENTS.md)

frontends/ui/**/*.{ts,tsx,jsx,js}: The UI is built with Next.js / React / TypeScript / Tailwind with KUI components; reuse existing KUI components and visual patterns rather than introducing new ones
Validate UI-affecting changes with npm run lint, npm run type-check, and npm run test:ci, and include a screenshot for visible changes

Files:

  • frontends/ui/src/shared/components/ResultChart/palette.spec.ts
  • frontends/ui/src/shared/components/MarkdownRenderer/MarkdownRenderer.chart.spec.tsx
  • frontends/ui/src/shared/components/ResultChart/ChartDataTable.spec.tsx
  • frontends/ui/vitest.config.ts
  • frontends/ui/src/shared/components/ResultChart/ChartBlock.tsx
  • frontends/ui/src/shared/components/ResultChart/ChartToolbar.tsx
  • frontends/ui/src/shared/components/ResultChart/ChartDataTable.tsx
  • frontends/ui/src/shared/components/ResultChart/renderers/types.ts
  • frontends/ui/src/shared/components/ResultChart/renderers/index.ts
  • frontends/ui/src/shared/components/ResultChart/ChartKpi.tsx
  • frontends/ui/src/shared/components/ResultChart/renderers/index.spec.ts
  • frontends/ui/src/shared/components/ResultChart/ChartToolbar.spec.tsx
  • frontends/ui/src/shared/components/ResultChart/geometry.spec.ts
  • frontends/ui/src/shared/components/ResultChart/renderers/bar.spec.ts
  • frontends/ui/src/shared/components/ResultChart/ChartKpi.spec.tsx
  • frontends/ui/src/shared/components/ResultChart/renderers/hbar.spec.ts
  • frontends/ui/src/shared/components/ResultChart/renderers/line.spec.ts
  • frontends/ui/src/shared/components/ResultChart/types.ts
  • frontends/ui/src/shared/components/ResultChart/export-csv.ts
  • frontends/ui/src/shared/components/ResultChart/normalize.spec.ts
  • frontends/ui/src/shared/components/ResultChart/ResultChartCarousel.tsx
  • frontends/ui/src/shared/components/ResultChart/renderers/bar.ts
  • frontends/ui/src/shared/components/ResultChart/geometry.ts
  • frontends/ui/src/shared/components/ResultChart/palette.ts
  • frontends/ui/src/shared/components/ResultChart/ResultChart.spec.tsx
  • frontends/ui/src/shared/components/ResultChart/export-csv.spec.ts
  • frontends/ui/src/shared/components/ResultChart/parse.spec.ts
  • frontends/ui/src/shared/components/ResultChart/ResultChart.tsx
  • frontends/ui/src/shared/components/ResultChart/renderers/hbar.ts
  • frontends/ui/src/shared/components/ResultChart/index.ts
  • frontends/ui/src/shared/components/ResultChart/ResultChartCarousel.spec.tsx
  • frontends/ui/src/shared/components/ResultChart/ChartBlock.spec.tsx
  • frontends/ui/src/shared/components/MarkdownRenderer/MarkdownRenderer.tsx
  • frontends/ui/src/shared/components/ResultChart/renderers/axis.ts
  • frontends/ui/src/shared/components/ResultChart/scale.spec.ts
  • frontends/ui/src/shared/components/ResultChart/scale.ts
  • frontends/ui/src/shared/components/ResultChart/renderers/line.ts
  • frontends/ui/src/shared/components/ResultChart/parse.ts
  • frontends/ui/src/shared/components/ResultChart/normalize.ts
  • frontends/ui/src/shared/components/ResultChart/renderers/axis.spec.ts
frontends/ui/**/*

⚙️ CodeRabbit configuration file

frontends/ui/**/*: Review UI changes for strict TypeScript behavior, API contract alignment, auth/session handling, accessible controls,
resilient loading and error states, and report/chat state consistency. Prefer existing UI patterns and require tests
for changed user-visible workflows.

Files:

  • frontends/ui/src/shared/components/ResultChart/palette.spec.ts
  • frontends/ui/src/shared/components/MarkdownRenderer/MarkdownRenderer.chart.spec.tsx
  • frontends/ui/src/shared/components/ResultChart/ChartDataTable.spec.tsx
  • frontends/ui/vitest.config.ts
  • frontends/ui/src/shared/components/ResultChart/ChartBlock.tsx
  • frontends/ui/src/shared/components/ResultChart/ChartToolbar.tsx
  • frontends/ui/src/shared/components/ResultChart/ChartDataTable.tsx
  • frontends/ui/src/shared/components/ResultChart/renderers/types.ts
  • frontends/ui/src/shared/components/ResultChart/renderers/index.ts
  • frontends/ui/src/shared/components/ResultChart/ChartKpi.tsx
  • frontends/ui/src/shared/components/ResultChart/renderers/index.spec.ts
  • frontends/ui/src/shared/components/ResultChart/ChartToolbar.spec.tsx
  • frontends/ui/src/shared/components/ResultChart/geometry.spec.ts
  • frontends/ui/src/shared/components/ResultChart/renderers/bar.spec.ts
  • frontends/ui/src/shared/components/ResultChart/ChartKpi.spec.tsx
  • frontends/ui/src/shared/components/ResultChart/renderers/hbar.spec.ts
  • frontends/ui/src/shared/components/ResultChart/renderers/line.spec.ts
  • frontends/ui/src/shared/components/ResultChart/types.ts
  • frontends/ui/src/shared/components/ResultChart/export-csv.ts
  • frontends/ui/src/shared/components/ResultChart/normalize.spec.ts
  • frontends/ui/src/shared/components/ResultChart/ResultChartCarousel.tsx
  • frontends/ui/src/shared/components/ResultChart/renderers/bar.ts
  • frontends/ui/src/shared/components/ResultChart/geometry.ts
  • frontends/ui/src/shared/components/ResultChart/palette.ts
  • frontends/ui/src/shared/components/ResultChart/ResultChart.spec.tsx
  • frontends/ui/src/shared/components/ResultChart/export-csv.spec.ts
  • frontends/ui/src/shared/components/ResultChart/parse.spec.ts
  • frontends/ui/src/shared/components/ResultChart/ResultChart.tsx
  • frontends/ui/src/shared/components/ResultChart/renderers/hbar.ts
  • frontends/ui/src/app/globals.css
  • frontends/ui/src/shared/components/ResultChart/index.ts
  • frontends/ui/src/shared/components/ResultChart/ResultChartCarousel.spec.tsx
  • frontends/ui/src/shared/components/ResultChart/ChartBlock.spec.tsx
  • frontends/ui/src/shared/components/MarkdownRenderer/MarkdownRenderer.tsx
  • frontends/ui/src/shared/components/ResultChart/renderers/axis.ts
  • frontends/ui/src/shared/components/ResultChart/scale.spec.ts
  • frontends/ui/src/shared/components/ResultChart/scale.ts
  • frontends/ui/src/shared/components/ResultChart/renderers/line.ts
  • frontends/ui/src/shared/components/ResultChart/parse.ts
  • frontends/ui/src/shared/components/ResultChart/normalize.ts
  • frontends/ui/src/shared/components/ResultChart/renderers/axis.spec.ts
src/aiq_agent/agents/**/*

⚙️ CodeRabbit configuration file

src/aiq_agent/agents/**/*: Review agent changes for research workflow correctness, graph state transitions, prompt/tool contracts,
HITL behavior, and failure handling. Flag changes that weaken source attribution, report generation,
async cancellation, checkpointing, or data-source selection without focused tests and docs.

Files:

  • src/aiq_agent/agents/shallow_researcher/prompts/researcher.j2
  • src/aiq_agent/agents/deep_researcher/prompts/writer.j2
**/*.py

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Run ruff check and ruff format validation for Python code changes

**/*.py: Python code must be linted and formatted with Ruff using line length 120, target Python 3.11, rule sets E,F,W,I,PL,UP, and isort force-single-line configuration
Never commit secrets, tokens, or environment-specific hostnames; use environment variables and SecretStr instead, resolving API keys at runtime
Never print or log secret values, including in tool output or error messages
Missing-secret paths must degrade gracefully (stub/skip), not crash or leak
Do not hand-reformat unrelated code when making changes; match the existing import and formatting style

Files:

  • tests/aiq_agent/agents/test_result_chart_prompt.py
**/*test*.py

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Run pytest for all behavior changes in Python code

Files:

  • tests/aiq_agent/agents/test_result_chart_prompt.py
🪛 ast-grep (0.44.1)
tests/aiq_agent/agents/test_result_chart_prompt.py

[warning] 41-41: XPath query is request-/variable-derived; use parameterized XPath to prevent injection.
Context: _CHART_BLOCK.findall(text)
Note: [CWE-643] Improper Neutralization of Data within XPath Expressions ('XPath Injection').

(xpath-injection-python)

🔇 Additional comments (43)
frontends/ui/src/shared/components/ResultChart/types.ts (2)

6-9: Series cap (6) exceeds the color cycle (5) — see consolidated comment.

Deferred to the consolidated comments section together with palette.ts CYCLE.

Also applies to: 39-39


1-72: LGTM!

frontends/ui/src/shared/components/ResultChart/palette.ts (1)

16-16: CYCLE length (5) vs series max (6) — see consolidated comment.

Deferred to the consolidated comments section together with types.ts SeriesSchema/series.max(6).

frontends/ui/src/shared/components/ResultChart/scale.ts (1)

1-111: LGTM!

frontends/ui/src/shared/components/ResultChart/renderers/axis.ts (1)

1-46: LGTM!

frontends/ui/src/shared/components/ResultChart/renderers/axis.spec.ts (1)

1-45: LGTM!

frontends/ui/src/shared/components/ResultChart/renderers/bar.ts (1)

1-40: LGTM!

Also applies to: 44-55

frontends/ui/src/shared/components/ResultChart/renderers/hbar.ts (1)

1-18: LGTM!

Also applies to: 47-61

frontends/ui/src/shared/components/ResultChart/renderers/index.spec.ts (1)

1-27: LGTM!

frontends/ui/src/shared/components/ResultChart/parse.ts (2)

21-31: 🎯 Functional Correctness | ⚡ Quick win

toNumber doesn't actually handle the "$1.2M" case its own docstring advertises.

The regex at Line 25 strips ,, $, whitespace, and %, but never interprets K/M/B suffixes. toNumber('$1.2M') cleans to "1.2M", Number("1.2M") is NaN, and the function returns null — silently dropping that data point instead of converting it to 1200000 as the docstring implies.

🔧 Proposed fix to support magnitude suffixes
   if (typeof value === 'string') {
-    const cleaned = value.replace(/[,$\s%]/g, '')
-    if (cleaned === '') return null
-    const parsed = Number(cleaned)
-    return Number.isFinite(parsed) ? parsed : null
+    const cleaned = value.replace(/[,$\s%]/g, '')
+    if (cleaned === '') return null
+    const match = cleaned.match(/^(-?\d*\.?\d+)([KMB])?$/i)
+    if (!match) return null
+    const [, num, suffix] = match
+    const multiplier = suffix ? ({ K: 1e3, M: 1e6, B: 1e9 } as const)[suffix.toUpperCase() as 'K' | 'M' | 'B'] : 1
+    const parsed = Number(num) * multiplier
+    return Number.isFinite(parsed) ? parsed : null
   }

Alternatively, if compact-suffix input is never expected in practice, just narrow the docstring instead.


38-98: LGTM!

frontends/ui/src/shared/components/ResultChart/parse.spec.ts (1)

1-123: LGTM!

frontends/ui/src/shared/components/ResultChart/scale.spec.ts (1)

1-137: LGTM!

frontends/ui/src/shared/components/ResultChart/palette.spec.ts (1)

1-25: LGTM!

frontends/ui/vitest.config.ts (1)

37-45: 📐 Maintainability & Code Quality

Confirm the glob-scoped threshold actually fails CI on regression.

The 'src/shared/components/ResultChart/**' glob threshold syntax matches Vitest's documented per-file/glob threshold shape, so it should be picked up correctly. However, there's a history of glob-scoped threshold violations not surfacing a build-failing error message in some Vitest versions (unlike global thresholds), so it's worth confirming a coverage drop under this path actually fails CI on vitest 4.0.18 rather than passing silently.

frontends/ui/src/shared/components/ResultChart/normalize.ts (1)

1-92: LGTM!

frontends/ui/src/shared/components/ResultChart/normalize.spec.ts (1)

1-101: LGTM!

frontends/ui/src/shared/components/ResultChart/index.ts (1)

1-19: LGTM!

frontends/ui/src/shared/components/MarkdownRenderer/MarkdownRenderer.tsx (2)

53-54: LGTM!

Also applies to: 70-85, 256-256


13-16: 📐 Maintainability & Code Quality

React/Next pairing is fine frontends/ui/package.json already pins next@^16.2.6 with react/react-dom@^18.2.0, which is within the declared peer range, so there’s no compatibility issue here.

			> Likely an incorrect or invalid review comment.
frontends/ui/src/shared/components/MarkdownRenderer/MarkdownRenderer.chart.spec.tsx (1)

1-57: LGTM!

frontends/ui/src/shared/components/ResultChart/geometry.ts (1)

1-49: LGTM!

frontends/ui/src/shared/components/ResultChart/geometry.spec.ts (1)

1-61: LGTM!

frontends/ui/src/shared/components/ResultChart/renderers/types.ts (1)

1-32: LGTM!

frontends/ui/src/shared/components/ResultChart/renderers/bar.spec.ts (1)

1-55: LGTM!

frontends/ui/src/shared/components/ResultChart/renderers/hbar.spec.ts (1)

1-63: LGTM!

frontends/ui/src/shared/components/ResultChart/renderers/line.ts (1)

15-69: Segment-splitting and area-fill logic verified correct.

Walked through the null-gap segmentation, area-baseline closing, and single-point centering against line.spec.ts — all match. No concerns.

frontends/ui/src/shared/components/ResultChart/renderers/line.spec.ts (1)

1-103: LGTM!

frontends/ui/src/shared/components/ResultChart/renderers/index.ts (1)

1-21: LGTM!

frontends/ui/src/shared/components/ResultChart/ChartBlock.spec.tsx (1)

1-59: LGTM!

frontends/ui/src/shared/components/ResultChart/ChartKpi.spec.tsx (1)

1-42: LGTM!

frontends/ui/src/shared/components/ResultChart/ResultChartCarousel.spec.tsx (1)

1-53: LGTM!

frontends/ui/src/shared/components/ResultChart/ResultChart.spec.tsx (1)

1-96: LGTM!

frontends/ui/src/shared/components/ResultChart/ResultChartCarousel.tsx (1)

12-22: 🎯 Functional Correctness

No empty-carousel guard needed. ChartCarouselSpecSchema.charts is z.array(...).min(2), so count === 0 cannot occur here.

			> Likely an incorrect or invalid review comment.
frontends/ui/src/shared/components/ResultChart/ChartDataTable.spec.tsx (1)

20-34: LGTM!

frontends/ui/src/shared/components/ResultChart/ChartKpi.tsx (1)

8-19: LGTM!

Also applies to: 26-40

frontends/ui/src/shared/components/ResultChart/ChartToolbar.tsx (1)

27-35: LGTM!

frontends/ui/src/shared/components/ResultChart/ResultChart.tsx (3)

71-105: LGTM!


44-55: 🩺 Stability & Availability

RENDERERS is exhaustive for ChartType, and series is constrained to at least one item, so this crash risk isn’t present here.

			> Likely an incorrect or invalid review comment.

63-69: 🩺 Stability & Availability

No change needed: .result-chart already sets position: relative, so the absolute tooltip is anchored correctly.

			> Likely an incorrect or invalid review comment.
frontends/ui/src/shared/components/ResultChart/export-csv.spec.ts (1)

22-78: LGTM!

frontends/ui/src/shared/components/ResultChart/export-csv.ts (2)

15-49: LGTM!


55-64: LGTM!

Comment thread frontends/ui/src/app/globals.css
Comment thread frontends/ui/src/shared/components/ResultChart/ChartBlock.tsx
Comment thread frontends/ui/src/shared/components/ResultChart/ChartToolbar.tsx
Comment thread frontends/ui/src/shared/components/ResultChart/renderers/bar.ts
Comment thread frontends/ui/src/shared/components/ResultChart/renderers/hbar.ts
Comment thread frontends/ui/src/shared/components/ResultChart/ResultChart.tsx
Comment thread src/aiq_agent/agents/shallow_researcher/prompts/researcher.j2
Comment thread tests/aiq_agent/agents/test_result_chart_prompt.py
- KPI warn/alarm tones use the semantic feedback theme tokens instead of
  hardcoded hex.
- Memoize the ChartBlock parse/normalize pipeline on the raw block.
- Wire aria-controls from the Show data toggle to the data-region id (useId).
- Place negative single-series bar value labels below the zero baseline.
- Suppress the per-series legend for delta charts (bars are colored by sign).
- Restore the URL global stub in an afterEach so it survives a failed assertion.
- Validate chart-carousel prompt examples against the schema.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Manush Maheshwari <manushm@nvidia.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@frontends/ui/src/shared/components/ResultChart/ResultChart.tsx`:
- Line 106: Update the ResultChart rendering around ChartDataTable so the
element referenced by ChartToolbar’s aria-controls={dataId} remains mounted when
dataOpen is false; toggle its hidden/visibility state instead of conditionally
removing it, and add or update tests to verify the referenced element exists
while collapsed.

In `@tests/aiq_agent/agents/test_result_chart_prompt.py`:
- Around line 55-67: Ensure test_prompt_carousel_examples_match_the_schema
asserts that _CAROUSEL_BLOCK.findall(text) returns at least one match before
iterating. Preserve the existing carousel schema checks and use the same
non-empty assertion pattern as the chart-example test.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: a9e3ac27-0469-4ee0-9b94-617f269479b1

📥 Commits

Reviewing files that changed from the base of the PR and between ad7de73 and 9d605b3.

📒 Files selected for processing (9)
  • frontends/ui/src/app/globals.css
  • frontends/ui/src/shared/components/ResultChart/ChartBlock.tsx
  • frontends/ui/src/shared/components/ResultChart/ChartDataTable.tsx
  • frontends/ui/src/shared/components/ResultChart/ChartToolbar.spec.tsx
  • frontends/ui/src/shared/components/ResultChart/ChartToolbar.tsx
  • frontends/ui/src/shared/components/ResultChart/ResultChart.tsx
  • frontends/ui/src/shared/components/ResultChart/renderers/bar.spec.ts
  • frontends/ui/src/shared/components/ResultChart/renderers/bar.ts
  • tests/aiq_agent/agents/test_result_chart_prompt.py
📜 Review details
🧰 Additional context used
📓 Path-based instructions (5)
frontends/ui/**/*.{js,ts,jsx,tsx,vue}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Run npm lint, type-check, and build validation for UI changes in frontends/ui

Files:

  • frontends/ui/src/shared/components/ResultChart/ChartBlock.tsx
  • frontends/ui/src/shared/components/ResultChart/ChartToolbar.spec.tsx
  • frontends/ui/src/shared/components/ResultChart/ChartDataTable.tsx
  • frontends/ui/src/shared/components/ResultChart/ChartToolbar.tsx
  • frontends/ui/src/shared/components/ResultChart/renderers/bar.ts
  • frontends/ui/src/shared/components/ResultChart/renderers/bar.spec.ts
  • frontends/ui/src/shared/components/ResultChart/ResultChart.tsx
frontends/ui/**/*.{ts,tsx,jsx,js}

📄 CodeRabbit inference engine (AGENTS.md)

frontends/ui/**/*.{ts,tsx,jsx,js}: The UI is built with Next.js / React / TypeScript / Tailwind with KUI components; reuse existing KUI components and visual patterns rather than introducing new ones
Validate UI-affecting changes with npm run lint, npm run type-check, and npm run test:ci, and include a screenshot for visible changes

Files:

  • frontends/ui/src/shared/components/ResultChart/ChartBlock.tsx
  • frontends/ui/src/shared/components/ResultChart/ChartToolbar.spec.tsx
  • frontends/ui/src/shared/components/ResultChart/ChartDataTable.tsx
  • frontends/ui/src/shared/components/ResultChart/ChartToolbar.tsx
  • frontends/ui/src/shared/components/ResultChart/renderers/bar.ts
  • frontends/ui/src/shared/components/ResultChart/renderers/bar.spec.ts
  • frontends/ui/src/shared/components/ResultChart/ResultChart.tsx
frontends/ui/**/*

⚙️ CodeRabbit configuration file

frontends/ui/**/*: Review UI changes for strict TypeScript behavior, API contract alignment, auth/session handling, accessible controls,
resilient loading and error states, and report/chat state consistency. Prefer existing UI patterns and require tests
for changed user-visible workflows.

Files:

  • frontends/ui/src/shared/components/ResultChart/ChartBlock.tsx
  • frontends/ui/src/shared/components/ResultChart/ChartToolbar.spec.tsx
  • frontends/ui/src/shared/components/ResultChart/ChartDataTable.tsx
  • frontends/ui/src/shared/components/ResultChart/ChartToolbar.tsx
  • frontends/ui/src/shared/components/ResultChart/renderers/bar.ts
  • frontends/ui/src/shared/components/ResultChart/renderers/bar.spec.ts
  • frontends/ui/src/app/globals.css
  • frontends/ui/src/shared/components/ResultChart/ResultChart.tsx
**/*.py

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Run ruff check and ruff format validation for Python code changes

**/*.py: Python code must be linted and formatted with Ruff using line length 120, target Python 3.11, rule sets E,F,W,I,PL,UP, and isort force-single-line configuration
Never commit secrets, tokens, or environment-specific hostnames; use environment variables and SecretStr instead, resolving API keys at runtime
Never print or log secret values, including in tool output or error messages
Missing-secret paths must degrade gracefully (stub/skip), not crash or leak
Do not hand-reformat unrelated code when making changes; match the existing import and formatting style

Files:

  • tests/aiq_agent/agents/test_result_chart_prompt.py
**/*test*.py

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Run pytest for all behavior changes in Python code

Files:

  • tests/aiq_agent/agents/test_result_chart_prompt.py
🪛 ast-grep (0.44.1)
tests/aiq_agent/agents/test_result_chart_prompt.py

[warning] 57-57: XPath query is request-/variable-derived; use parameterized XPath to prevent injection.
Context: _CAROUSEL_BLOCK.findall(text)
Note: [CWE-643] Improper Neutralization of Data within XPath Expressions ('XPath Injection').

(xpath-injection-python)

🔇 Additional comments (11)
frontends/ui/src/shared/components/ResultChart/renderers/bar.ts (2)

41-44: 🎯 Functional Correctness

Negative-label placement fix verified correct.

The value >= 0 branch now correctly anchors negative labels below the bar's bottom tip (Math.max(y, baselineY) + 12) and positive labels above the top (Math.min(y, baselineY) - 5), resolving the previously flagged bug where negative labels rendered just above the baseline. Confirmed against bar.spec.ts lines 34-51.


1-40: LGTM!

Also applies to: 45-56

frontends/ui/src/app/globals.css (1)

391-396: 📐 Maintainability & Code Quality

Semantic token fix applied as requested.

tone-warn/tone-alarm now reference --text-color-feedback-warning/--text-color-feedback-danger instead of hardcoded hex, matching the earlier review request.

frontends/ui/src/shared/components/ResultChart/renderers/bar.spec.ts (2)

34-51: LGTM!


1-33: LGTM!

Also applies to: 53-73

tests/aiq_agent/agents/test_result_chart_prompt.py (1)

1-53: LGTM!

Also applies to: 69-90

frontends/ui/src/shared/components/ResultChart/ChartBlock.tsx (1)

6-6: LGTM!

Also applies to: 19-36

frontends/ui/src/shared/components/ResultChart/ChartDataTable.tsx (1)

8-36: LGTM!

frontends/ui/src/shared/components/ResultChart/ResultChart.tsx (1)

14-57: LGTM!

Also applies to: 62-105, 107-195

frontends/ui/src/shared/components/ResultChart/ChartToolbar.spec.tsx (1)

18-50: LGTM!

frontends/ui/src/shared/components/ResultChart/ChartToolbar.tsx (1)

12-39: LGTM!

Comment thread frontends/ui/src/shared/components/ResultChart/ResultChart.tsx
Comment thread tests/aiq_agent/agents/test_result_chart_prompt.py
Manushpm8 and others added 2 commits July 15, 2026 10:29
Replace the flat 15% area fill with a per-series vertical linearGradient
(28% opacity at the line to 0% at the baseline) so the area reads as a
subtle wash instead of a solid block.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Manush Maheshwari <manushm@nvidia.com>
Drop the raised surface fill so the chart card takes on the page background
(reads as black in the dark theme) instead of a tinted panel.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Manush Maheshwari <manushm@nvidia.com>
@KyleZheng1284 KyleZheng1284 added enhancement New feature or request UI/UX UI and UX related fixes READY FOR REVIEW labels Jul 15, 2026
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Manush Maheshwari <manushm@nvidia.com>
@Manushpm8
Manushpm8 requested a review from a team July 16, 2026 02:45

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tests/aiq_agent/agents/test_result_chart_prompt.py`:
- Around line 56-63: Update test_prompt_carousel_examples_match_the_schema to
iterate over each carousel["charts"] entry and assert its required
chart["title"] is present, while preserving the existing outer-title and
minimum-chart validations. Add focused coverage and update the relevant
prompt-contract documentation as required by the repository guidelines.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 5de979d7-027b-42c8-8069-3d8cb93f108e

📥 Commits

Reviewing files that changed from the base of the PR and between 02710bb and d849ae6.

📒 Files selected for processing (7)
  • frontends/ui/src/app/globals.css
  • frontends/ui/src/shared/components/ResultChart/ChartToolbar.spec.tsx
  • frontends/ui/src/shared/components/ResultChart/ChartToolbar.tsx
  • frontends/ui/src/shared/components/ResultChart/ResultChart.spec.tsx
  • src/aiq_agent/agents/deep_researcher/prompts/writer.j2
  • src/aiq_agent/agents/shallow_researcher/prompts/researcher.j2
  • tests/aiq_agent/agents/test_result_chart_prompt.py
📜 Review details
🧰 Additional context used
📓 Path-based instructions (6)
frontends/ui/**/*.{js,ts,jsx,tsx,vue}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Run npm lint, type-check, and build validation for UI changes in frontends/ui

Files:

  • frontends/ui/src/shared/components/ResultChart/ChartToolbar.spec.tsx
  • frontends/ui/src/shared/components/ResultChart/ResultChart.spec.tsx
  • frontends/ui/src/shared/components/ResultChart/ChartToolbar.tsx
frontends/ui/**/*.{ts,tsx,jsx,js}

📄 CodeRabbit inference engine (AGENTS.md)

frontends/ui/**/*.{ts,tsx,jsx,js}: The UI is built with Next.js / React / TypeScript / Tailwind with KUI components; reuse existing KUI components and visual patterns rather than introducing new ones
Validate UI-affecting changes with npm run lint, npm run type-check, and npm run test:ci, and include a screenshot for visible changes

Files:

  • frontends/ui/src/shared/components/ResultChart/ChartToolbar.spec.tsx
  • frontends/ui/src/shared/components/ResultChart/ResultChart.spec.tsx
  • frontends/ui/src/shared/components/ResultChart/ChartToolbar.tsx
frontends/ui/**/*

⚙️ CodeRabbit configuration file

frontends/ui/**/*: Review UI changes for strict TypeScript behavior, API contract alignment, auth/session handling, accessible controls,
resilient loading and error states, and report/chat state consistency. Prefer existing UI patterns and require tests
for changed user-visible workflows.

Files:

  • frontends/ui/src/shared/components/ResultChart/ChartToolbar.spec.tsx
  • frontends/ui/src/shared/components/ResultChart/ResultChart.spec.tsx
  • frontends/ui/src/shared/components/ResultChart/ChartToolbar.tsx
  • frontends/ui/src/app/globals.css
src/aiq_agent/agents/**/*

⚙️ CodeRabbit configuration file

src/aiq_agent/agents/**/*: Review agent changes for research workflow correctness, graph state transitions, prompt/tool contracts,
HITL behavior, and failure handling. Flag changes that weaken source attribution, report generation,
async cancellation, checkpointing, or data-source selection without focused tests and docs.

Files:

  • src/aiq_agent/agents/deep_researcher/prompts/writer.j2
  • src/aiq_agent/agents/shallow_researcher/prompts/researcher.j2
**/*.py

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Run ruff check and ruff format validation for Python code changes

**/*.py: Python code must be linted and formatted with Ruff using line length 120, target Python 3.11, rule sets E,F,W,I,PL,UP, and isort force-single-line configuration
Never commit secrets, tokens, or environment-specific hostnames; use environment variables and SecretStr instead, resolving API keys at runtime
Never print or log secret values, including in tool output or error messages
Missing-secret paths must degrade gracefully (stub/skip), not crash or leak
Do not hand-reformat unrelated code when making changes; match the existing import and formatting style

Files:

  • tests/aiq_agent/agents/test_result_chart_prompt.py
**/*test*.py

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Run pytest for all behavior changes in Python code

Files:

  • tests/aiq_agent/agents/test_result_chart_prompt.py
🔇 Additional comments (7)
frontends/ui/src/shared/components/ResultChart/ChartToolbar.tsx (1)

12-17: LGTM!

Also applies to: 18-39

frontends/ui/src/shared/components/ResultChart/ResultChart.spec.tsx (1)

96-104: LGTM!

frontends/ui/src/shared/components/ResultChart/ChartToolbar.spec.tsx (1)

17-53: LGTM!

frontends/ui/src/app/globals.css (1)

315-357: LGTM!

Also applies to: 358-401, 402-478, 479-509, 510-558

src/aiq_agent/agents/deep_researcher/prompts/writer.j2 (1)

105-134: LGTM!

src/aiq_agent/agents/shallow_researcher/prompts/researcher.j2 (1)

36-65: LGTM!

tests/aiq_agent/agents/test_result_chart_prompt.py (1)

23-44: LGTM!

Also applies to: 71-92

Comment thread tests/aiq_agent/agents/test_result_chart_prompt.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request READY FOR REVIEW UI/UX UI and UX related fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants