feat: Add peek animation and hide scrollbars in DM lists

- Add `.no-scrollbar` utility to hide scrollbars while keeping scrollability.
- Apply `.no-scrollbar` to ConversationList and MessageThread containers.
- Implement "peek" animation using `IntersectionObserver` to trigger only when the container becomes visible.
- Ensure CSS build is updated with new utilities.
This commit is contained in:
google-labs-jules[bot] committed 2026-01-23 05:10:25 +00:00
1 parent d989e09bdf
commit e6da22249e
3 files changed
+659 -10

No files matched your search

+20 -2
View File
@@ -139,7 +139,7 @@ export function MessageThread({
// Scroll to bottom and peek
if (messages.length > 0) {
setTimeout(() => {
const animate = () => {
timeline.scrollTop = timeline.scrollHeight;
if (timeline.scrollHeight > timeline.clientHeight) {
@@ -155,7 +155,25 @@ export function MessageThread({
}, 600);
}, 600);
}
}, 0);
};
if (typeof IntersectionObserver !== "undefined") {
const observer = new IntersectionObserver((entries) => {
const entry = entries[0];
if (entry.isIntersecting) {
observer.disconnect();
// First ensure we are at bottom
timeline.scrollTop = timeline.scrollHeight;
setTimeout(animate, 300);
}
}, { threshold: 0.1 });
observer.observe(timeline);
} else {
setTimeout(() => {
timeline.scrollTop = timeline.scrollHeight;
animate();
}, 0);
}
}
root.appendChild(timeline);