Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions .changeset/composer-scroll-containment.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 }`.
3 changes: 2 additions & 1 deletion .changeset/drop-nanoid.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
10 changes: 5 additions & 5 deletions .changeset/react-doctor-fixes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Loading