Skip to content

🚧 Rework yaml structure for compound metadata#7483

Merged
laritakr merged 14 commits into
nested-compound-metadata-foundationfrom
rework-yaml-structure
Jun 6, 2026
Merged

🚧 Rework yaml structure for compound metadata#7483
laritakr merged 14 commits into
nested-compound-metadata-foundationfrom
rework-yaml-structure

Conversation

@laritakr

@laritakr laritakr commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Summary

A bunch of rework to #7479

  • change yaml structure
  • bugfixes

orangewolf and others added 10 commits June 3, 2026 16:20
Compound (hierarchical) metadata now calls its nested members
"subproperties" instead of "subfields" — the YAML key is
`subproperties:`, and the supporting classes, methods, i18n keys, and
CSS classes follow the same name.

This is a vocabulary rename only; the declaration structure, the
normalized internal shape, indexing, rendering, and validation are
unchanged. It sets up a later change that expresses subproperties as
composable, first-class properties.
A compound's members are now declared as separate top-level properties
that point back to the parent with `subproperty_of: <parent>`, rather
than nested in a `subproperties:` block. Each subproperty carries its
own group membership (`group:`) and form placement (`form: { cols: }`),
and a parent's `groups:` block names the groups. Subproperties are not
standalone resource attributes — the schema loaders fold them into the
parent, so storage, indexing, and rendering are unchanged.

This is the foundation for deeper nesting and for subproperties that
carry their own form/display options. The previous nested `subproperties:`
format is replaced (not kept for back-compat); both flex modes use the
same flat declaration.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Flexible (m3 profile) compound subproperties may omit `display_label`,
`available_on`, and `range`: the profile JSON schema exempts entries
declaring `subproperty_of`, and a subproperty inherits its parent
compound's class scope. The flexible schema model no longer requires a
`range` (keeping the declared `type:` when absent) and skips registering
subproperties as standalone class attributes.

Without this, a profile using the flat compound format fails validation
and the app raises on boot building attributes for a subproperty.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A `work_or_url` subproperty now resolves an internal id to the right
show page — a work to its work page, a collection to its collection
page — instead of the model-agnostic catalog route, using the
document's Wings-aware model resolution. The picker search also returns
collections alongside works, so a related item can be either.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A compound now renders in the form's primary section when it declares
`form: { primary: true }`, and in "Additional fields" otherwise —
matching how scalar terms split. The work and collection forms render
`primary_compound_terms` up top and `secondary_compound_terms` in the
collapsible section. The shipped samples demonstrate both: participants
and relationships are primary; identifiers and compound_rights are
additional.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@laritakr laritakr added the notes-minor Release Notes: Non-breaking features label Jun 6, 2026
laritakr and others added 2 commits June 6, 2026 01:20
The m3 schema loader could call `attributes_for` on a nil schema:
`find_by(id: version)` misses on an unknown version and
`create_default_schema` returns nil when a row already exists, so on a
fresh database or early boot the loader raised `NoMethodError`. It now
falls back to the latest schema and, failing that, the default attribute
set.
@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown

Test Results

    17 files  ±  0      17 suites  ±0   3h 35m 51s ⏱️ + 5m 3s
 7 760 tests +164   7 453 ✅ +163  307 💤 +1  0 ❌ ±0 
26 381 runs  +671  25 786 ✅ +669  595 💤 +2  0 ❌ ±0 

Results for commit d2f95a7. ± Comparison against base commit edb0db3.

This pull request removes 451 and adds 615 tests. Note that renamed tests count towards both.
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007f18764cac80>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007f2d2e732e60>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007f6b072593a0>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007fa9f39b6910>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f187650dc10>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f2d2d7b0640>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f6b0729e248>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007fa9f3f0d850>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy AdminSet: a4139154-f1f2-4ea1-8512-fa898c1fdcba
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy Hyrax::AdministrativeSet: 33d535e4-d95c-4ee9-bae5-0afb0308e833
…
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007f56829fa148>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007fac1b187800>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007fb16f886918>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplate:0x00007fb9b9a58988>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007f5682a0dd60>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007fac1b196198>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007fb16fc2b190>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to create #<Hyrax::PermissionTemplateAccess:0x00007fb9b9a7f290>
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy AdminSet: 6cfebd9e-f32d-4d60-b650-b2d888b5674e
spec.abilities.ability_spec ‑ Hyrax::Ability AdminSets and PermissionTemplates a user without edit access is expected not to be able to destroy Hyrax::AdministrativeSet: 83f8bc8c-658a-45fa-9f3e-01c2c06cdcf2
…

laritakr added 2 commits June 6, 2026 14:14
The redirects and compound form populators read their submitted
nested-attributes fragment through a shared
Hyrax::CompoundRowPlumbing module rather than each defining its own
identical fragment-coercion helpers.

Each populator keeps its own row-drop rule and value normalization;
only the shape coercion (unwrapping ActionController::Parameters) is
shared, so form behavior is unchanged in both flex modes.
The compound and field-behavior docs now live at documentation/ (no
longer under forms/) and spell out when to declare a compound versus
hand-write a field behavior: redirects and based_near stay field
behaviors because moving them onto the compound machinery would
change persisted shape or behavior, not refactor it.

References to the two docs areupdated to the new paths.
@laritakr laritakr changed the base branch from main to nested-compound-metadata-foundation June 6, 2026 18:18
@laritakr laritakr marked this pull request as ready for review June 6, 2026 18:21
@laritakr laritakr merged commit 5f1cfdd into nested-compound-metadata-foundation Jun 6, 2026
3 checks passed
@laritakr laritakr deleted the rework-yaml-structure branch June 6, 2026 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

notes-minor Release Notes: Non-breaking features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants