Skip to content

Conversation

ServeurpersoCom
Copy link
Collaborator

Make sure to read the contributing guidelines before submitting a PR

Description

This patch introduces dynamic viewport height handling in the main Svelte WebUI layout.

Problem

Using Tailwind’s h-screen relies on the CSS visual viewport height, which often doesn’t match the actual available space in the browser. On mobile devices (iOS/Android), the browser’s address bar appearing/disappearing leads to layout jumps, empty gaps, or hidden content. The UI isn’t always filling the screen as expected.

Solution

Added a reactive viewportHeight state, updated on every window.resize.

On onMount, the value is initialized with window.innerHeight.

The root container’s height is conditionally set with an inline style:height={viewportHeight}px.

Event listeners are properly cleaned up on unmount.

This ensures the layout always matches the real viewport height instead of relying on 100vh/h-screen quirks.

Benefits

Mobile UX is fixed: no more ghost scrollbars or clipped areas when the browser chrome toggles.

No regressions on desktop: viewportHeight just tracks the window height.

Lightweight, clean solution with minimal code changes.

@ServeurpersoCom
Copy link
Collaborator Author

ServeurpersoCom commented Sep 30, 2025

Copy link
Collaborator

@allozaur allozaur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ServeurpersoCom It'd be much better to utilize <svelte:window bind:innerHeight>, like:

let innerHeight = $state<number | undefined>();

// ...

<svelte:window bind:innerHeight />

// ...

	<div
		class="flex h-screen w-full"
		style:height="{innerHeight}px"
	>

(conditional is not needed as Svelte ignores invalid values and doesn't add the style: if innerHeight is invalid)

@ServeurpersoCom ServeurpersoCom force-pushed the fix-mobile-unwanted-scrolling branch 2 times, most recently from 5201216 to 3e032f8 Compare October 1, 2025 03:50
@allozaur
Copy link
Collaborator

allozaur commented Oct 1, 2025

@ServeurpersoCom plz just run npm run format and build static output. Then we can merge :)

@ServeurpersoCom ServeurpersoCom force-pushed the fix-mobile-unwanted-scrolling branch 2 times, most recently from 9fd4f5a to fe620c0 Compare October 1, 2025 10:04
@allozaur
Copy link
Collaborator

allozaur commented Oct 2, 2025

@ServeurpersoCom let's address the merge conflict and merge this PR

@ServeurpersoCom ServeurpersoCom force-pushed the fix-mobile-unwanted-scrolling branch from fe620c0 to 01e4a2a Compare October 2, 2025 11:40
…rolling

Use <svelte:window bind:innerHeight> instead of manual resize listener

Co-authored-by: Aleksander Grygier <aleksander.grygier@gmail.com>
@ServeurpersoCom ServeurpersoCom force-pushed the fix-mobile-unwanted-scrolling branch from 01e4a2a to 8b9405b Compare October 2, 2025 12:02
@allozaur allozaur merged commit 5113efd into ggml-org:master Oct 3, 2025
14 checks passed
gabe-l-hart added a commit to gabe-l-hart/llama.cpp that referenced this pull request Oct 3, 2025
* origin/master: (124 commits)
metal : fix loop bound in ggml_mem_ranges (ggml-org#16412)
llama : fix shapes for bert/mpt q/k norm (ggml-org#16409)
ggml : fix graph reallocation with multiple chunks (ggml-org#16396)
Fix missing messages on sibling navigation (ggml-org#16408)
vulkan: Replace uses of maxMemoryAllocationSize and VK_WHOLE_SIZE (ggml-org#16354)
vulkan: Fix FA coopmat1 invalid array indexing (ggml-org#16365)
ci : change macos-13 to macos-15-intel (ggml-org#16401)
Capture model name only after first token (streaming) or completed request (ggml-org#16405)
vulkan: in flash attention, bounds check against nem1 (don't rely on GGML_KQ_MASK_PAD) (ggml-org#16316)
webui : Fix messages payload sent to chat completions (ggml-org#16402)
fix: track viewportHeight via window.innerHeight to avoid unwanted scrolling (ggml-org#16356)
test-barrier : do not use more threads than physically available (ggml-org#16389)
ggml webgpu: add support for soft_max, optimize rms_norm (ggml-org#16357)
model : Apertus model implementation (ggml-org#15852)
musa: update compile flags (ggml-org#16265)
ci : fix ubuntu-latest-cmake-rpc (disable ccache) (ggml-org#16388)
ci: update vulkan ci (ggml-org#16294)
ci : fix clean-up of old logs (ggml-org#16381)
SYCL: Update to oneAPI 2025.2 (ggml-org#16371)
HIP: add IMbackK to codeowner (ggml-org#16375)
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants