fix(webui): prevent mobile sidebar tooltip and double-tap navigation

Integrate the focused Sheet autofocus and touch hover corrections from
#5777 and #5641 on current main. Preserve caller focus overrides, keyboard
accessibility, and the existing viewport/safe-area policy.

Add App-level coverage for consecutive one-click topic selections and
drawer dismissal alongside focus and emitted-CSS regressions.

Co-authored-by: Nikko Gonzales <nikkoxgonzales@gmail.com>
Co-authored-by: moran <moranfong@gmail.com>
This commit is contained in:
committed 2026-09-21 16:26:57 +08:00
1 parent d37d7c07c0
commit 13319dfe15
6 files changed
+265 -17

No files matched your search

+18 -1
View File
@@ -74,16 +74,33 @@ const SheetContent = React.forwardRef<
children,
closeButtonClassName,
showCloseButton = true,
onOpenAutoFocus,
...props
},
ref,
) => {
const { t } = useTranslation();
const contentNode = React.useRef<HTMLDivElement | null>(null);
const contentRef = React.useCallback(
(node: HTMLDivElement | null) => {
contentNode.current = node;
if (typeof ref === "function") ref(node);
else if (ref) ref.current = node;
},
[ref],
);
return (
<SheetPortal>
<SheetOverlay />
<DialogPrimitive.Content
ref={ref}
ref={contentRef}
onOpenAutoFocus={(event) => {
if (onOpenAutoFocus) onOpenAutoFocus(event);
else {
event.preventDefault();
contentNode.current?.focus({ preventScroll: true });
}
}}
className={cn(
sheetVariants({ side }),
"data-[state=open]:animate-in data-[state=closed]:animate-out",