diff --git a/.changeset/composer-scroll-containment.md b/.changeset/composer-scroll-containment.md index af1d24c7..d47bb125 100644 --- a/.changeset/composer-scroll-containment.md +++ b/.changeset/composer-scroll-containment.md @@ -2,10 +2,7 @@ "@intentface/chat": patch --- -A composer embedded in a scrolling page no longer scrolls that page. - -**Programmatic text changes.** `clear()`, `setText()` and the ask-user step changes used to nudge the page by a few pixels each time. Keeping the caret in view after a write now scrolls only the composer's own scroll areas, never past `Composer.Root`. A caret on an empty line, including an empty editor's, is measured by that line's break: on its own it has no box, and its all-zero rect read as "above the view". A trailing empty line in an overflowing composer now scrolls into view too. - -**Ask-user focus moves.** Moving into the options, arrowing between them, and typing to answer move focus without the browser's focus-scroll. An option outside its own list's view is still brought into view within the question. - -**`focus(options)`.** The composer controller's `focus` now takes `HTMLElement.focus()`'s options, so a consumer can focus an on-screen composer with `{ preventScroll: true }`. Called with no arguments, it behaves as before. +- [Composer] Fix an embedded composer scrolling the page around it on `clear()`, `setText()` and ask-user step changes. +- [Composer] Fix a trailing empty line in an overflowing composer not scrolling into view. +- [AskUser] Fix moving focus between options scrolling the page around an embedded question. +- [Composer] Add focus options to the controller's `focus()`, such as `{ preventScroll: true }`. diff --git a/.changeset/drop-nanoid.md b/.changeset/drop-nanoid.md index e3f0d309..4442a97f 100644 --- a/.changeset/drop-nanoid.md +++ b/.changeset/drop-nanoid.md @@ -2,4 +2,5 @@ "@intentface/chat": patch --- -- Remove the `nanoid` dependency; attachment ids are now the file's blob URL. +- Remove the `nanoid` dependency. +- [Attachments] Use the file's blob URL as the attachment id. diff --git a/.changeset/react-doctor-fixes.md b/.changeset/react-doctor-fixes.md index a3604264..a5cf48b3 100644 --- a/.changeset/react-doctor-fixes.md +++ b/.changeset/react-doctor-fixes.md @@ -2,8 +2,8 @@ "@intentface/chat": patch --- -Render-safety and re-render fixes from a React Doctor review. - -**No ref writes during render.** `AskUser.Options` and `AskUser.Option` mirror their latest values into refs in an insertion effect instead of during render, which React may discard. It runs before every layout effect, so options still seed the initial highlight from their own. `Composer.Command`'s "this prefix is the one closing" flag is now state that flips only at open and close. - -**Stable context values.** `AskUser.Root`, `AskUser.Options`, `AskUser.Option`, the shared collapsible behind `Reasoning` and `Steps`, and the anchored `Tabs` surface memoize their context values, so memoized consumers no longer redraw on every parent render. +- [AskUser] Fix `AskUser.Options` and `AskUser.Option` writing to refs during render. +- [Composer] Fix `Composer.Command` writing to a ref during render. +- [AskUser] Improve re-renders: `AskUser.Root`, `AskUser.Options` and `AskUser.Option` memoize their context values. +- [Reasoning] [Steps] Improve re-renders: their collapsible context is memoized. +- [Tabs] Improve re-renders: the anchored surface memoizes its context value.