Commit 35e35bb
fix(react-core): preserve cache across layout toggles and reject zero-width entries
Self-inflicted resizes (compact↔expanded) were clearing the cache before
the ignoreResizeRef guard, forcing a full re-measurement on the very next
keystroke. Move the guard ahead of invalidation so layout toggles keep the
cache warm — container dimensions don't change during these transitions.
Also reject compactWidth <= 0 from being cached, preventing a zero-width
entry from silently disabling text-width expansion until the next resize.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 84d531c commit 35e35bb
2 files changed
Lines changed: 13 additions & 9 deletions
File tree
- packages/react-core/src/v2/components/chat
- __tests__
Lines changed: 8 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
706 | 706 | | |
707 | 707 | | |
708 | 708 | | |
| 709 | + | |
| 710 | + | |
709 | 711 | | |
710 | 712 | | |
711 | 713 | | |
| |||
857 | 859 | | |
858 | 860 | | |
859 | 861 | | |
860 | | - | |
861 | | - | |
862 | | - | |
863 | | - | |
864 | 862 | | |
865 | 863 | | |
| 864 | + | |
| 865 | + | |
866 | 866 | | |
867 | 867 | | |
868 | 868 | | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
869 | 873 | | |
870 | 874 | | |
871 | 875 | | |
| |||
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1462 | 1462 | | |
1463 | 1463 | | |
1464 | 1464 | | |
1465 | | - | |
| 1465 | + | |
1466 | 1466 | | |
1467 | 1467 | | |
1468 | 1468 | | |
| |||
1487 | 1487 | | |
1488 | 1488 | | |
1489 | 1489 | | |
1490 | | - | |
| 1490 | + | |
1491 | 1491 | | |
1492 | 1492 | | |
1493 | | - | |
| 1493 | + | |
1494 | 1494 | | |
1495 | 1495 | | |
1496 | 1496 | | |
| |||
1508 | 1508 | | |
1509 | 1509 | | |
1510 | 1510 | | |
1511 | | - | |
1512 | | - | |
| 1511 | + | |
| 1512 | + | |
1513 | 1513 | | |
1514 | 1514 | | |
1515 | 1515 | | |
| |||
0 commit comments