Skip to content

Commit f77d796

Browse files
committed
fix(ui): an unreadable field rule set judges nothing in the grid's pre-send check
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibxQtKRyLyL6eK14pgY
1 parent 9edf9af commit f77d796

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@object-ui/components': patch
3+
'@object-ui/plugin-grid': patch
4+
---
5+
6+
fix(ui): a refused inline-grid save marks its cells and says every reason; a refused form save is said once
7+
8+
Clause-②: no
9+
Metadata-protocol: none
10+
11+
- **Inline grid edit, Save All.** When the server refused a row, the save bar showed one shortened line, with the rest only in a tooltip, and no cell showed which value was wrong. Now every reason is shown in full on its own line under the toolbar, and each cell the refusal names gets a red outline with its reason on hover. Editing a marked cell removes its outline.
12+
- **Field rules before sending.** The grid's built-in saves now check an edited value against the field's own rules (required, min / max, length, email / URL pattern) before sending, and refuse a row that breaks one in the same way the server would. That row is not sent; the other rows still save.
13+
- **Save All placement.** The grid toolbar is padded, so the Save All / Cancel All buttons no longer sit against the right edge of the grid.
14+
- **Refused form save.** When the server refused a form save, such as one blocked by a validation rule on a Studio-authored object, the form showed a banner and an identical error toast. It now shows the banner only, scrolled into view, and a retry still replaces that banner instead of adding another. This reverses the earlier one-error-toast behaviour.

‎ui/packages/plugin-grid/src/objectGridInlineRules.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ export function inlineEditRuleRefusals(
7777
for (const [field, value] of Object.entries(changes)) {
7878
const def = fields[field];
7979
if (!def || typeof def !== 'object') continue;
80-
const rules = buildValidationRules(def) as Record<string, unknown>;
80+
// A rule set that cannot be read judges nothing: the server stays the judge.
81+
const rules = (buildValidationRules(def) ?? {}) as Record<string, unknown>;
8182
const label = labelOf(field);
8283
if (isBlank(value)) {
8384
if (rules.required) {

0 commit comments

Comments
 (0)