Skip to content

A field typed autonumber (the spec spelling) is inline-editable on the detail page, so a user can overwrite a machine-generated value #4219

Description

@yinlianghui

Found during the fall-through sweep for #4216; filed unassigned per Prime Directive #10. Separate file, separate defect — #4216 is the input-widget routing, this is the editability gate.

What happens

packages/plugin-detail/src/fieldEnrichment.ts gates computed fields out of inline edit with one set:

export const TEXTUAL_REF_FALLBACK_TYPES = new Set([
  'formula',
  'summary',
  'rollup',
  'auto_number',
]);

isComputedFieldType() reads that set, and both hosts (DetailSection, HeaderHighlight) gate on it: fieldEditable = !isReadonly && !isComputedField && !isSystemField.

The set carries only auto_number. @objectstack/spec spells the type autonumber — stated in this repo's own alias table (packages/fields/src/field-type-alias.ts):

// `@objectstack/spec` spells this `autonumber`; the widget map key is
// `auto_number`. Map both spellings so a spec-typed field/param doesn't
// fall through to the plain text input.
autonumber: 'field:auto_number',
auto_number: 'field:auto_number',

So a field declared type: 'autonumber' is not recognised as computed, fieldEditable is true, the pencil / double-click affordance appears, and InlineFieldInput renders it as a plain text box the user can type over and save.

Why the spelling is the live one

autonumber is what the designer and the rest of the stack emit — packages/types/src/designer.ts:718, plugin-designer/src/DataModelDesigner.tsx:33, FieldDesigner.tsx:116, app-shell/src/views/importTargetFields.ts:48, app-shell/.../SchemaForm.tsx:228.

@object-ui/plugin-form guards both spellings in each of its non-input sets, which is the shape this one is missing:

packages/plugin-form/src/deriveMasterDetail.ts:40
  'formula', 'summary', 'rollup', 'autonumber', 'auto_number',
packages/plugin-form/src/deriveMasterDetail.ts:305
  const NON_INPUT_TYPES = new Set(['formula', 'summary', 'rollup', 'autonumber', 'auto_number']);

Why it matters

This is the objectui#3355 failure mode again, and that file's own doc comment records what it cost: a computed field that became inline-editable had its value overwritten by hand and stayed corrupted until an unrelated child-row touch re-fired the recomputation (objectstack#5077, downstream yinlianghui/hotcrm-heimao#61). An auto-number is the identity a user quotes back — a hand-edited one collides or gaps silently, and nothing recomputes it.

Note the set is also the input-side TEXTUAL_REF_FALLBACK_TYPES, so the same gap makes an autonumber carrying a reference_to eligible for the lookup-picker branch.

Likely shape of a fix

Add 'autonumber' to TEXTUAL_REF_FALLBACK_TYPES, matching plugin-form's both-spellings convention, with a pin asserting isComputedFieldType('autonumber', undefined) is true and that the field renders non-editable in DetailSection / HeaderHighlight. Worth checking rollup for the same treatment in the other direction (it is in this set but absent from the form alias table).


Generated by Claude Code

Activity

  1. yinlianghui commented on Aug 11, 2026

    @yinlianghui
    CollaboratorAuthor

    Seat note (objectui PM, session session_017Qqyix2QcnpUC9XeYVDzx3): PR #4228 (#4221's fix) likely closes this defect as a side effect — its exclusion gate resolves aliases, so a field typed autonumber (the spec/designer spelling) is now excluded from inline edit even though the detail computed gate still spells only auto_number. The user-facing harm (a machine-generated value inline-editable and overwritable) should be gone once #4228 lands.

    Held in queue for VERIFICATION rather than dispatch: when the seat next touches this card, the check is (a) confirm an autonumber-typed field renders no inline affordance post-#4228, and (b) decide whether the one-line spelling fix in TEXTUAL_REF_FALLBACK_TYPES is still worth landing for defense-in-depth (the computed gate and the exclusion gate serve different semantics — a value can be non-excluded yet computed). If (a) holds and (b) is judged redundant, close as completed-by-#4228.


    Generated by Claude Code

  2. yinlianghui commented on Aug 11, 2026

    @yinlianghui
    CollaboratorAuthor

    Re-scope after #4220's ride-along verdict (objectui seat PM, session session_017Qqyix2QcnpUC9XeYVDzx3): the card stays OPEN — the verification half came back but the fix half is still owed, on measured grounds.

    Verified (PR #4244's pins, both hosts): an autonumber-typed field renders NO inline affordance — #4228's alias-aware exclusion catches it, so this card's original symptom is closed. Still owed, per #4244's measurement: (1) InlineFieldInput's reference fallback reads TEXTUAL_REF_FALLBACK_TYPES DIRECTLY with no host gate in front — an autonumber carrying reference_to resolves into the record picker today, on exported public API; (2) the exclusion set is documented as movable and the two gates are a union whose survivability currently depends on which spelling the metadata uses. New scope: add autonumber to TEXTUAL_REF_FALLBACK_TYPES (the one-line spelling fix), with a pin on the reference-fallback path specifically. Small card, queue rotation; #4244 deliberately did not pin today's asymmetry so this fix lands without fighting a pin.


    Generated by Claude Code

  3. self-assigned this
    on Aug 11, 2026
  4. yinlianghui commented on Aug 11, 2026

    @yinlianghui
    CollaboratorAuthor

    CLAIM (objectui whole-repo seat PM, session session_017Qqyix2QcnpUC9XeYVDzx3) — the serialization gate opened with PR #4244's landing; dispatching the re-scoped card now.

    • Branch claude/issue-4219-autonumber-spelling, worktree objectui-issue-4219 (S container)
    • Scope per the re-scope comment above: add autonumber to TEXTUAL_REF_FALLBACK_TYPES, red-first pin on the REFERENCE-FALLBACK path specifically (an autonumber carrying reference_to must not resolve into the record picker), plus the gate-union survivability note verified (both spellings now caught by the computed set).

    Generated by Claude Code

  5. yinlianghui commented on Aug 11, 2026

    @yinlianghui
    CollaboratorAuthor

    ACCEPT (objectui seat PM, session session_017Qqyix2QcnpUC9XeYVDzx3, review of record) — PR #4251, CI fully green.

    The re-scoped card lands exactly: one member added beside auto_number in plugin-form's both-spellings convention, with a docblock recording WHY the set is spelling-sensitive and naming its one ungated reader — the documentation that prevents the next spelling gap from being a mystery. The red-first evidence is the real thing (the record picker's lookup-trigger button in the DOM dump for autonumber + reference_to, on the component as public API); union survivability is now asserted directly on the set rather than argued; and the #4220 partition table was measured to need no churn (both spellings already excluded via the exclusion gate — no second claim added). The sweep's find, #4250 (richtext vs rich_that/rich-text across four sets in three packages, including a pin that is green because the set holds the string rather than because any field reaches it), is correctly filed whole rather than half-fixed — a partial fix would make the detail page and the form disagree about the same field. Queued. Flipping ready + auto-merge.


    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions