From 5a3eebecbd54b3de8f808efedf41dd4a3a706be0 Mon Sep 17 00:00:00 2001 From: LainHE Date: Wed, 23 Sep 2026 06:57:09 +0800 Subject: [PATCH 1/3] fix(web): zoom compensation and mobile chat scroll fixes - WebClient: divide fixed offsets and viewport heights by --ui-scale on large displays; fix member context menu position - WebClient: use 100dvh/100svh with fallbacks on mobile; constrain workspace-content height so message list scrolls properly - AdminView: keep html/body at real viewport while zoomed admin shell divides height by scale - DemoView: divide poke banner offsets by --ui-scale to keep intended margin - package-lock: drop stale peer flags --- web/package-lock.json | 4 ---- web/src/views/AdminView.vue | 4 ++-- web/src/views/DemoView.vue | 4 ++++ web/src/views/WebClient.vue | 31 +++++++++++++++++++++++++++---- 4 files changed, 33 insertions(+), 10 deletions(-) diff --git a/web/package-lock.json b/web/package-lock.json index c28a2c0..5f0fb0a 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -1354,7 +1354,6 @@ "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -1515,7 +1514,6 @@ "integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==", "devOptional": true, "license": "Apache-2.0", - "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -1530,7 +1528,6 @@ "integrity": "sha512-NTKlcQjlAK7MlQoyb6LgaqHc8sso/pVyUJYWMws3jg21uTJw/LddqIFPcPqP6PzpgbIcZyKI85sFE4HBrQDA8A==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "esbuild": "^0.25.0", "fdir": "^6.4.4", @@ -1612,7 +1609,6 @@ "resolved": "https://registry.npmjs.org/vue/-/vue-3.5.34.tgz", "integrity": "sha512-WdLBG9gm02OgJIG9axd5Hpx0TFLdzVgfG2evFFu8Rur5O/IoGc5cMjnjh3tPL6GnRGsYvUhBSKVPYVcxRKpMCA==", "license": "MIT", - "peer": true, "dependencies": { "@vue/compiler-dom": "3.5.34", "@vue/compiler-sfc": "3.5.34", diff --git a/web/src/views/AdminView.vue b/web/src/views/AdminView.vue index 65980e2..6746114 100644 --- a/web/src/views/AdminView.vue +++ b/web/src/views/AdminView.vue @@ -1382,8 +1382,8 @@ async function parseResponse(response: Response) { const value = await response. stays readable. Compensate viewport heights for that zoom; otherwise a 2K viewport becomes a 1920px-tall admin shell and clips its lower cards. */ @media(min-width:851px){ - :global(html),:global(body),:global(#app){height:calc(100dvh / var(--ui-scale));max-height:calc(100dvh / var(--ui-scale))} - .admin-root,.admin-shell,.admin-sidebar{height:calc(100dvh / var(--ui-scale));min-height:calc(100dvh / var(--ui-scale));max-height:calc(100dvh / var(--ui-scale))} + :global(html),:global(body){height:100dvh;max-height:100dvh} + :global(#app),.admin-root,.admin-shell,.admin-sidebar{height:calc(100dvh / var(--ui-scale));min-height:calc(100dvh / var(--ui-scale));max-height:calc(100dvh / var(--ui-scale))} .admin-main{height:100%;min-height:0} } diff --git a/web/src/views/DemoView.vue b/web/src/views/DemoView.vue index 7129373..575f5c6 100644 --- a/web/src/views/DemoView.vue +++ b/web/src/views/DemoView.vue @@ -88,6 +88,10 @@ function avatarStyle(name: string) { let hash = 0; for (const char of name) hash @media (max-width: 1080px) { .demo-shell { grid-template-columns: 210px minmax(0, 1fr); }.demo-actions-panel { grid-column: 1 / -1; min-height: 160px; }.demo-actions-panel .demo-panel-title { margin-bottom: 3px; }.demo-actions-panel > button { display: inline-flex; width: fit-content; }.demo-note { margin-top: 4px; }.demo-user { margin-top: 0; } } @media (max-width: 720px) { .demo-page { padding: 0 14px 24px; }.demo-header { min-height: 68px; }.demo-tools { gap: 6px; font-size: 10px; }.demo-badge { display: none; }.demo-shell { display: block; min-height: 0; }.demo-channel-panel { margin-bottom: 12px; }.demo-channel-panel .demo-channel:not(.active) { display: none; }.demo-actions-panel { margin-top: 12px; }.demo-main { padding: 17px 14px; }.demo-hero { min-height: 170px; padding: 20px; }.demo-wave { padding-right: 0; transform: scale(.75); transform-origin: right center; }.demo-chat-head { display: grid; align-items: start; }.demo-tabs { overflow-x: auto; }.demo-message { max-width: 94%; } } @media (max-width: 360px) { .demo-tools a { display: none; }.demo-hero h1 { font-size: 23px; }.demo-hero p { font-size: 11px; }.demo-voice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } } +/* The whole app is zoomed via #app (zoom:var(--ui-scale)) on large displays; + divide the fixed poke banner offsets back to CSS pixels so it stays at the + intended 82px/25px margin instead of drifting by the zoom factor. */ +@media (min-width: 851px) { .demo-poke { top: calc(82px / var(--ui-scale)); right: calc(25px / var(--ui-scale)); } } :global(:root[data-theme="dark"]) .demo-page { color: #e8f3f0; background: #101918; } :global(:root[data-theme="dark"]) .demo-channel-panel, :global(:root[data-theme="dark"]) .demo-actions-panel, :global(:root[data-theme="dark"]) .demo-main, :global(:root[data-theme="dark"]) .demo-voice-card { background: #172321; border-color: #30413d; } :global(:root[data-theme="dark"]) .demo-panel-title strong, :global(:root[data-theme="dark"]) .demo-hero h1, :global(:root[data-theme="dark"]) .demo-section-heading strong, :global(:root[data-theme="dark"]) .demo-chat-head strong, :global(:root[data-theme="dark"]) .demo-voice-card strong, :global(:root[data-theme="dark"]) .demo-user strong { color: #e8f3f0; } diff --git a/web/src/views/WebClient.vue b/web/src/views/WebClient.vue index ac111b6..10319d6 100644 --- a/web/src/views/WebClient.vue +++ b/web/src/views/WebClient.vue @@ -2236,7 +2236,15 @@ const chatTabLabel = computed(() => chatTab.value === "channel" ? t("textChannel const chatTitle = computed(() => chatTab.value === "channel" ? t("channelChat", { channel: currentChannelName.value }) : chatTab.value === "server" ? t("serverChat") : chatTab.value === "events" ? t("eventLog") : privateConversations.value.find((conversation) => conversation.id === privateClientId.value)?.name ?? t("privateMessage")); const chatPlaceholder = computed(() => chatTab.value === "private" ? t("privateMessagePlaceholder") : chatTab.value === "server" ? t("serverMessagePlaceholder") : t("sendMessagePlaceholder")); const visiblePokes = computed(() => pokeNotifications.slice(-3)); -const memberMenuStyle = computed(() => memberMenu.value ? { left: `${memberMenu.value.x}px`, top: `${memberMenu.value.y}px` } : {}); +const memberMenuStyle = computed(() => { + if (!memberMenu.value) return {}; + // #app applies zoom:var(--ui-scale) which also scales fixed-element + // coordinates against the viewport; divide the pointer position back to CSS + // pixels so the context menu opens exactly where the user clicked on large + // displays. + const scale = Number.parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--ui-scale")) || 1; + return { left: `${memberMenu.value.x / scale}px`, top: `${memberMenu.value.y / scale}px` }; +}); const median = (values: number[]) => { const sorted = [...values].sort((left, right) => left - right); return sorted.length ? sorted[Math.floor(sorted.length / 2)] : null; @@ -3589,9 +3597,24 @@ function stopWhisperTalk(): void { .join-page { height: 100dvh; min-height: 0; overflow: hidden; } .join-content { min-height: 0; } +/* Desktop zoom compensation. main.ts sets --ui-scale (>1 only on large + viewports) and App.vue applies zoom:var(--ui-scale) on #app. html/body stay + pinned to the real viewport (100dvh) while the zoomed roots divide their + height by the scale so the rendered result lands on exactly one viewport. + Without this a 2K/4K viewport would render a 1.5x-tall shell, clipping the + bottom of the workspace and leaving blank space under the control dock. + Non-zero fixed offsets (toast, poke banner) are divided back to CSS pixels + because zoom also scales fixed coordinates against the viewport. */ +@media (min-width: 851px) { + :global(html), :global(body) { height: 100dvh; max-height: 100dvh; } + :global(#app), .web-client, .join-page, .app-shell { height: calc(100dvh / var(--ui-scale)); min-height: 0; max-height: calc(100dvh / var(--ui-scale)); } + .toast { right: calc(24px / var(--ui-scale)); bottom: calc(24px / var(--ui-scale)); } + .poke-banner { top: calc(82px / var(--ui-scale)); right: calc(24px / var(--ui-scale)); } +} + @media (max-width: 740px) { .join-content { overflow-y: auto; } - .app-shell { height: 100dvh; min-height: 0; max-height: 100dvh; padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)); overflow: hidden; } + .app-shell { height: 100dvh; min-height: 0; max-height: 100dvh; padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px)); overflow: hidden; } .app-shell .workspace { height: auto; min-height: 0; flex: 1 1 auto; } .app-shell.mobile-view-channels .workspace { display: none; } .app-shell .member-panel.mobile-section-visible { flex: 1 1 auto; min-height: 0; max-height: none; } @@ -3621,7 +3644,7 @@ function stopWhisperTalk(): void { .member-menu-close { display: none; } @media (max-width: 740px) { - :global(html), :global(body), :global(#app) { height: 100%; min-height: 100%; max-height: none; } + :global(html), :global(body), :global(#app) { height: 100dvh; height: 100svh; min-height: 100dvh; min-height: 100svh; max-height: 100dvh; max-height: 100svh; } .web-client { height: 100dvh; height: 100svh; min-height: 100dvh; min-height: 100svh; max-height: 100dvh; max-height: 100svh; } .app-shell { height: 100dvh; height: 100svh; min-height: 100dvh; min-height: 100svh; max-height: 100dvh; max-height: 100svh; padding-bottom: calc(74px + env(safe-area-inset-bottom, 0px)); overflow: hidden; } .app-shell .workspace { height: calc(100dvh - 74px - env(safe-area-inset-bottom, 0px)); height: calc(100svh - 74px - env(safe-area-inset-bottom, 0px)); min-height: 0; max-height: calc(100dvh - 74px - env(safe-area-inset-bottom, 0px)); max-height: calc(100svh - 74px - env(safe-area-inset-bottom, 0px)); overflow: hidden; } @@ -3683,7 +3706,7 @@ function stopWhisperTalk(): void { .member-action-button:hover, .member-action-button:active { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--surface-1)); } .app-shell.mobile-view-chat .workspace-scroll { overflow: hidden; } - .app-shell.mobile-view-chat .workspace-content { display: flex; flex-direction: column; min-height: 100%; padding: 0 14px calc(8px + env(safe-area-inset-bottom, 0px)); } + .app-shell.mobile-view-chat .workspace-content { display: flex; flex-direction: column; height: 100%; min-height: 0; padding: 0 14px calc(8px + env(safe-area-inset-bottom, 0px)); } .app-shell.mobile-view-chat .chat-panel { display: flex; flex: 1 1 auto; flex-direction: column; min-height: 0; margin-top: 0; padding: 0; border-top: 0; } .app-shell.mobile-view-chat .chat-tabs { flex: 0 0 auto; margin-top: 0; padding: 10px 0 9px; border-bottom: 1px solid var(--border); scrollbar-width: none; } .app-shell.mobile-view-chat .chat-tabs::-webkit-scrollbar { display: none; } From 408d8bcda42c9c3357b396fa378f73efc470edc4 Mon Sep 17 00:00:00 2001 From: LainHE Date: Wed, 23 Sep 2026 08:39:36 +0800 Subject: [PATCH 2/3] feat(web): float desktop audio dock and message composer Float .desktop-audio-dock at the bottom of .member-panel and .message-composer at the bottom of .chat-panel on desktop (>=741px): - switch both from in-flow to absolute positioning, keeping the original visual anchor semantics - width follows the parent content width (left/right insets align with member-panel horizontal padding / chat-panel zero padding) - add padding-bottom compensation to .member-panel and .chat-panel so member/message lists are not covered - mobile layout (<=740px) remains untouched --- web/src/views/WebClient.vue | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/web/src/views/WebClient.vue b/web/src/views/WebClient.vue index 10319d6..82f68dd 100644 --- a/web/src/views/WebClient.vue +++ b/web/src/views/WebClient.vue @@ -3945,8 +3945,21 @@ function stopWhisperTalk(): void { /* Desktop audio popovers: keep the rail compact and reveal each control's adjustment surface only while the pointer or keyboard focus is on it. */ @media (min-width: 741px) { - .app-shell .member-panel { overflow: visible; } - .desktop-audio-dock { position: relative; z-index: 6; } + /* 桌面端悬浮(仅 ≥741px 生效,≤740px 移动端布局不受影响): + 1) 桌面控制坞 .desktop-audio-dock 脱离文档流悬浮于成员面板底部, + 仍浮在原布局位置(距面板底 18px),宽度跟随面板内容宽度 + (left/right 各留 18px,与 member-panel 水平内边距一致, + 随列宽自适应伸缩);高度仍由内容撑起。member-panel 作为 + absolute 包含块并加 padding-bottom 补偿原占位,避免成员列表 + 被遮挡。 + 2) 消息输入框 .message-composer 脱离文档流悬浮于聊天面板底部, + 宽度跟随聊天面板内容宽度(chat-panel 水平内边距为 0, + left/right:0 即与内容宽度完全一致);chat-panel 作为包含块 + 并加 padding-bottom 补偿原占位,避免消息列表被遮挡。 */ + .app-shell .member-panel { position: relative; overflow: visible; padding-bottom: calc(18px + 12px + 52px); } + .desktop-audio-dock { position: absolute; z-index: 6; left: 18px; right: 18px; bottom: 18px; margin-top: 0; } + .app-shell .chat-panel { position: relative; padding-bottom: calc(16px + 48px); } + .app-shell .message-composer { position: absolute; z-index: 3; left: 0; right: 0; bottom: 16px; margin-bottom: 0; } } .dock-hover-control { position: relative; flex: 0 0 34px; } From c7794a12e7374bec5b007324762b4bdce019f511 Mon Sep 17 00:00:00 2001 From: LainHE Date: Wed, 23 Sep 2026 09:48:08 +0800 Subject: [PATCH 3/3] fix(web): give join footer solid background and stacking, constrain join-content scroll - .join-footer: background var(--surface-0) so it matches page theme in light/dark/system; z-index 2 so it stays above join-content overlap on short viewports - .join-content: overflow-y auto on desktop so oversized copy scrolls inside the container instead of spilling into the footer --- web/src/views/WebClient.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/web/src/views/WebClient.vue b/web/src/views/WebClient.vue index 82f68dd..fd0072d 100644 --- a/web/src/views/WebClient.vue +++ b/web/src/views/WebClient.vue @@ -3049,6 +3049,7 @@ function stopWhisperTalk(): void { .join-header, .join-content, .join-footer { position: relative; z-index: 1; } .join-header { z-index: 10; } .join-header .language-switcher { z-index: 50; } +.join-footer { z-index: 2; } .join-header { min-height: 84px; display: flex; align-items: center; justify-content: space-between; } .brand-lockup { display: flex; align-items: center; gap: 12px; } .brand-mark, .rail-logo { display: grid; place-items: center; color: #fff; background: #006a64; box-shadow: 0 8px 18px rgba(0, 106, 100, .15); } @@ -3121,7 +3122,7 @@ function stopWhisperTalk(): void { .connect-button { width: 100%; min-height: 44px; margin-top: 10px; font-size: 13px; } .button-spinner { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; } .join-meta { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 12px; color: #96a29f; font-size: 10px; } -.join-footer { display: flex; align-items: center; min-height: 68px; color: #9ba6a3; border-top: 1px solid #e8edeb; font-size: 11px; }.join-footer a { color: #628e89; text-decoration: none; }.join-footer a:hover { color: #006a64; text-decoration: underline; } +.join-footer { display: flex; align-items: center; min-height: 68px; background: var(--surface-0); color: #9ba6a3; border-top: 1px solid #e8edeb; font-size: 11px; }.join-footer a { color: #628e89; text-decoration: none; }.join-footer a:hover { color: #006a64; text-decoration: underline; } .footer-separator { margin: 0 8px; color: #ccd5d1; }.footer-spacer { flex: 1; } .app-shell { display: grid; grid-template-columns: 76px 292px minmax(0, 1fr) 246px; height: 100dvh; overflow: hidden; background: #fff; } @@ -3595,7 +3596,7 @@ function stopWhisperTalk(): void { content scroll area so headers, controls and mobile navigation stay fixed. */ :global(html), :global(body), :global(#app) { width: 100%; height: 100dvh; min-height: 0; max-height: 100dvh; overflow: hidden; } .join-page { height: 100dvh; min-height: 0; overflow: hidden; } -.join-content { min-height: 0; } +.join-content { min-height: 0; overflow-y: auto; } /* Desktop zoom compensation. main.ts sets --ui-scale (>1 only on large viewports) and App.vue applies zoom:var(--ui-scale) on #app. html/body stay