Skip to content

feat(intent): honor major on to-one relations (off the list, still in the form)#6394

Merged
delchev merged 1 commit into
masterfrom
feat/intent-relation-major
Jul 23, 2026
Merged

feat(intent): honor major on to-one relations (off the list, still in the form)#6394
delchev merged 1 commit into
masterfrom
feat/intent-relation-major

Conversation

@delchev

@delchev delchev commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

What

A relation's major attribute was silently ignored. RelationIntent had no major field, and EdmIntentGenerator hardcoded widgetIsMajor="true" for every relation (both relationProperty and crossModelRelationProperty). So major: false on a manyToOne/oneToOne parsed without error but never dropped the dropdown from the entity list / document-items table.

Change

  • RelationIntent: new major field (default true) + isMajor()/setMajor().
  • EdmIntentGenerator: both relation emitters now emit widgetIsMajor from relation.isMajor().

The Harmonia detail-register columns loop already filters on widgetIsMajor, so a major: false relation now renders in the create/edit form and detail pane but not as a list/items-table column — the exact counterpart of a field's major: false (already supported). Default true preserves all existing behavior; the attribute is opt-in.

Motivation

Document line-item tables often want the FK dropdown in the add/edit dialog only, with a Depends-On-copied descriptive field shown as the single column instead (e.g. an invoice item auto-copying the Product's name into an editable Name, and hiding the raw Product column). That needs major: false on the relation, which this enables.

Test

EdmIntentGeneratorTest#relationMajorFalseEmitsWidgetIsMajorFalseAndDefaultsTrue — a local and a cross-model major: false relation emit widgetIsMajor=false; a default relation stays true. Full engine-intent unit suite green (214).

Docs follow-up (separate dirigible.io PR): extend the DSL reference note on major: false to say it applies to relations too.

🤖 Generated with Claude Code

… the form)

A relation's `major` attribute was silently ignored: RelationIntent had no
`major` field and EdmIntentGenerator hardcoded widgetIsMajor="true" for every
relation (both the local and the cross-model emitter). So `major: false` on a
manyToOne/oneToOne parsed fine but never dropped the dropdown from the entity
list / document-items table.

Add `major` (default true) to RelationIntent and emit widgetIsMajor from it in
relationProperty + crossModelRelationProperty. The Harmonia detail-register
columns loop already filters on widgetIsMajor, so a `major: false` relation now
renders in the create/edit form and detail pane but not as a list column - the
relation counterpart of a field's `major: false`. Default true preserves all
existing behavior; the attribute is opt-in.

EdmIntentGeneratorTest covers a local and a cross-model major:false relation
emitting widgetIsMajor=false while a default relation stays true.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@delchev
delchev merged commit 3b01574 into master Jul 23, 2026
10 checks passed
@delchev
delchev deleted the feat/intent-relation-major branch July 23, 2026 03:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant