@@ -585,14 +585,19 @@ let fullContent = ref('')
const scrollContainer = ref(null)
const composerElement = ref(null)
const composerHeight = ref(0)
-// Keep floating previews above the sticky composer, including when its controls
-// wrap after a drawer opens or the user adds multiple lines/attachments.
-watch(composerElement, (element, _, onCleanup) => {
- if (!element) return
- const measure = () => { composerHeight.value = element.offsetHeight }
+const scrollbarGutter = ref(0)
+// Reserve space for the independent composer and keep it aligned with the
+// message column when drawers, multiline input or attachments change its size.
+watch([composerElement, scrollContainer], ([element, scroller], _, onCleanup) => {
+ if (!element || !scroller) return
+ const measure = () => {
+ composerHeight.value = element.offsetHeight
+ scrollbarGutter.value = scroller.offsetWidth - scroller.clientWidth
+ }
measure()
const observer = new ResizeObserver(measure)
observer.observe(element)
+ observer.observe(scroller)
onCleanup(() => observer.disconnect())
}, { flush: 'post' })
const userHasScrolledUp = ref(false)
@@ -1886,9 +1891,8 @@ onBeforeRouteUpdate((to, from, next) => {
padding: 8px 0 0;
box-sizing: border-box;
overflow-y: auto;
- // Disable boundary bounce as well as scroll chaining: the sticky composer
- // shares this viewport and otherwise moves with its rubber-band animation.
- overscroll-behavior-y: none;
+ // Keep native message bounce without chaining scroll to the outer page.
+ overscroll-behavior-y: contain;
scroll-padding-bottom: var(--chat-composer-height, 0px);
scrollbar-gutter: stable;
scrollbar-width: thin;
@@ -1918,20 +1922,27 @@ onBeforeRouteUpdate((to, from, next) => {
}
}
-// One scroll viewport spans the messages and composer, so the scrollbar reaches
-// the bottom of the chat column. The composer stays in flow to reserve its own
-// height, and sticks to the bottom while reading earlier messages.
+// Keep the full-height message scrollbar and reserve space below the last
+// message for the composer, which sits outside the bouncing scroll viewport.
.chat_scroll_content {
display: flex;
flex-direction: column;
min-height: 100%;
+
+ // Use an in-flow spacer so the content ResizeObserver also detects composer
+ // height changes and keeps the last message visible when following replies.
+ &::after {
+ content: '';
+ flex: 0 0 var(--chat-composer-height, 0px);
+ }
}
.chat_composer {
- position: sticky;
+ position: absolute;
bottom: 0;
+ left: 0;
+ right: var(--chat-scrollbar-gutter, 0px);
z-index: 12;
- flex-shrink: 0;
padding: 16px 0 max(8px, env(safe-area-inset-bottom));
background: var(--td-bg-color-container);
}