Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 12, 2025

The "Available Callback Options" table was missing six callback functions added in commit 48531fc.

Changes:

  • Added onAddRow, onAddColumn, onAddField to documentation table
  • Added onRemoveRow, onRemoveColumn, onRemoveField to documentation table

These callbacks follow the same pattern as existing onUpdate* callbacks but fire when components are added or removed rather than updated.

const editor = new FormeoEditor({
  events: {
    onAddRow: (evt) => console.log('Row added:', evt.detail),
    onRemoveField: (evt) => console.log('Field removed:', evt.detail)
  }
})

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copy link
Collaborator

@kevinchappell kevinchappell left a comment

Choose a reason for hiding this comment

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

lgtm

@kevinchappell kevinchappell marked this pull request as ready for review November 12, 2025 17:41
Copilot AI review requested due to automatic review settings November 12, 2025 17:41
Copilot AI changed the title [WIP] WIP addressing feedback on events system docs: add missing callback options to events documentation table Nov 12, 2025
Copilot AI requested a review from kevinchappell November 12, 2025 17:42
@kevinchappell kevinchappell merged commit 8e4b6ef into fix/events Nov 12, 2025
5 checks passed
@kevinchappell kevinchappell deleted the copilot/sub-pr-411 branch November 12, 2025 17:42
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses feedback from PR #411 by adding documentation for six missing callback options related to adding and removing rows, columns, and fields in the events system.

  • Adds onAddRow, onAddColumn, onAddField callback documentation
  • Adds onRemoveRow, onRemoveColumn, onRemoveField callback documentation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 40 to +46
| `onUpdateColumn` | Function | Fires when column is updated |
| `onUpdateField` | Function | Fires when field is updated |
| `onAddRow` | Function | Fires when row is added |
| `onAddColumn` | Function | Fires when column is added |
| `onAddField` | Function | Fires when field is added |
| `onRemoveRow` | Function | Fires when row is removed |
| `onRemoveColumn` | Function | Fires when column is removed |
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

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

[nitpick] The ordering of these callback options doesn't match the pattern used in the "Available DOM Events" section below (lines 81-90). For consistency, consider grouping by component type instead of by operation type.

For example:

| `onUpdateRow`        | Function | Fires when row is updated                |
| `onAddRow`           | Function | Fires when row is added                  |
| `onRemoveRow`        | Function | Fires when row is removed                |
| `onUpdateColumn`     | Function | Fires when column is updated             |
| `onAddColumn`        | Function | Fires when column is added               |
| `onRemoveColumn`     | Function | Fires when column is removed             |
| `onUpdateField`      | Function | Fires when field is updated              |
| `onAddField`         | Function | Fires when field is added                |
| `onRemoveField`      | Function | Fires when field is removed              |

This would match the DOM Events table structure and make it easier for users to find related callbacks.

Suggested change
| `onUpdateColumn` | Function | Fires when column is updated |
| `onUpdateField` | Function | Fires when field is updated |
| `onAddRow` | Function | Fires when row is added |
| `onAddColumn` | Function | Fires when column is added |
| `onAddField` | Function | Fires when field is added |
| `onRemoveRow` | Function | Fires when row is removed |
| `onRemoveColumn` | Function | Fires when column is removed |
| `onAddRow` | Function | Fires when row is added |
| `onRemoveRow` | Function | Fires when row is removed |
| `onUpdateColumn` | Function | Fires when column is updated |
| `onAddColumn` | Function | Fires when column is added |
| `onRemoveColumn` | Function | Fires when column is removed |
| `onUpdateField` | Function | Fires when field is updated |
| `onAddField` | Function | Fires when field is added |

Copilot uses AI. Check for mistakes.
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.

2 participants