* fix(web): pin chat to late-mounted quiz cards
QuizViewer loads after the 4s post-stream scroll window, so mastery quiz cards stay below the fold until the user scrolls. Watch [data-chat-grow] for 12s without re-pinning unrelated details expands.
Related to #955
* fix(web): extend the existing post-stream window for late viewers
The post-stream effect already existed for exactly this case — its comment
names QuizViewer — so a second, parallel MutationObserver with its own 12s
window meant two observers racing for the same pin, each unaware of the
other's deadline.
Fold the extension into that one effect: the window starts at 4s and only a
*newly appearing* ``[data-chat-grow]`` node pushes it out to 12s. Gating on
appearance rather than presence matters — presence alone is satisfied
permanently by any quiz card from an earlier turn, which would have re-pinned
the user on every later DOM mutation, the precise mis-classification the
short window exists to avoid. The teardown timer follows the current
deadline, so a turn with no late viewer stops observing at 4s as before.
---------
Co-authored-by: ZQR1101 <278034003+ZQR1101@users.noreply.github.com>
Co-authored-by: Frank <bingxizhao@novix.science>
* fix(web): settle scroll to bottom after loading chat history
Every message wrapper uses content-visibility: auto with
containIntrinsicSize placeholders, so the first scrollTop = scrollHeight
pin in useLayoutEffect lands on an estimated "fake bottom" before the
browser lays out real heights. Reopening a long history session could
therefore stop mid-conversation instead of at the true bottom.
- Re-arm autoscroll and re-pin with a double requestAnimationFrame after
session load completes, once real heights are laid out
- Listen for capture-phase load events in the post-stream observer so
lazy images that settle inside the window also re-pin to the bottom
* fix(web): re-pin only on a cold open, and describe the real mechanism
Two corrections to this branch's own fix:
- The re-arm and re-pin ran on every completed load, including the
background revalidate of a session painted instantly from cache. A
reader who opened a known session and scrolled up to re-read something
got yanked to the bottom when that round trip landed. Cold opens are
the case with a stale pin; gate on it, and check the abort signal
inside the queued frames so a superseded load cannot move a viewport
that now belongs to a newer session.
- The comment justified the double-rAF with ``content-visibility: auto``
and ``containIntrinsicSize`` placeholders, which do not appear anywhere
in web/. The heights that actually arrive late are lazily-loaded images
and the next/dynamic capability viewers. Same for the hook's listener:
opening a history session is not its path (that effect does not re-run
on a session switch), the window right after a stream stops is.
---------
Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
The spinner (and a frozen tab) outlived the LLM stream by seconds and
grew with conversation length:
- DONE now carries the persisted user/assistant message ids so the
frontend reconciles its optimistic ids in place (lib/turn-reconcile)
instead of refetching, re-normalizing, and re-rendering the whole
session after every turn.
- The turn-event workspace mirror writes the whole batch in one append
off the event loop instead of one synchronous open/write per event.
- PocketBase gains a batch append_turn_events that uploads in the
background; the events.jsonl rglob flush in update_turn_status is
gone, and add_message returns the real record id.
- The streaming autoscroll pin is mutation/load-driven instead of an
unconditional 60fps scrollHeight read (forced layout) per frame.
During streaming the rAF re-pinned to the bottom every frame, so
scrolling up via the scrollbar thumb or PageUp/Home/arrows was yanked
back (wheel/touch already released). The loop now checks whether
scrollTop dropped below what it last pinned before re-pinning; a
decrease is unambiguous user intent (overflow-anchor:none means content
growth never lowers scrollTop), so it releases instead.
- Centralize Gemini 2.5/3 reasoning_effort=none in
reasoning_params.default_reasoning_effort_for so Visualize / Chat /
Solve / agentic loop stop returning empty bodies on those models.
- Visualize: per-capability max_tokens default (16k) seeded from
DEFAULT_AGENTS_SETTINGS, defensive root-tag trim on SVG/HTML output,
graceful fallback when JSON-mode review step crashes.
- Fix#485: require_auth / require_admin are async so the
set_current_user ContextVar reaches the endpoint instead of being
discarded by anyio.to_thread.run_sync's worker-thread context copy.
Adds _install_current_user helper shared by HTTP + WebSocket.
- Reasoning + native-tools chat protocol: formal content stream must
still start with FINISH/TOOL/THINK/PAUSE; tool-call deltas no longer
force-resolve labels and implicit_think_label is ignored, so
protocol-repair catches missing labels instead of mis-routing turns.
- Smooth streaming on every chat surface: useSmoothStreamText through
AssistantResponse, pin-to-bottom (useLayoutEffect) on book chat +
quiz follow-up, data-chat-scroll-root opt-in for overflow-anchor:none.
- Sidebar: collapsible Recents region with own scroll viewport,
deterministic Lucide icon per session via SessionAvatar, Docs link
next to GitHub footer, "New Chat" button removed (nav handles it).
- Add Lemonade local provider (port 13305) — registry entry, README
Docker host-gateway row, providers.md docs.
- Context-window models-endpoint probe honors DISABLE_SSL_VERIFY via
TCPConnector(ssl=False).
- README: insert v1.4.2 release row, push v1.3.10 inside "Past
releases" fold, bump install opt-in note to v1.4.2.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>