fix: sks favs headers text overflow#1166
Conversation
cc32eb0 to
6740f6d
Compare
0ab0660 to
40ae9f8
Compare
Greptile SummaryElo żelo solvrowiczu! This PR fixes a text overflow in the SKS favourite dishes screen by replacing the fixed-height
Confidence Score: 4/5Two issues need fixing before merge: the widgetbook story has a doubled The core view change is straightforward and correct. The widgetbook story's
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[_SksFavouriteDishesView build] --> B[SliverStickyHeader]
B --> C[SliverStickyHeaderElement]
C --> D{_needsUpdateChild?}
D -- yes --> E[_element._build\nupdateChild with new widget]
D -- no --> F[child.layout only]
E --> G[RenderSliverStickyHeader performLayout]
F --> G
G --> H[updateGeometry\nextent = child.size.height]
H --> I[SliverGeometry\nvariable paintExtent]
J[Parent rebuild\nnew child same type] --> K{runtimeType changed?}
K -- no --> L[triggerRebuild NOT called\n_needsUpdateChild stays false]
K -- yes --> M[triggerRebuild called\nmarkNeedsLayout]
L --> N[Stale header rendered]
M --> D
Reviews (2): Last reviewed commit: "fix: sks favs headers text overflow" | Re-trigger Greptile |
40ae9f8 to
bfbadaf
Compare
| renderObject.triggerRebuild(); | ||
| } | ||
| } | ||
|
|
||
| @override | ||
| void performRebuild() { | ||
| super.performRebuild(); | ||
| renderObject.triggerRebuild(); |
There was a problem hiding this comment.
update only calls triggerRebuild() when the child's runtime type changes, so updates where the runtime type stays the same (e.g. Container with a different color or Text with a different string) are silently dropped. In practice, this means a locale or theme change inside _SksFavouriteDishesView won't repaint the sticky header: the parent rebuilds, calls update with a new Container, the condition is false (Container == Container), triggerRebuild() is never called, _needsUpdateChild stays false, and _build() is never re-invoked during layout. The guard should be newChild != oldChild without the runtimeType restriction.
Fixed overflow in sks favs headers
Screen_Recording_20260517_204709.mp4