+ {/* Command Palette Footer — keyboard-only guidance, so it is hidden on
+ phones where there are no arrow, enter or escape keys to press. */}
+
{t("command.shortcutHint")}
↑↓
diff --git a/src/components/layout/mobile-nav-sheet.tsx b/src/components/layout/mobile-nav-sheet.tsx
index 7b8347c..813a2f6 100644
--- a/src/components/layout/mobile-nav-sheet.tsx
+++ b/src/components/layout/mobile-nav-sheet.tsx
@@ -1,4 +1,4 @@
-import { For, Show } from "solid-js";
+import { For, Show, createSignal } from "solid-js";
import { Link, useRouterState } from "@tanstack/solid-router";
import { routeNavItem, sidebarNavGroups, type NavItem } from "@/components/layout/nav-items";
import { SidebarAccount } from "@/components/layout/sidebar-account";
@@ -15,7 +15,13 @@ import { useT } from "@/stores/preferences-context";
* It stays mounted and is moved off-screen when closed, so opening and closing
* both animate; a `
` around it would make it appear and disappear in one
* frame.
+ *
+ * It closes by tapping the X, tapping outside, or dragging it down past
+ * DISMISS_PX — the gesture people expect from a sheet.
*/
+
+/** How far the sheet has to be pulled down before letting go dismisses it. */
+const DISMISS_PX = 96;
export function MobileNavSheet(props: {
open: boolean;
onClose: () => void;
@@ -32,6 +38,34 @@ export function MobileNavSheet(props: {
const current = () => routeNavItem(pathname(), auth.user()?.role);
const badgeFor = (item: NavItem) => (item.id === "messages" ? feed.unreadMessages().total : 0);
+ // Drag-to-dismiss. Only the grab area drives it, so a flick inside the list
+ // still scrolls the list. While dragging, the sheet follows the finger with
+ // its transition off; on release it either closes or springs back.
+ const [dragY, setDragY] = createSignal(0);
+ const [dragging, setDragging] = createSignal(false);
+ let startY = 0;
+
+ const startDrag = (event: PointerEvent) => {
+ if (event.pointerType === "mouse" && event.button !== 0) return;
+ startY = event.clientY;
+ setDragging(true);
+ (event.currentTarget as HTMLElement).setPointerCapture(event.pointerId);
+ };
+
+ const moveDrag = (event: PointerEvent) => {
+ if (!dragging()) return;
+ // Downward only: dragging up must not lift the sheet past its own top.
+ setDragY(Math.max(0, event.clientY - startY));
+ };
+
+ const endDrag = () => {
+ if (!dragging()) return;
+ const travelled = dragY();
+ setDragging(false);
+ setDragY(0);
+ if (travelled > DISMISS_PX) props.onClose();
+ };
+
return (
- {/* Grab handle: the affordance that says this panel is draggable-looking
- and dismissible, even though dismissal is by tap. */}
+ {/* The grab area: handle plus title row. touch-none keeps the browser
+ from claiming the vertical gesture for scrolling. */}
+
@@ -75,6 +117,7 @@ export function MobileNavSheet(props: {
+