useScrollToBottom (user-message-anchor) undershoots on thread load — lands several messages before the last user message
Los mantenedores suelen responder en 1 día
@abhithesys ya está trabajando en esto.
Desde el 28/3/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
Bug Report: useScrollToBottom with user-message-anchor doesn't reach the last user message on thread load
Package versions
@openuidev/react-ui:0.9.20@openuidev/react-headless:0.7.11- React:
19.2.4
Describe the bug
When loading a thread with many messages (via loadThread), the scroll
position lands several messages before the last user message instead of
placing it at the top of the viewport. The user must manually scroll down
to reach the end of the conversation.
The desired behavior — last user message pinned to the top of the
viewport — is correct; it's just not being achieved.
AI Analysis
The user-message-anchor branch in useScrollToBottom (lines 76-89)
does the right thing in principle:
const lastUserMessageDiv = Array.from(
element.querySelectorAll(userMessageSelector)
).pop();
const scrollPosition =
lastUserMessageDiv.getBoundingClientRect().top -
element.getBoundingClientRect().top +
element.scrollTop;
element.scrollTo({ top: scrollPosition, behavior: "smooth" });
The scroll fires in the useEffect on line 93-103 the moment isLoadingMessages flips to false. The issue is that at that point the message components haven't finished laying out — complex content like OpenUI components, Markdown blocks, tool-call accordions, and images are still mounting and expanding. As a result:
getBoundingClientRect() returns stale geometry — the positions are based on partially-rendered content, so the calculated scrollPosition is too low (too far up in the chat).
behavior: "smooth" locks in the stale target — the animated scroll commits to the position computed at call time. As content continues to expand below the measurement point the target becomes increasingly wrong, but smooth scroll doesn't re-evaluate.
Together these cause the scroll to land several messages short of the actual last user message.
Steps to reproduce
- Use Shell.ScrollArea with the default scrollVariant ("user-message-anchor").
- Have a thread with ~20+ messages, ideally containing assistant responses with rich content (OpenUI Renderer output, Markdown with code blocks, tool calls).
- Load the thread (click it in the sidebar → loadThread).
Observe: the viewport lands a few messages above the last user message. Scrolling down manually reveals the remaining messages.
Expected behavior
The last user message should be positioned at the top of the viewport after the thread finishes loading.
- Lenguaje dominante
- TypeScript
- Estrellas
- 10k
- Forks
- 698
- Merge medio
- 1 d 3 h
- PR fusionados (30 d)
- 133
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de thesysdev/openui
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
thesysdev/openui#1445 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Add dataInvention flag to PromptOptions to disable the 'generate realistic/plausible data' ruleAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
thesysdev/openui#959 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 18/100
thesysdev/openui#1528 · 1 reacción ·
Los mantenedores suelen responder en 1 día
Todos los issues de thesysdev/openui
Issues similares
-
ci-cd desktop size:low telemetry-improvement telemetry-round-1
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
vfarcic/dot-agent-deck#2079 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
Los mantenedores suelen responder en 1 día
-
Broken links in the docsAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 83/100
Los mantenedores suelen responder en 1 día
-
status:in-linear
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
n8n-io/n8n#43006 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
🔊 a11y
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
betagouv/mon-entreprise#4726 ·
Los mantenedores suelen responder en 9 días