Uh oh!
There was an error while loading. Please reload this page.
fix(plugin-detail): don't inline-edit object-readonly or system/audit fields (#2402 hardening) - #2408
Merged
Merged
Conversation
… fields (#2402 hardening) The double-click / pencil inline-edit affordance from #2402 only gated on the VIEW schema's `readonly` + computed types. It ignored (a) the OBJECT metadata's `readonly` flag — the field enrichment deliberately doesn't copy it — and (b) immutable system/audit fields by name. So a field the object schema marks read-only, or a `created_at` surfaced as a section row, could be double-clicked into an editor. - DetailSection: `fieldEditable` now also excludes `objectDefField.readonly` and a new `NON_EDITABLE_SYSTEM_FIELDS` name set. - New `systemFields.ts`: the immutable-fields set — deliberately NARROWER than the display-oriented sets in deriveLookupColumns/RecordDetailDrawer (excludes owner/tenant/org, which are legitimately editable in some contexts). - Tests: object-schema-readonly and system fields are not inline-editable; normal fields still are. Refs #2402 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.
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.
Hardening of #2402 (double-click / pencil inline edit).
Gap
The inline-edit affordance gated
fieldEditableon only the view schema'sreadonly+ computed types (formula/summary/rollup/auto_number). It missed:readonly—DetailSection's field enrichment intentionally doesn't copyreadonlyfromobjectSchema.fields[name]into the enriched field, so a field the object schema marks read-only (but the view field doesn't) was treated as editable.created_at/idsurfaced as a section row could be double-clicked into an editor.Fix
DetailSection:fieldEditable = !isReadonly && !isComputedField && !isSystemField, whereisReadonlynow also readsobjectDefField.readonly, andisSystemFieldchecks a newNON_EDITABLE_SYSTEM_FIELDSset.packages/plugin-detail/src/systemFields.ts— the immutable field-name set. Deliberately narrower than the display-oriented system-field sets inderiveLookupColumns.ts/RecordDetailDrawer.tsx: it EXCLUDESowner_id/organization_id/tenant_id, which are legitimately editable (e.g. reassigning owner). Only truly framework-managed bookkeeping (created_x, updated_x, modified_x, id, soft-delete, instance_state).Verification
DetailSection.doubleClickEdit.test.tsx): object-schema-readonly field + system field are not inline-editable; a normal field still enters edit. 9/9 pass (incl. Detail view: Edit as primary CTA; enter inline edit by double-clicking a field (#2401) #2402's existing cases).plugin-detail(vite) build ✓.🤖 Generated with Claude Code