diff --git a/scripts/ui-shots.mjs b/scripts/ui-shots.mjs index 912006d..80680ce 100644 --- a/scripts/ui-shots.mjs +++ b/scripts/ui-shots.mjs @@ -1105,6 +1105,23 @@ const SCENES = [ }, clip: { x: 277, y: 600, width: 823, height: 200 } }, + { + // Many servers (#329-ish): the list scrolls, the + and the cog stay put. + name: 'rail-many-servers', + setup: async (p) => { + await discord(false)(p) + await p.evaluate(`(() => { + const s = window.__mohoShots.state() + const extra = Array.from({ length: 24 }, (_, i) => ({ id: 'discord:shots|guild:x' + i, accountId: 'discord:shots', service: 'discord', kind: 'guild', name: 'Server ' + (i + 1), position: 10 + i })) + window.__mohoShots.patch({ groups: [...s.groups, ...extra] }) + return true + })()`) + await sleep(600) + await p.evaluate(`document.querySelector('.rail-scroll').scrollTop = 1e6`) + await sleep(300) + }, + clip: { x: 0, y: 44, width: 280, height: 756 } + }, { name: 'discord-media-grid', setup: async (p) => { diff --git a/src/renderer/src/app.css b/src/renderer/src/app.css index 8e995eb..7c719f8 100644 --- a/src/renderer/src/app.css +++ b/src/renderer/src/app.css @@ -5241,6 +5241,7 @@ video.lightbox-media { /* The rail's entries scroll; the cog below stays put. */ .rail-scroll { + overscroll-behavior: contain; display: flex; flex-direction: column; align-items: center; diff --git a/src/renderer/src/components/ServerRail.tsx b/src/renderer/src/components/ServerRail.tsx index 74c03e1..2bfe816 100644 --- a/src/renderer/src/components/ServerRail.tsx +++ b/src/renderer/src/components/ServerRail.tsx @@ -681,24 +681,6 @@ export function ServerRail(): JSX.Element | null { {rest.map(renderEntry)} - {/* Where a server is added or joined, at the foot of the list as in - Discord, for whichever account is being looked at. */} - {folderMenu && ( @@ -764,6 +746,26 @@ export function ServerRail(): JSX.Element | null { )}
+ {/* Where a server is added or joined: pinned below the list with a rule + above it, so it never moves however many servers there are or + wherever one is dropped, and the list scrolls above it. For whichever + account is being looked at. */} +