Skip to content

Conversation

BrianHung
Copy link
Collaborator

  • adds an onColumnAppended function
  • allows for onRowAppended to be called without trailingRow when new selection would move it beyond row limit

@lukasmasuch lukasmasuch requested a review from Copilot July 10, 2025 18:41
Copy link
Contributor

@Copilot 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

Adds support for column-appending alongside existing row-appending in both the core component and test harness, and updates API exports and selection behavior for trailing rows.

  • Introduce onColumnAppended callback and appendColumn method in DataEditor.
  • Extend test utilities (EventedDataEditor) to simulate appended columns and add corresponding tests.
  • Export emptyGridSelection and adjust trailing-row logic to be driven by trailingRowOptions.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
packages/core/test/test-utils.tsx Added extraCols state, onColumnAppended hook, and updated props in EventedDataEditor
packages/core/test/data-editor.test.tsx New tests for appendRow without a trailing row and for appendColumn via ref
packages/core/src/index.ts Exported emptyGridSelection
packages/core/src/data-editor/data-editor.tsx Added onColumnAppended prop, implemented appendColumn, and updated selection/movement logic
Comments suppressed due to low confidence (2)

packages/core/test/test-utils.tsx:280

  • [nitpick] The variable name c is ambiguous; consider renaming it to col for clarity.
            const [c] = cell;

packages/core/src/data-editor/data-editor.tsx:709

  • The JSDoc for appendColumn documents row but omits the openOverlay parameter. Add @param openOverlay to keep the documentation in sync with the signature.
     * @param row The row index to focus in the new column.

@lukasmasuch
Copy link
Collaborator

I was able to test the new onRowAppended behaviour without a trailing row. But how does it work with onColumnAppended? Using enter will always go down a row, right?

@BrianHung
Copy link
Collaborator Author

I was able to test the new onRowAppended behaviour without a trailing row. But how does it work with onColumnAppended? Using enter will always go down a row, right?

Tab works to go right; shift-tab to go left.

Copy link
Collaborator

@lukasmasuch lukasmasuch left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@lukasmasuch lukasmasuch merged commit 382a20e into glideapps:main Jul 10, 2025
4 checks passed
citizensas pushed a commit to Workfront/glide-data-grid that referenced this pull request Jul 21, 2025
* feat: onRowAppended and onColumnAppended

* fix onRowAppended spelling

* fix: fallback to updateSelectedCell if onRowAppended or onColumnAppended not defined

* fix spelling in changelog

* docs: appendColumn and onColumnAppended
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