Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 65d6cefc38
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| appState.chartJob.files = payloadFiles; | ||
|
|
||
| const queued = await postJson('/api/charts/jobs', { files: payloadFiles }, '차트 작업 생성'); | ||
| const rec = appState.vizRecommendation || await fetchVizRecommendation(); |
There was a problem hiding this comment.
Recompute chart recommendation for the current question
This reuses appState.vizRecommendation if it exists, so after a user fetches recommendations once and then edits the question, startChartsJob() still sends the old selected_chart_types. Because /api/charts/jobs only auto-recommends when selected_chart_types is empty, the stale list overrides the new question and can generate charts for the wrong intent.
Useful? React with 👍 / 👎.
| if selected_chart_types is not None and not isinstance(selected_chart_types, list): | ||
| return self._send_json(self._error_payload('selected_chart_types must be a list'), HTTPStatus.BAD_REQUEST) |
There was a problem hiding this comment.
Validate each selected chart type as a string
The endpoint only checks that selected_chart_types is a list, but downstream chart generation normalizes entries with c.strip().lower() in create_file_charts(). If a client sends non-string items (for example [1]), the job is accepted and later fails inside chart generation instead of returning a clear 400 validation error, which makes client bugs look like chart-engine failures.
Useful? React with 👍 / 👎.
Motivation
Description
bitnet_tools/viz_recommender.pywithrecommend_chart_types(question)that returns an intent, recommended chart types, and a textual reason (includes defaultoverview).bitnet_tools/visualize.pyto accept an optionalselected_chart_typesparameter, supportlinecharts, and propagate selection throughcreate_multi_charts().POST /api/viz/recommendand enhance/api/charts/jobsinbitnet_tools/web.pyto acceptselected_chart_typesor auto-select via the recommender; implement_build_chart_fallback()and make_run_chart_job()return a preview/summary fallback instead of hard failing on chart errors.bitnet_tools/ui/index.html,bitnet_tools/ui/app.js) with a “시각화 옵션 보기” button, a recommendation panel showing intent/recommended charts/reason, and send the selected/recommended chart types when starting chart jobs.tests/test_viz_recommender.pyfor recommendation consistency and an API contract test intests/test_web.pyfor/api/viz/recommend.Testing
python -m py_compile bitnet_tools/visualize.pyandpython -m py_compile bitnet_tools/web.py(succeeded).node --check bitnet_tools/ui/app.js(succeeded).pytest -q tests/test_viz_recommender.py tests/test_web.pyand all tests passed (19 passed).Codex Task