- + add more · {formatForDisplay(addMoreHotkey).toLocaleLowerCase()}
+ + add more
+
- cancel · esc
+ cancel
+
void upload()}>
- upload {pendingCount()} {pendingCount() === 1 ? "image" : "images"} ·{" "}
- {formatForDisplay(uploadHotkey).toLocaleLowerCase()}
+ upload {pendingCount()} {pendingCount() === 1 ? "image" : "images"}
+
>
}
diff --git a/src/modules/organizations/components/CreateOrganizationForm.tsx b/src/modules/organizations/components/CreateOrganizationForm.tsx
index 96e2d7d..4b43c8a 100644
--- a/src/modules/organizations/components/CreateOrganizationForm.tsx
+++ b/src/modules/organizations/components/CreateOrganizationForm.tsx
@@ -1,5 +1,4 @@
import { FieldApi, FormApi } from "@tanstack/form-core";
-import { formatForDisplay } from "@tanstack/solid-hotkeys";
import { useNavigate } from "@tanstack/solid-router";
import { useServerFn } from "@tanstack/solid-start";
import * as v from "valibot";
@@ -10,6 +9,7 @@ import {
createFormSubmission,
SUBMIT_HOTKEY,
} from "@/components/forms/FormControls";
+import { HotkeyHint } from "@/components/ui/HotkeyHint";
import { useField, useForm } from "@/lib/form";
import { createAndJoinOrganizationFn } from "../serverFunctions";
@@ -88,7 +88,8 @@ export function CreateOrganizationForm() {
/>
- create · {formatForDisplay(SUBMIT_HOTKEY).toLocaleLowerCase()}
+ create
+
diff --git a/src/routes/__root.tsx b/src/routes/__root.tsx
index 5ffe384..a0f5d6c 100644
--- a/src/routes/__root.tsx
+++ b/src/routes/__root.tsx
@@ -1,20 +1,35 @@
import { HydrationScript } from "@solidjs/web";
import { TanStackDevtools } from "@tanstack/solid-devtools";
+import { detectPlatform, HotkeysProvider } from "@tanstack/solid-hotkeys";
import { hotkeysDevtoolsPlugin } from "@tanstack/solid-hotkeys-devtools";
import { HeadContent, Outlet, Scripts, createRootRouteWithContext } from "@tanstack/solid-router";
import { TanStackRouterDevtools } from "@tanstack/solid-router-devtools";
+import { createIsomorphicFn } from "@tanstack/solid-start";
+import { getRequestHeader } from "@tanstack/solid-start/server";
import { Loading } from "solid-js";
import styleCss from "../styles.css?url";
+// The server reads the request's user agent so hotkey labels hydrate without changing.
+const getHotkeyPlatform = createIsomorphicFn()
+ .server(() => detectPlatform(getRequestHeader("User-Agent") ?? ""))
+ .client(() => detectPlatform());
+
export const Route = createRootRouteWithContext()({
head: () => ({
+ meta: [
+ { charSet: "utf-8" },
+ { name: "viewport", content: "width=device-width, initial-scale=1" },
+ ],
links: [{ rel: "stylesheet", href: styleCss }],
}),
+ loader: () => ({ hotkeyPlatform: getHotkeyPlatform() }),
+ staleTime: Infinity,
shellComponent: RootComponent,
});
function RootComponent() {
+ const data = Route.useLoaderData();
return (
@@ -22,11 +37,13 @@ function RootComponent() {
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/src/routes/_app.tsx b/src/routes/_app.tsx
index 04cfb0d..de08f69 100644
--- a/src/routes/_app.tsx
+++ b/src/routes/_app.tsx
@@ -24,7 +24,7 @@ function RouteComponent() {
return (
diff --git a/src/routes/_app/$orgSlug.tsx b/src/routes/_app/$orgSlug.tsx
index b08a37b..51543d7 100644
--- a/src/routes/_app/$orgSlug.tsx
+++ b/src/routes/_app/$orgSlug.tsx
@@ -1,7 +1,8 @@
-import { createHotkey, formatForDisplay, type HotkeySequence } from "@tanstack/solid-hotkeys";
+import { createHotkey, type HotkeySequence } from "@tanstack/solid-hotkeys";
import { createFileRoute, Outlet, redirect } from "@tanstack/solid-router";
import { ButtonLink } from "@/components/ui/ButtonLink";
+import { HotkeyHint } from "@/components/ui/HotkeyHint";
import { createElementHeight } from "@/lib/createElementHeight";
import { getOrganizationFn } from "@/modules/organizations/serverFunctions";
@@ -42,13 +43,13 @@ function RouteComponent() {
return (
{context().organization.name}
- home · {formatForDisplay(homeHotkeySequence).toLocaleLowerCase()}
+ home
+
- remove background ·{" "}
- {formatForDisplay(removeBackgroundHotkeySequence).toLocaleLowerCase()}
+ remove background
+
- invites · {formatForDisplay(invitesHotkeySequence).toLocaleLowerCase()}
+ invites
+
diff --git a/src/routes/_app/_user/create-organization.tsx b/src/routes/_app/_user/create-organization.tsx
index 272eca3..08357c6 100644
--- a/src/routes/_app/_user/create-organization.tsx
+++ b/src/routes/_app/_user/create-organization.tsx
@@ -8,7 +8,7 @@ export const Route = createFileRoute("/_app/_user/create-organization")({
function RouteComponent() {
return (
-
+
);
diff --git a/src/routes/_app/_user/index.tsx b/src/routes/_app/_user/index.tsx
index 005da9f..3e3efcd 100644
--- a/src/routes/_app/_user/index.tsx
+++ b/src/routes/_app/_user/index.tsx
@@ -1,13 +1,13 @@
import {
createHotkeys,
DEFAULT_SEQUENCE_TIMEOUT,
- formatForDisplay,
type HotkeySequence,
} from "@tanstack/solid-hotkeys";
import { createFileRoute } from "@tanstack/solid-router";
import { createMemo, For, onCleanup, Show } from "solid-js";
import { ButtonLink } from "@/components/ui/ButtonLink";
+import { HotkeyHint } from "@/components/ui/HotkeyHint";
import { listOrganizationsFn } from "@/modules/organizations/serverFunctions";
export const Route = createFileRoute("/_app/_user/")({
@@ -54,7 +54,8 @@ function RouteComponent() {
Choose where you want to work.
- create organization · o c
+ create organization
+
@@ -69,7 +70,8 @@ function RouteComponent() {
- create organization · o c
+ create organization
+
}
@@ -83,7 +85,8 @@ function RouteComponent() {
/{organization.slug}
)}
diff --git a/src/routes/_auth/invite/accept.tsx b/src/routes/_auth/invite/accept.tsx
index f321c10..1c01241 100644
--- a/src/routes/_auth/invite/accept.tsx
+++ b/src/routes/_auth/invite/accept.tsx
@@ -12,7 +12,7 @@ export const Route = createFileRoute("/_auth/invite/accept")({ component: Invite
function InvitePage() {
return (
-