mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-12 06:06:10 +00:00
feat(shell): run the docked strips the full height and make them the only fold
The docked panels' strips now run from the top edge of the window to the bottom, and the top bar ends left of them. The panel header no longer carries a fold button in docked mode: the strip opens and closes the day and, on /coach, the conversations; opening moves focus to the panel's heading and closing returns it to the strip. The sheets keep a close button, the day's now an X at the end of its header. The command palette's door is a magnifier at every width, named Search, with the shortcut in its tooltip. g p opens or closes the day like a click on its strip, and below the docking width opens the sheet on the last day or closes it; the shortcuts list shows it under Day.
This commit is contained in:
1 parent
023115b05c
commit
39fc4e4da2
26 files changed
+561
-229
No files matched your search
@@ -17,47 +17,23 @@ import { openCommandPalette, preloadCommandPalette } from "./palette-store";
|
||||
|
||||
/**
|
||||
* The way into the command palette, at the trailing end of the top bar on
|
||||
* every signed-in page. Where the bar has room it looks like a search field
|
||||
* ("Search…" and the key that opens it); where it has not (a phone, or a
|
||||
* desktop bar narrowed by the sidebar and a docked panel) it is a magnifier
|
||||
* with a tooltip. The switch reads the bar's own width (`@container/topbar`
|
||||
* on the header), not the window's, because a docked panel takes the room
|
||||
* without the window changing.
|
||||
* every signed-in page: a magnifier at every width, named "Search", with a
|
||||
* tooltip that gives the key that opens it as well ("Search (⌘K)", or
|
||||
* "Search (Ctrl K)" off Apple platforms). 44 px under a coarse pointer, 36 px
|
||||
* beside a fine one. Docked panels' strips stand right of the top bar, so the
|
||||
* magnifier always sits just left of them and nothing covers it.
|
||||
*/
|
||||
export function CommandPaletteTrigger() {
|
||||
const { t } = useTranslations();
|
||||
// The key hint depends on the platform, which the server cannot know.
|
||||
const mounted = useMounted();
|
||||
const apple = mounted && isApplePlatform();
|
||||
const label = t("palette.openLabel");
|
||||
const label = t("palette.title");
|
||||
const keyHint = apple ? "⌘K" : "Ctrl K";
|
||||
const shortcut = apple ? "Meta+K" : "Control+K";
|
||||
|
||||
return (
|
||||
<div className="ml-auto flex shrink-0 items-center">
|
||||
<button
|
||||
type="button"
|
||||
data-slot="command-palette-trigger"
|
||||
data-variant="field"
|
||||
aria-label={label}
|
||||
aria-keyshortcuts={mounted ? shortcut : undefined}
|
||||
aria-haspopup="dialog"
|
||||
onClick={openCommandPalette}
|
||||
onPointerEnter={preloadCommandPalette}
|
||||
onFocus={preloadCommandPalette}
|
||||
className="border-border bg-background text-muted-foreground hover:text-foreground hover:bg-accent focus-visible:ring-ring/50 hidden h-9 w-56 items-center gap-2 rounded-md border px-3 text-sm transition-colors outline-none focus-visible:ring-[3px] @2xl/topbar:flex"
|
||||
>
|
||||
<Search className="size-4 shrink-0" aria-hidden="true" />
|
||||
<span className="flex-1 truncate text-left">{t("palette.open")}</span>
|
||||
{mounted ? (
|
||||
<kbd
|
||||
aria-hidden="true"
|
||||
className="border-border bg-muted text-foreground rounded border px-1.5 font-mono text-xs"
|
||||
>
|
||||
{keyHint}
|
||||
</kbd>
|
||||
) : null}
|
||||
</button>
|
||||
<TooltipProvider delayDuration={300}>
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
@@ -66,19 +42,20 @@ export function CommandPaletteTrigger() {
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
data-slot="command-palette-trigger"
|
||||
data-variant="icon"
|
||||
aria-label={label}
|
||||
aria-keyshortcuts={mounted ? shortcut : undefined}
|
||||
aria-haspopup="dialog"
|
||||
onClick={openCommandPalette}
|
||||
onPointerEnter={preloadCommandPalette}
|
||||
onFocus={preloadCommandPalette}
|
||||
className="text-muted-foreground hover:text-foreground min-h-11 min-w-11 @2xl/topbar:hidden"
|
||||
className="text-muted-foreground hover:text-foreground size-11 pointer-fine:size-9"
|
||||
>
|
||||
<Search className="size-5" aria-hidden="true" />
|
||||
</Button>
|
||||
</TooltipTrigger>
|
||||
<TooltipContent side="bottom">{label}</TooltipContent>
|
||||
<TooltipContent side="bottom" data-slot="command-palette-tooltip">
|
||||
{mounted ? `${label} (${keyHint})` : label}
|
||||
</TooltipContent>
|
||||
</Tooltip>
|
||||
</TooltipProvider>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user