Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TSK-760: Fix scroll issue for mac #3173

Merged
merged 1 commit into from
May 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions packages/ui/src/components/Scroller.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,12 @@
const wheelEvent = (e: WheelEvent) => {
e = e || window.event
const deltaY = e.deltaY
if (deltaY < 0 && autoscroll && scrolling && beforeContent && beforeContent > 0) scrolling = false
else if (deltaY > 0 && autoscroll && !scrolling && belowContent && belowContent <= 10) scrolling = true
if (deltaY < 0 && autoscroll && scrolling && beforeContent && beforeContent > 0) {
scrolling = false
} else if (deltaY > 0 && autoscroll && !scrolling && belowContent && belowContent <= 10) {
scrolling = true
}
scrollY += deltaY
}

let observer: IntersectionObserver
Expand Down Expand Up @@ -478,7 +482,14 @@
// TODO: Workaround: https://front.hc.engineering/workbench/platform/tracker/TSK-760
// In Safari scroll could jump on click, with no particular reason.

if (scrollY !== 0 && Math.abs(newPos - scrollY) > 100 && divScroll !== undefined && isSafari()) {
if (
!scrolling &&
!isScrolling &&
scrollY !== 0 &&
Math.abs(newPos - scrollY) > 100 &&
divScroll !== undefined &&
isSafari()
) {
divScroll.scrollTop = scrollY
}
scrollY = divScroll?.scrollTop ?? 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@

<Card on:close fullSize label={getEmbeddedLabel('Statistics')} okAction={() => {}} okLabel={getEmbeddedLabel('Ok')}>
{#if data}
{#each Object.entries(data.statistics?.activeSessions) as act}
{act[0]}: {act[1]}
{/each}
<div class="flex-column">
{#each Object.entries(data.statistics?.activeSessions) as act}
<span class="flex-row-center">
{act[0]}: {act[1]}
</span>
{/each}
</div>

<span class="fs-title flex-row-center">
Memory usage: {data.statistics.memoryUsed} / {data.statistics.memoryTotal}
Expand Down
6 changes: 5 additions & 1 deletion plugins/workbench-resources/src/connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,15 @@ export async function connect (title: string): Promise<Client | undefined> {
await setClient(_client)

if (me.role === AccountRole.Owner) {
let ep = endpoint.replace(/^ws/g, 'http')
if (!ep.endsWith('/')) {
ep += '/'
}
setMetadata(ui.metadata.ShowNetwork, (evt: MouseEvent) => {
showPopup(
ServerStatistics,
{
endpoint: endpoint.replace(/^ws/g, 'http') + '/' + token
endpoint: ep + token
},
'top'
)
Expand Down
9 changes: 7 additions & 2 deletions server/ws/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,9 +411,14 @@ class TSessionManager implements SessionManager {
workspace,
'hello happen',
service.getUser(),
'binary:',
service.binaryResponseMode,
'compression:',
service.useCompression,
this.workspaces.get(workspace)?.sessions?.size
'workspace users:',
this.workspaces.get(workspace)?.sessions?.size,
'total users:',
this.sessions.size
)
}
const helloResponse: HelloResponse = { id: -1, result: 'hello', binary: service.binaryResponseMode }
Expand Down Expand Up @@ -441,7 +446,7 @@ class TSessionManager implements SessionManager {
ctx,
ws,
resp,
this.sessions.size < 100 ? 10000 : 101,
this.sessions.size < 100 ? 10000 : 1001,
service.binaryResponseMode,
service.useCompression
)
Expand Down