Enhance ThemedTable2 with performance improvements and tests#128
Merged
Conversation
…columns fix: ThemedTable2 resolve column key collision by using positional index instead of col.hashCode fix: ThemedTable2 queue pending updates instead of silent discard during concurrent sort perf: ThemedTable2 replace O(n) List.contains with internal Set<T> for multiselect lookups perf: ThemedTable2 replace O(n) DeepCollectionEquality with O(1) heuristic in didUpdateWidget
…ents; remove debug prints
📋 Changelog SummaryThis PR includes the following changes: ✨ Features
🐛 Bug Fixes
📊 Diff Stats
🤖 Auto-generated by changelog workflow |
📊 Test Coverage Report🎯 Dart/Flutter
🤖 Generated by coverage workflow |
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.
This pull request focuses on improving the reliability, performance, and test coverage of the
ThemedTable2widget in thelayrz_themeFlutter library. The changes address critical issues like column key collisions, update loss during loading, and isolate safety for closures, while also optimizing multi-select and widget update performance. All debug logging has been removed from the core filtering and sorting logic, and comprehensive widget tests have been added.Bug fixes:
_itemsStringsby using column index instead ofcol.hashCode, preventing silent data corruption when columns share the sameheaderText. [1] [2] [3]_pendingUpdateflag and processed after the current operation completes. [1] [2] [3] [4]compute(), ensuringvalueBuilderclosures that captureBuildContextor i18n objects never cross the isolate boundary. [1] [2] [3]Performance improvements:
Set<T>mirroring_selectedItemsfor O(1)contains()lookups, replacing previous O(n) checks. [1] [2] [3] [4] [5]didUpdateWidgetperformance by replacingDeepCollectionEquality(O(n)) with a fast O(1) heuristic usingidenticaland length checks. [1] [2]Codebase cleanup:
debugPrintstatements from_filterAndSortand related logic. [1] [2] [3] [4]Testing and versioning:
ThemedTable2, including regression coverage for key collision, search, sorting, refresh, and widget update scenarios.7.5.22inpubspec.yamland.claude-plugin/plugin.json. [1] [2]