From f0e175d4bcd0831f8566f8a6f716bd3255334c1d Mon Sep 17 00:00:00 2001 From: Shea Duma Date: Fri, 15 May 2026 10:05:54 +0300 Subject: [PATCH] fixed some banner issues --- .../common-settings/appearance/Appearance.tsx | 11 ++++--- .../features/settings/cosmetics/Themes.tsx | 2 +- src/app/pages/client/home/Home.tsx | 18 +++++++----- .../client/sidebar/SidebarResizer.css.ts | 29 +++++++++++++++---- .../pages/client/sidebar/SidebarResizer.tsx | 9 ++---- src/app/pages/client/space/Space.tsx | 2 ++ 6 files changed, 45 insertions(+), 26 deletions(-) diff --git a/src/app/features/common-settings/appearance/Appearance.tsx b/src/app/features/common-settings/appearance/Appearance.tsx index 3d1266952..06e9090fb 100644 --- a/src/app/features/common-settings/appearance/Appearance.tsx +++ b/src/app/features/common-settings/appearance/Appearance.tsx @@ -26,20 +26,19 @@ import { settingsAtom } from '$state/settings'; import { stopPropagation } from '$utils/keyboard'; import FocusTrap from 'focus-trap-react'; -export function SelectShowPerRoomRoomIcon({roomId}: {roomId: string}) { +export function SelectShowPerRoomRoomIcon({ roomId }: { roomId: string }) { const [menuCords, setMenuCords] = useState(); const showRoomIconItems = useShowPerRoomRoomIcon(); const [showRoomIconArray, setShowRoomIconArray] = useSetting(settingsAtom, 'perRoomShowRoomIcon'); - const showRoomIcon = showRoomIconArray.find(item => item.roomId === roomId )?.display; + const showRoomIcon = showRoomIconArray.find((item) => item.roomId === roomId)?.display; const handleMenu: MouseEventHandler = (evt) => { setMenuCords(evt.currentTarget.getBoundingClientRect()); }; const handleSelect = (position?: ShowRoomIcon) => { - let newShowRoomIconArray = showRoomIconArray.filter(item => item.roomId !== roomId ); - if(position) - newShowRoomIconArray = [...newShowRoomIconArray, {roomId, display: position}] + let newShowRoomIconArray = showRoomIconArray.filter((item) => item.roomId !== roomId); + if (position) newShowRoomIconArray = [...newShowRoomIconArray, { roomId, display: position }]; setShowRoomIconArray(newShowRoomIconArray); setMenuCords(undefined); }; @@ -135,7 +134,7 @@ export function Appearance({ requestClose }: AppearanceProps) { } + after={} /> diff --git a/src/app/features/settings/cosmetics/Themes.tsx b/src/app/features/settings/cosmetics/Themes.tsx index 8bea290e7..fa93a3890 100644 --- a/src/app/features/settings/cosmetics/Themes.tsx +++ b/src/app/features/settings/cosmetics/Themes.tsx @@ -719,7 +719,7 @@ function SelectShowRoomIcon() { }; const handleSelect = (position?: ShowRoomIcon) => { - if(!position) return; + if (!position) return; setShowRoomIcon(position); setMenuCords(undefined); }; diff --git a/src/app/pages/client/home/Home.tsx b/src/app/pages/client/home/Home.tsx index 38022a2e6..8b520e5c2 100644 --- a/src/app/pages/client/home/Home.tsx +++ b/src/app/pages/client/home/Home.tsx @@ -213,16 +213,20 @@ export function Home() { const [roomSidebarWidth, setRoomSidebarWidth] = useSetting(settingsAtom, 'roomSidebarWidth'); const [curWidth, setCurWidth] = useState(roomSidebarWidth); - - const [showRoomIcon] = useSetting(settingsAtom, 'showRoomIcon'); - const showIcons = () => { - if (showRoomIcon === ShowRoomIcon.Always) return true; - if (showRoomIcon === ShowRoomIcon.Never) return false; - return curWidth < 96; - }; useEffect(() => { setCurWidth(roomSidebarWidth); }, [roomSidebarWidth]); + + const [showRoomIconGeneral] = useSetting(settingsAtom, 'showRoomIcon'); + const [showRoomIconArray] = useSetting(settingsAtom, 'perRoomShowRoomIcon'); + const showRoomIcon = + showRoomIconArray.find((item) => item.roomId === 'Home')?.display ?? showRoomIconGeneral; + const showIcons = () => { + if (showRoomIcon === ShowRoomIcon.Always) return true; + if (showRoomIcon === ShowRoomIcon.Never) return false; + return curWidth < 144; + }; + const [joinCallOnSingleClick] = useSetting(settingsAtom, 'joinCallOnSingleClick'); const selectedRoomId = useSelectedRoom(); diff --git a/src/app/pages/client/sidebar/SidebarResizer.css.ts b/src/app/pages/client/sidebar/SidebarResizer.css.ts index b37504b98..5acd9d4b9 100644 --- a/src/app/pages/client/sidebar/SidebarResizer.css.ts +++ b/src/app/pages/client/sidebar/SidebarResizer.css.ts @@ -1,5 +1,6 @@ import { style } from '@vanilla-extract/css'; -import { color } from 'folds'; +import { recipe } from '@vanilla-extract/recipes'; +import { color, toRem } from 'folds'; /** Out-of-flow so flex siblings (e.g. PageRoot vertical Line) stay flush with the panel edge. */ export const SidebarResizerDockRight = style({ @@ -29,17 +30,33 @@ export const SidebarResizerDockTop = style({ cursor: 'ns-resize', }); -export const SidebarResizer = style({ - backgroundColor: 'inherit', - transition: '0.2s', - ':hover': {}, +export const SidebarResizer = recipe({ + base: { + backgroundColor: 'inherit', + transition: '0.2s', + ':hover': {}, + touchAction: 'none', + }, + variants: { + topSided: { + true: { + width: '100%', + height: toRem(8), + }, + false: { + width: toRem(4), + height: '100%', + }, + }, + }, }); export const SidebarResizerHover = style({ - zIndex: 100, + zIndex: 110, }); export const SideBarResizerAnimation = style({ width: '100%', height: '100%', backgroundColor: color.Surface.ContainerLine, transition: '0.5s', + touchAction: 'none', }); diff --git a/src/app/pages/client/sidebar/SidebarResizer.tsx b/src/app/pages/client/sidebar/SidebarResizer.tsx index 6b7d0144c..b54d258f0 100644 --- a/src/app/pages/client/sidebar/SidebarResizer.tsx +++ b/src/app/pages/client/sidebar/SidebarResizer.tsx @@ -1,6 +1,6 @@ // The disable is because the position should only update whenever the new one is updated // oxlint-disable eslint-plugin-react-hooks/exhaustive-deps -import { Box, toRem } from 'folds'; +import { Box } from 'folds'; import * as css from '$pages/client/sidebar/SidebarResizer.css'; import type { Dispatch, SetStateAction } from 'react'; import React, { useCallback, useEffect, useState } from 'react'; @@ -64,6 +64,7 @@ export function SidebarResizer({ const onPointerDown = useCallback( (e: React.PointerEvent) => { e.preventDefault(); + e.currentTarget.setPointerCapture(e.pointerId); setOldPos(topSided ? e.clientY : e.clientX); setIsPointerDown(true); window.addEventListener('pointerup', onPointerUp); @@ -80,14 +81,10 @@ export function SidebarResizer({ return ( setIsPointerOver(true)} onPointerLeave={() => setIsPointerOver(false)} onPointerDown={onPointerDown} - style={{ - width: topSided ? '100%' : toRem(4), - height: topSided ? toRem(4) : '100%', - }} shrink="No" > item.roomId === space.roomId )?.display ?? showRoomIconGeneral; + // oxlint-disable-next-line no-console + console.log(showRoomIconArray, space.roomId); const showIcons = () => { if (showRoomIcon === ShowRoomIcon.Always) return true; if (showRoomIcon === ShowRoomIcon.Never) return false;