Skip to content

feat(grid): add schema-driven widget forms and the table or view widget - #18

Open
remko48 wants to merge 6 commits into
stack/g4-grid-widgetsfrom
stack/g5-widget-forms
Open

remko48 wants to merge 6 commits into
stack/g4-grid-widgetsfrom
stack/g5-widget-forms

Conversation

@remko48

@remko48 remko48 commented Oct 12, 2026

Copy link
Copy Markdown
Member

The dialog to add or configure a widget, and the widget that shows a table or view inside a grid.

What changes

  • SchemaForm: renders the content form of a widget from the schema the server sends (text, long text, number, switch, choice, color, table/view picker). A new widget type needs a schema on the server and a component that renders it, not a new dialog.
  • AddWidget dialog: pick a type, set the title and whether it is shown, then fill in the content form. Required fields block saving.
  • DataWidget: shows the rows of the chosen table or view with the existing table components, loading columns, rows and relations through the normal API. Views without a table (grid views) are not offered as a target.

🖼️ Screenshots

No visible change yet, since the dialog opens from the grid view page in the next PR.

🏁 Checklist

  • ⛑️ Tests (unit and/or integration) are included or not needed
  • 🔙 Backport requests are created or not needed: /backport to stableX.X
  • 📅 Milestone is set
  • 🌸 PR title is meaningful (if it should be in the changelog: is it meaningful to users?)

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

@remko48
remko48 added this pull request to stack #15 October 12, 2026 08:33
@remko48
remko48 force-pushed the stack/g5-widget-forms branch 3 times, most recently from 0e09883 to a3dc6e7 Compare October 12, 2026 11:56

@remko48 remko48 left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Review (Thorough, round 2)

Each finding is an inline comment on the line it is about, marked 🔴 Blocker / 🟡 Concern / 🟢 Minor. This round takes the updated base stack into account (#13, #14 and #16 fixes, including 2ebf8c7, 2da6fa5 and 777c1b0); the diff of this PR itself is unchanged since it was rebased.

What was verified

  • Read the full diff against stack/g4-grid-widgets, and confirmed it is byte-identical to round 1.
  • Checked the schemas, sanitising and the new checkTargets / storedTargets logic in GridWidgetTypes.php (2da6fa5).
  • Traced the watcher flush order against how GridView (#19) mounts AddWidget.
  • Confirmed clearable and advancedFields exist on NcColorPicker in @nextcloud/vue 9.13.1.
  • Checked the commit trailers.

Not run

eslint, stylelint, build, any tests, the app. The blocker is traced from the code, not reproduced in a browser.

Comment thread src/modules/modals/AddWidget.vue Outdated
Comment thread src/modules/grid/widgets/DataWidget.vue Outdated
Comment thread src/modules/modals/AddWidget.vue Outdated
Comment thread src/modules/grid/SchemaForm.vue Outdated
Comment thread src/modules/grid/widgets/DataWidget.vue Outdated
Comment thread src/modules/modals/AddWidget.vue Outdated
Comment thread src/modules/modals/AddWidget.vue Outdated
Comment thread src/modules/grid/SchemaForm.vue Outdated
Comment thread src/modules/grid/SchemaForm.vue Outdated
Comment thread src/modules/grid/SchemaForm.vue
The form to add or configure a widget is rendered from the schema the
server defines for its type, so a new widget type needs a schema and a
renderer rather than its own dialog. The data widget shows the rows of
a table or view inside a grid.

Co-authored-by: Ruben van der Linde <ruben@conduction.nl>
Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Remko <remko@conduction.nl>
@remko48
remko48 force-pushed the stack/g5-widget-forms branch from a3dc6e7 to ac7b3d3 Compare October 12, 2026 13:09
…get is empty

- configuring a widget no longer resets its content to the defaults of the
  type picked before; only a type the user picks starts from defaults, and
  a widget of an unknown type is neither configured nor converted
- a data widget whose target the server marked broken says it no longer
  exists instead of loading it, a failed load has its own message, and the
  prompt to pick a target only shows while editing
- an empty widget title stays empty, the card shows the type name in the
  viewer's language
- the dialog loads the widget types itself and imports the helpers from
  gridLayout.js
- integer fields refuse fractions, booleans render as a switch, the colour
  swatch is empty for the theme colour and the view label is translatable

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Remko <remko@conduction.nl>
Comment thread src/modules/grid/SchemaForm.vue Outdated
Comment thread src/modules/grid/SchemaForm.vue
Comment thread src/modules/modals/AddWidget.vue Outdated
Comment thread src/modules/grid/SchemaForm.vue Outdated
Comment thread src/modules/grid/SchemaForm.vue Outdated
Comment thread src/modules/modals/AddWidget.vue
- an invalid number in the widget form now blocks saving instead of keeping
  the last valid value
- the dialog fills the form before it renders when the widget types are
  already loaded
- the view label in the target picker is no longer HTML-escaped
- the theme colour swatch has a max-contrast border, field data-cy names are
  camelCase, and every method has JSDoc

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Remko <remko@conduction.nl>
@github-actions github-actions Bot added the AI assisted This PR contains AI-assisted commits label Oct 12, 2026
Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Remko <remko@conduction.nl>
Signed-off-by: Remko <remko@conduction.nl>
Signed-off-by: Remko <remko@conduction.nl>
Assisted-by: ClaudeCode:claude-opus-5-5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI assisted This PR contains AI-assisted commits

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant