Repository navigation
Session modal issues on mobile: scroll jumps to top on close, avatar overflow causes horizontal scroll #4358
Description
Describe the Bug
Summary
The session detail modal has two mobile-viewport issues that hurt usability on phones:
- Closing the modal scrolls the page back to the top instead of preserving the scroll position in the session list.
- The header layout overflows horizontally — the avatar + ID field combo is wider than the modal, causing a horizontal scrollbar and the avatar to appear oversized relative to the screen.
Both are reproducible on mobile browsers (iOS Safari) and on desktop Chrome with DevTools device emulation enabled.
Issue 1: Closing the modal scrolls to top
Steps to reproduce
- Open a website's Sessions page.
- Scroll down the session list a few screens.
- Open a session detail modal (tap the avatar).
- Close the modal (tap backdrop / dismiss button).
- The page scrolls back to the top.
Root cause
The session modal is controlled by a URL query param (session=...). Both opening and closing perform a client-side navigation:
- Open:
SessionsDataTable.tsx→updateParams({ session: row.id }) - Close:
SessionModal.tsx→router.push(updateParams({ session: undefined }))
The modal uses react-aria-components's Modal, whose usePreventScroll (from react-aria) locks scrolling by setting overflow: hidden on document.documentElement while open, and restores the original value on close.
The problem is a timing conflict between two operations that fire on close:
- React Aria restores
document.documentElement.overflow(fromhiddenback to the previous value). - In the same tick,
router.pushtriggers a Next.js client-side navigation, which triggers scroll restoration.
Because the document's overflow is mid-transition (just unlocked, layout being recomputed), the browser / Next.js reads an incorrect scroll position and resets to 0.
This is consistent with it being reproducible on desktop Chrome device emulation (not just iOS), since the preventScrollStandard path (which sets overflow: hidden on <html>) is what non-iOS browsers use.
Relevant files:
src/app/(main)/websites/[websiteId]/sessions/SessionModal.tsx—router.push(...)on closesrc/app/(main)/websites/[websiteId]/sessions/SessionProfileModal.tsx— same pattern on closesrc/app/(main)/websites/[websiteId]/sessions/SessionsDataTable.tsx—updateParams({ session: row.id })on open
Suggested fix
- Use
router.replaceinstead ofrouter.pushwhen closing — avoids adding a history entry and tends to keep scroll restoration more stable. - Or explicitly save/restore
window.scrollYbefore opening and after closing. - Or defer the
router.pushuntil after React Aria's scroll unlock has completed.
Issue 2: Avatar + ID field overflow causes horizontal scroll
Steps to reproduce
- Open a session detail modal on a mobile-width viewport.
- The modal header shows a large avatar next to a fixed-width ID field.
- The header is wider than the modal → horizontal scrollbar appears, avatar looks oversized.
Root cause
In SessionProfile.tsx:
<Row justifyContent="center" alignItems="center" gap="6">
<Avatar seed={data?.id} size={128} />
<Column width="360px">
<TextField label="ID" value={data?.id} allowCopy />
</Column>
</Row>
### Database
PostgreSQL
### Relevant log output
```shellWhich Umami version are you using?
No response
How are you deploying your application?
No response
Which browser are you using?
No response
Activity
Fix: Session modal issues on mobile: scroll jumps to top on close, av…
franciscao633 commentedon Jul 2, 2026
Thanks for reporting. both issues should be fixed and out next hotfix release.
tanmay5268 commentedon Jul 20, 2026
hey, is this issue resolved