Skip to content

fix suggestions on documents with deleted tables#2069

Merged
paulfitz merged 1 commit intomainfrom
paulfitz/suggestions-with-removed-tables
Jan 26, 2026
Merged

fix suggestions on documents with deleted tables#2069
paulfitz merged 1 commit intomainfrom
paulfitz/suggestions-with-removed-tables

Conversation

@paulfitz
Copy link
Member

If tables have been deleted from a document, it looks like rowModels can exist but be empty. This led to an error in suggestions.

Has this been tested?

  • 👍 yes, I added tests to the test suite
  • 💭 no, because this PR is a draft and still needs work
  • 🙅 no, because this is not relevant here
  • 🙋 no, because I need help

If tables have been deleted from a document, it looks like
rowModels can exist but be empty. This led to an error in
suggestions.
@paulfitz paulfitz marked this pull request as ready for review January 26, 2026 00:32
const lst = Object.entries(diffs).map(([table, tdiff]: [string, TabularDiff]) => {
const data = convertTabularDiffToTableData(table, tdiff);
const tableRow = this._gristDoc.docModel.tables.rowModels.find(tr => tr.tableId() === table);
// Careful, there can be blank rowModels if tables were removed.
Copy link
Contributor

Choose a reason for hiding this comment

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

Funny how GitHub sees this one-character change as a big two-line modification 😞

@paulfitz paulfitz merged commit f6012e1 into main Jan 26, 2026
15 checks passed
@paulfitz paulfitz deleted the paulfitz/suggestions-with-removed-tables branch January 26, 2026 14:11
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