Uh oh!
There was an error while loading. Please reload this page.
fix(data-table): surface inline-edit save failures instead of swallowing them - #2106
Merged
Conversation
…ing them A rejected inline-edit save (e.g. a 400 validation failure — an invalid status transition) was caught with only `console.error`. Symptom: the save bar stayed stuck, the cell kept the unsaved value, and the author got no feedback at all (reproduced live on the showcase Studio preview: done→in_review was rejected server-side, silently). - saveRow / saveBatch: extract the server's reason (the ObjectStack adapter decorates thrown errors with the parsed body on `details`) and show it in the toolbar with an alert icon, instead of failing silently. The pending edit is kept so the author can fix and retry. - Tint failed row(s) destructive (`erroredRows`) so it's unambiguous which rows didn't persist — no phantom "looks saved" state. - Clear the error on a successful save (per-row or batch) and on cancel. - Add `table.saveFailed` across all 10 locales. - Tests: a failed save surfaces the reason and keeps the pending change; a successful save shows no failure message. Applies to both the runtime list grid and the Studio design preview (one code path). Found while verifying the editInline work end-to-end. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
Uh oh!
There was an error while loading. Please reload this page.
os-zhuang added a commit
that referenced
this pull request
Jun 30, 2026
…sitions (#2110) The inline editor would happily offer a status change the server then rejects (e.g. done → in_review), leaving the author to discover the failure on save. Now, when a field is governed by a `state_machine` validation, the dropdown is filtered to the values reachable from the current state — the current value plus its declared transitions — so the invalid choice isn't offered at all. - `stateMachineNextValues(objectSchema, field, value)` reads the object's `validations` (the same metadata the server enforces, already served on the schema and passed through by the adapter's getObjectSchema) and returns the reachable set, or null = "don't constrain" when there's no state machine or the current state is undeclared (mirrors the validation engine's lenient allow). - ObjectGrid.renderCellEditor filters the field's `options` by that set before handing the field to FieldEditWidget; non-select / non-state-machine fields are untouched. - 8 unit tests incl. the live bug case (from `done` → only [done, in_progress]). Complements #2106 (surface save failures): prevent the invalid edit at the source, and still report it if one slips through. Verified end-to-end that the data path is live — the backend serves the transitions and getObjectSchema passes them through unmodified. Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
When an inline-edit save is rejected by the server (e.g. a 400 validation failure — an invalid status transition), the data-table caught it with only
console.error. The author saw no feedback: the save bar stayed stuck, and the cell kept the unsaved value as if it had saved.Repro (live)
Found while verifying the
editInlinework end-to-end on the showcase Studio. Editing a task's statusDone → In ReviewfiresPATCH /api/v1/data/showcase_task/<id>→ the server correctly rejects it ({"message":"Invalid task status transition."}), but the UI gave no sign anything failed.Fix
saveRow/saveBatchnow extract the server's message (the ObjectStack adapter decorates thrown errors with the parsed body ondetails) and show it in the toolbar with an alert icon, instead of failing silently. The pending edit is kept so the author can fix and retry.erroredRowstints them destructive, so it's unambiguous which rows didn't persist (no phantom "looks saved").table.saveFailedadded across all 10 locales.Applies to both the runtime list grid and the Studio design preview (one code path).
Before / After
Verification
packages/components+packages/i18ntsc --noEmit→ clean; ESLint → 0 errors.data-table-inline-edit.test.tsx: +2 tests (failed save surfaces the reason & keeps the change; successful save shows no failure message). 8/8 pass.🤖 Generated with Claude Code