mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-16 15:23:29 +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
@@ -15,7 +15,7 @@ import { DOCK_SLIDE, DockStrip } from "../shell-dock";
|
||||
* The docked panels' strips (v1.42). Each docked panel keeps its own strip
|
||||
* at the right edge; the strip is a toggle for its panel, never moves, and
|
||||
* below 1600 px only one panel is open. The click paths, focus and the
|
||||
* geometry run in `e2e/dock-strips.spec.ts`.
|
||||
* geometry run in `e2e/day-view.spec.ts` and `e2e/coach-layout.spec.ts`.
|
||||
*/
|
||||
function strip(expanded: boolean) {
|
||||
return renderToStaticMarkup(
|
||||
@@ -56,14 +56,14 @@ describe("DockStrip", () => {
|
||||
expect(html).toContain('aria-label="Hide day"');
|
||||
});
|
||||
|
||||
it("keeps the same shape open and closed, below the top bar's band", () => {
|
||||
it("keeps the same shape open and closed, the full height of the window", () => {
|
||||
const shape = (html: string) => html.match(/^<div[^>]*class="([^"]*)"/)![1];
|
||||
expect(shape(strip(true))).toBe(shape(strip(false)));
|
||||
expect(shape(strip(false))).toContain("w-10");
|
||||
// The first cell is the band (`SHELL_HEADER_BAND`), empty and hidden.
|
||||
expect(strip(false)).toMatch(
|
||||
/^<div[^>]*><div aria-hidden="true" class="h-16 border-b/,
|
||||
);
|
||||
expect(shape(strip(false))).toContain("h-full");
|
||||
// The button is the strip's first and only cell: no band above it.
|
||||
expect(strip(false)).toMatch(/^<div[^>]*><button/);
|
||||
expect(strip(false)).not.toContain("h-16");
|
||||
});
|
||||
|
||||
it("orders the strips like their panels: conversations, then the day", () => {
|
||||
|
||||
@@ -9,7 +9,11 @@ import {
|
||||
useSyncExternalStore,
|
||||
} from "react";
|
||||
|
||||
import { stepDay, useOpenDay } from "@/components/day/day-layer-controller";
|
||||
import {
|
||||
stepDay,
|
||||
toggleDay,
|
||||
useOpenDay,
|
||||
} from "@/components/day/day-layer-controller";
|
||||
import { useTodayKey } from "@/components/day/use-today-key";
|
||||
import {
|
||||
CAPTURE_KIND_ORDER,
|
||||
@@ -38,8 +42,8 @@ import {
|
||||
* (never on the sign-in pages or in the setup flow, which the shell renders
|
||||
* without it).
|
||||
*
|
||||
* `g` + a key opens a page, `n` the add menu, `[` / `]` step the open day,
|
||||
* `?` the list of all of them. Which key does what, and when a key is not
|
||||
* `g` + a key opens a page, `g p` opens or closes the day, `n` the add menu,
|
||||
* `[` / `]` step the open day, `?` the list of all of them. Which key does what, and when a key is not
|
||||
* ours, is decided in `src/lib/keyboard/global-shortcuts.ts`; this component
|
||||
* reads the page's state and carries the action out. A destination comes from
|
||||
* the same lists the navigation renders, so `g t` with the timeline module
|
||||
@@ -196,6 +200,9 @@ export function GlobalShortcuts() {
|
||||
stepDay(date, action.delta);
|
||||
return;
|
||||
}
|
||||
case "day-toggle":
|
||||
if (toggleDay()) event.preventDefault();
|
||||
return;
|
||||
}
|
||||
};
|
||||
document.addEventListener("keydown", onKeyDown);
|
||||
|
||||
@@ -92,6 +92,7 @@ export function KeyboardShortcutsDialog({
|
||||
];
|
||||
|
||||
const day: Row[] = [
|
||||
{ id: "day-toggle", label: t("shortcuts.toggleDay"), sequence: ["g", "p"] },
|
||||
{ id: "day-previous", label: t("shortcuts.previousDay"), sequence: ["["] },
|
||||
{ id: "day-next", label: t("shortcuts.nextDay"), sequence: ["]"] },
|
||||
];
|
||||
|
||||
@@ -5,7 +5,6 @@ import type { LucideIcon } from "lucide-react";
|
||||
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
import { SHELL_HEADER_BAND } from "./shell-metrics";
|
||||
import { createShellSlot } from "./shell-slot";
|
||||
|
||||
/**
|
||||
@@ -17,9 +16,12 @@ import { createShellSlot } from "./shell-slot";
|
||||
* panels: conversations (`order-1`), then the day (`order-2`). A panel opens
|
||||
* to the left of the strips; the strips never move or change shape.
|
||||
*
|
||||
* Each strip starts below the top bar's band. The band above them is empty
|
||||
* and draws the top bar's bottom line on through, so nothing in the strips
|
||||
* meets the command palette at the end of the top bar.
|
||||
* Each strip runs the full height of the shell row, from the top of the
|
||||
* window to the bottom. The strip column sits beside the content column, so
|
||||
* the top bar (and the command palette's magnifier at its trailing end) ends
|
||||
* at the strips' left edge and nothing in a strip can cover it. Docked, the
|
||||
* strip is the panel's only open and close control: the panel's header
|
||||
* carries no fold button of its own.
|
||||
*/
|
||||
const strips = createShellSlot("shell-strips");
|
||||
|
||||
@@ -89,9 +91,9 @@ export interface DockStripProps {
|
||||
}
|
||||
|
||||
/**
|
||||
* One strip: an empty cell of the top bar's band, then a button the rest of
|
||||
* the window's height that opens and closes its panel. The label reads
|
||||
* top to bottom; the strip is marked while its panel is open.
|
||||
* One strip: a button the full height of the window that opens and closes
|
||||
* its panel. The label reads top to bottom; the strip is marked while its
|
||||
* panel is open.
|
||||
*/
|
||||
export function DockStrip({
|
||||
ref,
|
||||
@@ -116,10 +118,6 @@ export function DockStrip({
|
||||
order === 1 ? "order-1" : "order-2",
|
||||
)}
|
||||
>
|
||||
<div
|
||||
aria-hidden="true"
|
||||
className={cn(SHELL_HEADER_BAND, "border-sidebar-border shrink-0")}
|
||||
/>
|
||||
<button
|
||||
ref={ref}
|
||||
type="button"
|
||||
|
||||
@@ -90,9 +90,7 @@ export function TopBar() {
|
||||
// sidebar logo band reads too, so the two borders draw one
|
||||
// continuous line. Never restate a height here.
|
||||
className={cn(
|
||||
// `@container/topbar`: the search control sizes to the bar's own
|
||||
// width, which a docked side panel narrows without the window moving.
|
||||
"bg-card/80 border-border @container/topbar sticky top-0 z-40 flex items-center justify-between px-4 backdrop-blur-md md:px-6",
|
||||
"bg-card/80 border-border sticky top-0 z-40 flex items-center justify-between px-4 backdrop-blur-md md:px-6",
|
||||
SHELL_HEADER_BAND,
|
||||
)}
|
||||
// The status-bar inset of the installed app is the shell's
|
||||
@@ -114,8 +112,8 @@ export function TopBar() {
|
||||
<TopBarContextOutlet className="shell-desktop:flex hidden min-w-0 flex-1 items-center" />
|
||||
|
||||
{/* v1.42 — the command palette's door, on every signed-in page: a
|
||||
search-field button where the bar has room, a magnifier where it
|
||||
has not (and on a phone). `ml-auto` keeps it at the trailing end. */}
|
||||
magnifier at every width. `ml-auto` keeps it at the trailing end,
|
||||
just left of any docked panel's strip. */}
|
||||
<CommandPaletteTrigger />
|
||||
|
||||
{/* Page-owned actions (the Coach's conversations toggle). `ml-auto`
|
||||
|
||||
Reference in new issue
Block a user