Skip to content

feat: row and column attributes, and panels.<panel>.add to hide add buttons - #522

Merged
kevinchappell merged 12 commits into
mainfrom
feat/112-117-row-column-attrs
Oct 1, 2026
Merged

kevinchappell merged 12 commits into
mainfrom
feat/112-117-row-column-attrs

Conversation

@kevinchappell

Copy link
Copy Markdown
Collaborator

Summary

  • Rows get an Attributes tab next to a Settings tab (the existing fieldset, input group and column layout controls). Columns get an edit button with an Attributes panel. Attributes save to rows.<id>.attrs / columns.<id>.attrs and render on the .formeo-row / .formeo-column element that conditions target.
  • id and tag are reserved on rows and columns (plus data-clone-of on rows). The renderer now folds attrs.class into the class list, keeps a column's attrs.style with its width last, and ignores attrs.id / attrs.tag.
  • New panels.<panel>.add: false hides the add button for attrs, options, conditions and config, scoped per all, control id and component id.
  • Component#editWindow now looks up the edit button inside the component's own action bar. Without this, disabling a row's edit button and all its panels removed a child column's edit button (same for columns and their fields).

Visible changes

  • The row edit window is tabbed. rows.all.panels.disabled: ['settings'] hides the Settings tab.
  • Columns have an edit button. columns.all.actionButtons.disabled: ['edit'] removes it.

Test plan

  • npm test (819 passing), npm run test:types, npm run lint
  • Playwright: tests/row-column-attributes.spec.js plus the full suite (189 passed, 3 skipped)
  • dist/formData_schema.json unchanged after npm run build:lib

Related bugs found along the way, not fixed here: #520, #521.

Fixes #112
Fixes #117

Please squash-merge.

Rows and columns need a panel that isn't backed by their data (row Settings) and an
Attributes panel before any attribute exists. A row's or column's className list
never becomes a panel. A component whose panels are all disabled no longer throws
while building its (empty) Panels.

Refs #112
The row edit window now uses the shared Panels: a Settings tab with the
existing input group, fieldset and column layout controls, and an
Attributes tab that edits rows.<id>.attrs with the add-attribute dialog.
id, tag and data-clone-of are reserved. Re-adding an attribute on a
non-field component now replaces its item instead of duplicating it.

Refs #112
Columns get an edit button that opens an Attributes panel for columns.<id>.attrs.
id and tag are reserved. columns.all.actionButtons.disabled: ['edit'] restores the old buttons.

Refs #112
attrs.class now joins the class list instead of being lost, a column's attrs.style is kept
with its width last, and attrs.id / attrs.tag no longer override the element Formeo addresses.
Pins: row and column attrs validate in the formData schema, reach the row from a control set,
and don't break row conditions or input-group clones.

Refs #112
Works for attrs, options, conditions and config on fields, rows, columns and stages,
scoped per all, control id and component id. Existing items stay editable and removable;
locked and disabled rules are unchanged. Clear All on conditions stays.

Refs #117
The zero-panel edit window removed the first descendant's edit toggle when the component's own
was disabled, and updateEditPanels could swap a nested component's panel nav. Query only the
component's direct actions and edit window, and guard against having no buttons.

Refs #112
Copilot AI balanced review requested due to automatic review settings October 1, 2026 07:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Class/style handling, panel typings, and renderer documentation contain unresolved contract inconsistencies.

Review effort: Balanced
Findings: 2 Medium severity · 2 Low severity

Open (4)
What changed in this PR

Adds editable row/column attributes and configurable panel add-button visibility.

Changes:

  • Adds row Settings/Attributes tabs and column attribute editing.
  • Renders layout attributes while preserving reserved renderer properties.
  • Adds scoped panels.<panel>.add configuration, typings, documentation, and tests.
File Description
tests/​row-column-attributes.spec.js Adds end-to-end coverage.
src/​types/​formeo.test-d.ts Tests new public types.
src/​types/​formeo.d.ts Extends attributes and panel configuration types.
src/​lib/​js/​renderer/​layout-attrs.test.js Tests layout attribute rendering.
src/​lib/​js/​renderer/​index.js Processes row and column attributes.
src/​lib/​js/​formdata-schema.test.mjs Validates layout attributes.
src/​lib/​js/​components/​rows/​row.test.js Tests row panels and attributes.
src/​lib/​js/​components/​rows/​row.js Introduces tabbed row editing.
src/​lib/​js/​components/​rows/​index.js Configures row panels and reservations.
src/​lib/​js/​components/​edit-panel/​edit-panel.test.js Tests hidden add buttons.
src/​lib/​js/​components/​edit-panel/​edit-panel.js Applies panel add-button settings.
src/​lib/​js/​components/​control-sets.test.js Tests control-set row attributes.
src/​lib/​js/​components/​component.js Supports custom/default panels and scoped actions.
src/​lib/​js/​components/​component-panels.test.js Tests shared panel behavior.
src/​lib/​js/​components/​columns/​index.js Enables column editing and panels.
src/​lib/​js/​components/​columns/​column.test.js Tests column attribute editing.
src/​lib/​js/​components/​columns/​column.js Adds the column edit window.
docs/​renderer/​renderer.md Documents rendered layout attributes.
docs/​options/​config/​README.md Documents panel and attribute configuration.
docs/​options/​actions/​README.md Clarifies add-action behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/lib/js/renderer/index.js Outdated
Comment on lines +49 to +52
const { id: _id, tag: _tag, class: classAttr, ...rest } = attrs ?? {}
if (classAttr) {
rest.className = [rest.className, classAttr].flat().filter(Boolean)
}
Comment thread src/lib/js/renderer/index.js Outdated
Comment on lines +451 to +452
// the column's own style first, so its width always wins (#112)
style: style ? `${String(style).trim().replace(/;$/, '')}; ${width}` : width,
Comment thread docs/renderer/renderer.md Outdated
Comment on lines +1054 to +1055
A row's `attrs` and a column's `attrs` render on the `.formeo-row` / `.formeo-column` element, the one with id
`f-<id>` that conditions show and hide. The fieldset or wrapper around a row gets none of them.
Comment thread docs/renderer/renderer.md Outdated

```javascript
rows: {
'row-1': { id: 'row-1', config: {}, children: ['col-1'], attrs: { 'data-section': 'contact', className: 'contact' } },
…dth always win

Formeo's own class list, attrs.className and attrs.class now become one
array, so dom.create can no longer overwrite a string attrs.className with
the top-level one. Function class values are called instead of rendered as
source text. Width declarations in a column's attrs.style, !important
included, are dropped so config.width always applies.

Docs now say conditions hide the parent wrapper, not the f-<id> element,
and the row example includes the class it claims to render.

Refs #112
Without an edit button nothing opens the panels, so each column was
holding an unused panel tree and ResizeObserver.

Refs #112
@kevinchappell
kevinchappell merged commit 4b775db into main Oct 1, 2026
2 checks passed
@kevinchappell
kevinchappell deleted the feat/112-117-row-column-attrs branch October 1, 2026 08:40
@kevinchappell

Copy link
Copy Markdown
Collaborator Author

🎉 This PR is included in version 5.15.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

+ Attribute button Is it possible to add attribute in row section.

2 participants