Skip to content

Enhance ThemedTable2 with performance improvements and tests#128

Merged
ManuelRomeroA merged 3 commits into
mainfrom
development
Mar 28, 2026
Merged

Enhance ThemedTable2 with performance improvements and tests#128
ManuelRomeroA merged 3 commits into
mainfrom
development

Conversation

@ManuelRomeroA
Copy link
Copy Markdown
Contributor

This pull request focuses on improving the reliability, performance, and test coverage of the ThemedTable2 widget in the layrz_theme Flutter 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:

  • Fixed column key collision in _itemsStrings by using column index instead of col.hashCode, preventing silent data corruption when columns share the same headerText. [1] [2] [3]
  • Fixed silent update loss: updates arriving while loading are now queued via a _pendingUpdate flag and processed after the current operation completes. [1] [2] [3] [4]
  • Fixed unsendable closure crash: sort keys are now precomputed on the main thread before compute(), ensuring valueBuilder closures that capture BuildContext or i18n objects never cross the isolate boundary. [1] [2] [3]

Performance improvements:

  • Improved multi-select performance by introducing an internal Set<T> mirroring _selectedItems for O(1) contains() lookups, replacing previous O(n) checks. [1] [2] [3] [4] [5]
  • Improved didUpdateWidget performance by replacing DeepCollectionEquality (O(n)) with a fast O(1) heuristic using identical and length checks. [1] [2]

Codebase cleanup:

  • Removed all debugPrint statements from _filterAndSort and related logic. [1] [2] [3] [4]

Testing and versioning:

  • Added comprehensive widget tests for ThemedTable2, including regression coverage for key collision, search, sorting, refresh, and widget update scenarios.
  • Bumped version to 7.5.22 in pubspec.yaml and .claude-plugin/plugin.json. [1] [2]

…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
@github-actions
Copy link
Copy Markdown

📋 Changelog Summary

This PR includes the following changes:

✨ Features

  • enhance ThemedTable2 with widget tests and performance improvements; remove debug prints (85d103a by Manuel romero)
  • add SKILL.md for ThemedTable2 with detailed overview and usage examples (eb68032 by Manuel romero)

🐛 Bug Fixes

  • ThemedTable2 prevent unsendable closure crash when sorting i18n 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 for multiselect lookups perf: ThemedTable2 replace O(n) DeepCollectionEquality with O(1) heuristic in didUpdateWidget (d0dd31f by Manuel romero)

📊 Diff Stats

Metric Count
📄 Files changed 7
🟢 Insertions $\color{green}\textsf{+1011}$
🔴 Deletions $\color{red}\textsf{-74}$

🤖 Auto-generated by changelog workflow

@github-actions
Copy link
Copy Markdown

📊 Test Coverage Report

🎯 Dart/Flutter

Metric Value
Coverage 13.6%
Lines covered 10807 / 127
Lines missing -10680

🤖 Generated by coverage workflow

@ManuelRomeroA ManuelRomeroA merged commit 480126e into main Mar 28, 2026
4 checks passed
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.

1 participant