Table: improve tile mode#2102
Open
fschinkel wants to merge 1 commit intofeatures/fschinkel/26.2/hybrid-manager-dispose-widgetsfrom
Open
Table: improve tile mode#2102fschinkel wants to merge 1 commit intofeatures/fschinkel/26.2/hybrid-manager-dispose-widgetsfrom
fschinkel wants to merge 1 commit intofeatures/fschinkel/26.2/hybrid-manager-dispose-widgetsfrom
Conversation
411586d to
c572753
Compare
f59e969 to
4d1fb9b
Compare
c572753 to
a8d6765
Compare
There may not always be a tile for a row. Therefore, implement Table.createTiles more lenient in order to avoid null pointer exceptions. In addition, the TableTileGridMediator ensures that null values removed from its list of tiles. The list of tiles of the TableTileGridMediator needs to be unique as the tiles will be rendered one after another. If there are duplicates in the list of tiles an 'Already rendered'-error will be thrown if the second occurrence is rendered. Therefore, the TableTileGridMediator removes all duplicates from its list of tiles. 379008
4d1fb9b to
cd9afd0
Compare
cguglielmo
reviewed
Mar 31, 2026
Member
cguglielmo
left a comment
There was a problem hiding this comment.
There is a typo in the commit message:
ensures that null values are removed from its list of tiles.
|
|
||
| setTiles(tiles: ObjectOrChildModel<Tile>[]) { | ||
| tiles = arrays.ensure(tiles) | ||
| .filter((value, index, array) => value && array.indexOf(value) === index); // remove duplicates |
Member
There was a problem hiding this comment.
This is O(n^2), using a Set should be faster: [...new Set(tiles)]
| return; | ||
| } | ||
| this.tiles = this.table.rows.map(row => this.tilesMap[row.id]); | ||
| this.tiles = this.table.rows.map(row => this.tilesMap[row.id]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There may not always be a tile for a row. Therefore, implement Table.createTiles more lenient in order to avoid null pointer exceptions. In addition, the TableTileGridMediator ensures that null values removed from its list of tiles.
The list of tiles of the TableTileGridMediator needs to be unique as the tiles will be rendered one after another. If there are duplicates in the list of tiles an 'Already rendered'-error will be thrown if the second occurrence is rendered. Therefore, the TableTileGridMediator removes all duplicates from its list of tiles.
379008