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:
    - ConversationList: scrolls down 40px then back up on load.
    - MessageThread: scrolls up 40px then back down (to bottom) on load.
- Animation only triggers if content overflows.
This commit is contained in:
google-labs-jules[bot] committed 2026-01-23 05:02:31 +00:00
1 parent 28a01bd13f
commit d989e09bdf
4 files changed
+650 -6

No files matched your search

+13 -1
View File
@@ -47,7 +47,7 @@ export function ConversationList({
}
root.appendChild(header);
const list = createElement(doc, "div", "dm-conversation-list__items");
const list = createElement(doc, "div", "dm-conversation-list__items no-scrollbar");
list.setAttribute("role", "listbox");
list.setAttribute("aria-label", "Conversation list");
@@ -75,6 +75,18 @@ export function ConversationList({
});
list.appendChild(row);
});
// Peek animation
if (conversations.length > 0) {
setTimeout(() => {
if (list.scrollHeight > list.clientHeight) {
list.scrollTo({ top: 40, behavior: "smooth" });
setTimeout(() => {
list.scrollTo({ top: 0, behavior: "smooth" });
}, 600);
}
}, 600);
}
}
list.addEventListener("keydown", (event) => {