# MessageScroller · semantische Komponentenreferenz

Keep a readable conversation position while content grows, without confusing native scrolling, message identity, visibility and keyboard focus.

Status der neuen Domänenmigration: **complete** im begrenzten Referenzumfang. Stabile Teile, tatsächlich passende Source-Selektoren, semantische Tokenwerte und nutzbare Zustands-Fixtures wurden mit dem normalen Komponentenprüfpfad und der echten React-Verwendung geprüft. [Browsernachweis](../../validation/semantic-final-browser-run.json); keine allgemeine Anwendungsfreigabe.

MessageScrollerProvider and three hooks are headless controllers; actual Root/Viewport/Content/Item/Button and private measured spacer have stable semantic bindings. Source native region/log semantics, stable message IDs, data-pending-scroll and active/inert command states stay authoritative. Native examples show 384px conversation cards/14px corners with different heights; this reference explicitly chooses a responsive 384px surface with 320px viewport and 72px minimum message rows to demonstrate real overflow, not a universal source sizing default.16px transcript inset and 8px row gaps provide readable speaker text. Private measured spacer remains source-owned and aria-hidden; no overriding measured height or scrollTop is encoded in CSS. Buttons use real source 28px icon-sm/16px glyphs and top/bottom 16px, hidden/inert when unavailable, with reduced-motion transitions. Native scroll position, follow intent, visible IDs and keyboard focus remain independent; wheel/key release auto-follow, actual observers preserve prepend anchor. No page coordinates, message-selection state, invented scroll callback or backend lifecycle.

[Stabile Anatomie und tatsächliche Source-/Caller-Bindungen](component.json), [CEM](interface.json), [semantische Zustands-/Variantenregeln](layout.css), [brauchbare Fixtures](stories.json). Native Muster, Hashes und Messwerte bleiben vollständig separat in [Quellmustern](figma/source-specimens.json) und [Traceability](figma/traceability.json).

Die veröffentlichten Props/Callbacks und der [führende SCXML-Aktor](behavior.scxml) bleiben die Quelle des tatsächlichen Verhaltens. [HTML/ARIA](accessibility.html) und [Projektionsregeln](accessibility.rules.json) benennen die konkrete Verwendung, einschließlich notwendiger Caller-Beschriftung. Selectorbindungen sind ein expliziter React-/DOM-Adaptervertrag, keine erfundenen automatischen Shadow-DOM-Exports.

MessageScrollerProvider is headless, with autoScroll=false default, defaultScrollPosition=end, scrollEdgeThreshold8px, previous-item peek64px, scrollMargin0. Root is div; actual Viewport defaults named region Messages, tabIndex0. Content defaults role=log/aria-relevant=additions; reference supplies transcript name and speaker text. Item is div with stable messageId and optional scrollAnchor=false; every direct content row is an Item, including separators/loading rows if supplied. Stable IDs—not array index or text—drive command targets, visibility and prepend preservation. Viewport preserveScrollOnPrepend defaults true. Initial default position applies once on first nonempty render (start|end|last-anchor), pending-scroll marks initial layout until applied. With autoScroll true, new content follows only while already following the bottom; deliberate wheel/touch/viewport scroll keys release follow, and readers away from end are not pulled down. Native geometry and Resize/Mutation/Intersection observers derive edges, anchor positioning and visibility; internal modes following-bottom/free-scrolling/anchored-to-message/settling-jump are not public controlled props. Anchored turns reserve a hidden accessibility spacer as needed. useMessageScroller returns scrollToMessage/scrollToStart/scrollToEnd with optional align/behavior/scrollMargin; commands return false when viewport/eligible target unavailable and may defer a known target until mounted. useMessageScrollerScrollable exposes start/end overflow booleans, useMessageScrollerVisibility exposes currentAnchorId and visibleMessageIds using lazily subscribed observers. These are hook snapshots, not fabricated change events. Button defaults direction=end, behavior=smooth, native type=button and readable source label; inactive button is inert/tabIndex-1. Active Button invokes onClick first, preventDefault vetoes command; accepted command blurs button then uses the real scroll command. Viewport onScroll syncs actual geometry before caller onScroll; wheel/touch/key user intent is observed before caller callbacks, so preventDefault there is not an invented undo of source intent.

Named viewport is natively focusable; Home/End/Page/arrow/Space scroll according to browser and release auto-follow intent. Scroll changes do not imply a selected message, move keyboard focus to a message, or announce every streamed token. Native scroll buttons support Enter/Space only while active, have meaningful names and preserve caller cancellation. The source intentionally blurs accepted scroll buttons; reference does not claim a focus trap or automatic focus return. Escape is passive. Essential speaker attribution/text remains readable; role=log additions is the source policy, and repeated complete-text rerenders must not become the only task status. Loading/network errors are caller feedback, not scroll state.

[Originale React-Quellen und Versionen](../../sources/manifest.json), [nativer FIG-/PNG-Beleg](figma/figma-observations.json) und [tatsächliches Source-Prüfziel](provenance://source/apps%2Fshadcn-reference-lab%2FREADME.md). `release:false`; kein allgemeines Pixel-/Framework-/AT-Zertifikat.
