feat: dataset creation ui - #386
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
| schemaFields: z | ||
| .array( | ||
| z.object({ | ||
| key: z.string().min(1, "field name required"), |
There was a problem hiding this comment.
[AI] schemaFields.key doesn't .trim(), unlike the other text fields (authorName, team, discordUser, description). A trailing space passes validation silently, and the backend will treat "price " as a different TOML key than "price" — builder output would then fail schema validation with a confusing "missing key" error. Suggest trimming this field too.
| dependencies: dict[str, dict[datetime, list[dict]]], | ||
| timestamp: datetime, | ||
| ) -> list[dict[str, Any]]: | ||
| # return one dict per row for this timestamp, matching the schema |
There was a problem hiding this comment.
should add another (python) comment giving an example return so people have an idea how to structure the function
| requirements_txt: values.requirementsTxt.trim() | ||
| ? values.requirementsTxt | ||
| : undefined, | ||
| env_template: values.envTemplate.trim() ? values.envTemplate : undefined, |
There was a problem hiding this comment.
[AI] Unchecking "needs env vars" hides the envTemplate textarea (line 624) but doesn't clear its value, and toPayload here sends env_template whenever it's non-empty, regardless of envVars. A user can end up with env-vars = false in the generated config but a .env.template file still added. Suggest clearing envTemplate when envVarsEnabled flips false, or gating this line on values.envVars too.
|
[AI] The red validation hint text doesn't appear on first-time typing because |
|
[AI] Reported error message looks truncated/garbled on submit failure (e.g. "builder script fails lint:" errors from ruff). Likely cause: the error That said, actually failing lint on this form isn't itself a problem — backend CI on the resulting PR will catch any lint errors regardless, and the proposer can revise their code from the PR. This is just about making the in-form error message readable, not about needing to prevent lint failures here. |
| </section> | ||
|
|
||
| <section className="space-y-4"> | ||
| <SectionHeading>Builder script</SectionHeading> |
There was a problem hiding this comment.
[AI] Suggestion: add a "reset" button next to the builder script editor that restores field.value back to DEFAULT_BUILDER. Once someone starts editing/experimenting here it's easy to end up in a broken state with no quick way back to the known-good starting template.
| calendar: values.calendar, | ||
| granularity: values.granularity, | ||
| start_date: values.startDate, | ||
| schema: Object.fromEntries( |
There was a problem hiding this comment.
[AI] Object.fromEntries(values.schemaFields.map((field) => [field.key, field.type])) silently drops earlier rows if two schema fields share the same name (last one wins) — no duplicate-key check in the zod schema or before submit. Worth a .refine() on schemaFields checking all keys are unique, so a fat-fingered duplicate doesn't quietly disappear from the proposal.
docs: document dataset proposal flow in specs
…ordances Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
What changed
New create view (`components/create-dataset.tsx`, reachable via the "new dataset" header button):
The view is lazy-loaded (`React.lazy`) so CodeMirror's chunk (~540 kB) never loads during normal browsing. shadcn `select`/`checkbox`/`textarea` components added; new deps: `@uiw/react-codemirror`, `@codemirror/lang-python`.
Why
The UI half of the PR-based dataset-creation flow — pairs with the `POST /datasets` endpoint below this PR in the stack.
Benefit
Anyone on the team can propose a dataset without touching git; reviewers get a fully-attributed, pre-validated, pre-linted PR.
🤖 Generated with Claude Code