Commit 657b7fc
fix(json-chat): restore Chat-mode auto-scroll on streaming + send (#89)
PR #84 added the entriesHydrated gate to suppress the empty-state flash,
but the gating made the entire ternary return null on a fresh chat mount
(entries=[], !busy, entriesHydrated=false). The scroll container was
left with no firstElementChild, so the useLayoutEffect that attaches the
ResizeObserver — mounted once with empty deps — found nothing to
observe and never re-ran after entries hydrated. From that point on
streaming token deltas grew the content but never triggered the
snap-to-bottom.
Wrap the conditional in a stable min-h-full flex-col div so the RO
always has a firstElementChild. The empty-state's previous min-h-full
referenced the scroll container; with a wrapper in between, switch it
to flex-1 so it fills the wrapper's column and the sparkle card stays
centered.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 0befb21 commit 657b7fc
1 file changed
Lines changed: 9 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1644 | 1644 | | |
1645 | 1645 | | |
1646 | 1646 | | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
| 1653 | + | |
1647 | 1654 | | |
1648 | 1655 | | |
1649 | 1656 | | |
| |||
1653 | 1660 | | |
1654 | 1661 | | |
1655 | 1662 | | |
1656 | | - | |
| 1663 | + | |
1657 | 1664 | | |
1658 | 1665 | | |
1659 | 1666 | | |
| |||
1718 | 1725 | | |
1719 | 1726 | | |
1720 | 1727 | | |
| 1728 | + | |
1721 | 1729 | | |
1722 | 1730 | | |
1723 | 1731 | | |
| |||
0 commit comments