Skip to content

A one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!

fix: preserve browser shortcuts and locale clock display

Amruth Pillai912a562249dc
diff --git a/apps/mobile/scripts/display-time.test.mjs b/apps/mobile/scripts/display-time.test.mjs
new file mode 100644
index 000000000..2bb5f37c3
--- /dev/null
+++ b/apps/mobile/scripts/display-time.test.mjs
@@ -0,0 +1,63 @@
+import assert from "node:assert/strict";
+import { readFileSync } from "node:fs";
+import { createRequire } from "node:module";
+const root = new URL("../../../", import.meta.url);
+const require = createRequire(new URL("apps/server/package.json", root));
+const { transformSync } = createRequire(require.resolve("tsx"))("esbuild");
+let locale = "en-US";
+let zone = "UTC";
+const mocks = {
+ "@lingui/core": { i18n: {} },
+ "@lingui/core/macro": { t: () => "", ph: (x) => x },
+ "@lingui/react/macro": { useLingui: () => ({ i18n: { locale } }) },
+ "@tanstack/react-query": {},
+ "expo-file-system": {},
+ react: {},
+ "@reactive-resume/schema/applications/follow-up": {},
+ "@/api/client": {},
+ "@/auth/session": {},
+ "@/features/applications/queries": {},
+ "@/features/reminders": {
+ deviceTimeZone: () => "UTC",
+ isTimeZone: (z) => {
+ try {
+ new Intl.DateTimeFormat("en-US", { timeZone: z });
+ return true;
+ } catch {
+ return false;
+ }
+ },
+ },
+ "@/features/settings/queries": { useProfile: () => ({ data: { timezone: zone } }) },
+};
+const module = { exports: {} };
+const source = readFileSync(new URL("apps/mobile/src/features/application-detail/hooks.ts", root), "utf8");
+const code = transformSync(source, { loader: "ts", format: "cjs" }).code;
+new Function("require", "module", "exports", code)(
+ (name) => {
+ assert.ok(name in mocks, "missing boundary " + name);
+ return mocks[name];
+ },
+ module,
+ module.exports,
+);
+const results = [];
+for (const [l, z] of [
+ ["en-US", "UTC"],
+ ["de-DE", "UTC"],
+ ["en-US", "Europe/Berlin"],
+]) {
+ locale = l;
+ zone = z;
+ const instant = new Date("2026-11-04T13:05:00Z");
+ const actual = module.exports.useUserTime().time(instant);
+ const expected = new Intl.DateTimeFormat(locale, { timeZone: zone, hour: "2-digit", minute: "2-digit" }).format(
+ instant,
+ );
+ results.push({ locale, zone, actual, expected, pass: actual === expected });
+}
+assert.deepEqual(
+ results.map(({ pass }) => pass),
+ [true, true, true],
+ JSON.stringify(results),
+);
diff --git a/apps/mobile/src/features/application-detail/hooks.ts b/apps/mobile/src/features/application-detail/hooks.ts
index a6d716419..65db0b2ed 100644
--- a/apps/mobile/src/features/application-detail/hooks.ts
+++ b/apps/mobile/src/features/application-detail/hooks.ts
@@ -129,8 +129,7 @@ export function useUserTime() {
const timeZone = preferred && isTimeZone(preferred) ? preferred : deviceTimeZone();
const format = (value: Date | string, options: Intl.DateTimeFormatOptions, zone = timeZone) =>
new Intl.DateTimeFormat(i18n.locale, { timeZone: zone, ...options }).format(new Date(value));
- const time = (value: Date | string, zone?: string) =>
- format(value, { hour: "2-digit", minute: "2-digit", hourCycle: "h23" }, zone);
+ const time = (value: Date | string, zone?: string) => format(value, { hour: "2-digit", minute: "2-digit" }, zone);
const day = (value: Date | string, zone?: string) =>
format(value, { weekday: "short", day: "numeric", month: "short" }, zone);
return {
diff --git a/apps/web/src/features/assistant/assistant-button.tsx b/apps/web/src/features/assistant/assistant-button.tsx
index 945fc67b0..310e12990 100644
--- a/apps/web/src/features/assistant/assistant-button.tsx
+++ b/apps/web/src/features/assistant/assistant-button.tsx
@@ -2,10 +2,12 @@ import { t } from "@lingui/core/macro";
import { IconButton } from "@reactive-resume/ui/components/icon-button";
import { cn } from "@reactive-resume/utils/style";
import { loadAssistantPanel } from "./dock";
+import { useAssistantShortcutEnabled } from "./shortcut";
import { useEditorStore } from "@/features/resume/editor/store";
/** The ✦ in the editor bar: opens and closes the assistant (⌘J), accent-soft while it's open. */
export function AssistantButton() {
+ const shortcutEnabled = useAssistantShortcutEnabled();
const open = useEditorStore((state) => state.assistantOpen);
const setOpen = useEditorStore((state) => state.setAssistantOpen);
@@ -13,7 +15,7 @@ export function AssistantButton() {
<IconButton
icon="sparkle"
label={t`Assistant`}
- shortcut="⌘J"
+ shortcut={shortcutEnabled ? "⌘J" : ""}
aria-pressed={open}
data-assistant-toggle=""
className={cn("text-ink-2", open && "bg-accent-soft text-accent-text hover:bg-accent-soft")}
diff --git a/apps/web/src/features/assistant/shortcut.ts b/apps/web/src/features/assistant/shortcut.ts
new file mode 100644
index 000000000..9485c3723
--- /dev/null
+++ b/apps/web/src/features/assistant/shortcut.ts
@@ -0,0 +1,8 @@
+import { isApple } from "@reactive-resume/ui/components/kbd";
+import { useEditorStore } from "@/features/resume/editor/store";
+
+export function useAssistantShortcutEnabled() {
+ const open = useEditorStore((state) => state.assistantOpen);
+ // Ctrl+J belongs to browser Downloads while the assistant is closed.
+ return isApple() || open;
+}
diff --git a/apps/web/src/routes/builder/$resumeId/-components/use-editor-hotkeys.ts b/apps/web/src/routes/builder/$resumeId/-components/use-editor-hotkeys.ts
index 1cd13a1df..d9e54d9dd 100644
--- a/apps/web/src/routes/builder/$resumeId/-components/use-editor-hotkeys.ts
+++ b/apps/web/src/routes/builder/$resumeId/-components/use-editor-hotkeys.ts
@@ -2,6 +2,7 @@ import type { EditorMode } from "@/features/resume/editor/store";
import { useLingui } from "@lingui/react/macro";
import { useHotkey } from "@tanstack/react-hotkeys";
import { toast } from "@reactive-resume/ui/components/toast";
+import { useAssistantShortcutEnabled } from "@/features/assistant/shortcut";
import { useShortcutSettings } from "@/features/keyboard-shortcuts/settings";
import { isEditableElementFocused, useCurrentResume, useResumeStore } from "@/features/resume/builder/draft";
import { useEditorStore } from "@/features/resume/editor/store";
@@ -15,6 +16,7 @@ import { switchModeInstantly } from "@/libs/motion";
*/
export function useEditorHotkeys(setMode: (mode: EditorMode) => void) {
const { t } = useLingui();
+ const assistantShortcutEnabled = useAssistantShortcutEnabled();
const hasSelection = useEditorStore((state) => Boolean(state.selection));
const characterShortcuts = useShortcutSettings((state) => state.characterShortcuts);
const undo = useResumeStore((state) => state.undo);
@@ -82,7 +84,7 @@ export function useEditorHotkeys(setMode: (mode: EditorMode) => void) {
const { assistantOpen, setAssistantOpen } = useEditorStore.getState();
setAssistantOpen(!assistantOpen, true);
},
- { meta: { name: t`Assistant` } },
+ { enabled: assistantShortcutEnabled, meta: { name: t`Assistant` } },
);
useHotkey(
"Escape",
diff --git a/apps/web/src/routes/builder/letter/-components/letter-shell.tsx b/apps/web/src/routes/builder/letter/-components/letter-shell.tsx
index 6bb653a1a..a1b8725a4 100644
--- a/apps/web/src/routes/builder/letter/-components/letter-shell.tsx
+++ b/apps/web/src/routes/builder/letter/-components/letter-shell.tsx
@@ -14,6 +14,7 @@ import { LetterBar, useDownloadLetter } from "./letter-bar";
import { LetterPage } from "./letter-page";
import { LetterWritePanel } from "./write-panel";
import { LetterAssistant } from "@/features/assistant/dock";
+import { useAssistantShortcutEnabled } from "@/features/assistant/shortcut";
import { useMarkDocumentOpened } from "@/features/documents/new-documents";
import { useShortcutSettings } from "@/features/keyboard-shortcuts/settings";
import { useLetterEditorStore } from "@/features/letters/store";
@@ -119,6 +120,7 @@ function MobileBody({ mode, onModeChange }: MobileBodyProps) {
/** 1 and 2 switch modes outside fields, ⌘P downloads the PDF, ⌘⇧E opens Download. Saving is automatic. */
function LetterHotkeys({ onModeChange }: { onModeChange: (mode: LetterMode) => void }) {
+ const assistantShortcutEnabled = useAssistantShortcutEnabled();
const { t } = useLingui();
const characterShortcuts = useShortcutSettings((state) => state.characterShortcuts);
const download = useDownloadLetter();
@@ -135,6 +137,7 @@ function LetterHotkeys({ onModeChange }: { onModeChange: (mode: LetterMode) => v
useHotkey("Mod+P", () => void download.run(), { meta: { name: t`Download PDF` } });
useHotkey("Mod+Shift+E", () => setSheetTab("download"), { meta: { name: t`Download & history` } });
useHotkey("Mod+J", () => useEditorStore.getState().setAssistantOpen(!useEditorStore.getState().assistantOpen, true), {
+ enabled: assistantShortcutEnabled,
meta: { name: t`Assistant` },
});
useHotkey(
diff --git a/docs/guides/keyboard-shortcuts.mdx b/docs/guides/keyboard-shortcuts.mdx
index 53cfad898..aa68a06d7 100644
--- a/docs/guides/keyboard-shortcuts.mdx
+++ b/docs/guides/keyboard-shortcuts.mdx
@@ -7,6 +7,9 @@ This page lists the keyboard shortcuts in Reactive Resume, grouped by where they
On a Mac, use <kbd>⌘</kbd> (Command). On Windows and Linux, use <kbd>Ctrl</kbd> wherever this page shows <kbd>⌘</kbd>.
The shortcut help shows the keys for your platform.
+In the web editors on Windows and Linux, **Ctrl+J** keeps the browser’s Downloads command while the assistant is closed.
+Open **Assistant** with its button; **Ctrl+J** then closes it. On Mac, **⌘J** opens or closes it.
+The help list and button hint show the assistant shortcut only when it is available.
## See shortcuts for the current page
diff --git a/docs/guides/tracking-job-applications.mdx b/docs/guides/tracking-job-applications.mdx
index 09d76f158..041ee58e2 100644
--- a/docs/guides/tracking-job-applications.mdx
+++ b/docs/guides/tracking-job-applications.mdx
@@ -16,6 +16,9 @@ To open it, select **Applications** in the sidebar (on a phone, it's in the bott
/>
</Frame>
+Interview and activity times use your interface language’s 12- or 24-hour clock on web and native.
+Their timezone follows **Settings → Preferences**.
+
## How stages work
Every application sits in one stage. The first five stages form a pipeline you move through in order:
diff --git a/packages/ui/src/components/kbd.tsx b/packages/ui/src/components/kbd.tsx
index 347d897e3..e90a9e5bf 100644
--- a/packages/ui/src/components/kbd.tsx
+++ b/packages/ui/src/components/kbd.tsx
@@ -43,4 +43,4 @@ function ariaShortcut(shortcut: string, apple = isApple()): string {
return [...new Set(chars.filter((char) => char in names).map((char) => names[char] ?? ""))].concat(key).join("+");
}
-export { ariaShortcut, formatShortcut, Kbd };
+export { ariaShortcut, formatShortcut, isApple, Kbd };
diff --git a/tests/e2e/specs/browser-reserved-shortcuts.spec.ts b/tests/e2e/specs/browser-reserved-shortcuts.spec.ts
new file mode 100644
index 000000000..a547a3028
--- /dev/null
+++ b/tests/e2e/specs/browser-reserved-shortcuts.spec.ts
@@ -0,0 +1,56 @@
+import { expect, test } from "../fixtures/test";
+
+for (const platform of ["Win32", "Linux x86_64", "MacIntel"]) {
+ for (const kind of ["resume", "letter"]) {
+ test(`${platform} ${kind} assistant preserves browser Downloads and retains eligible toggle`, async ({
+ authPage: page,
+ }) => {
+ await page.addInitScript(
+ (platform) => Object.defineProperty(navigator, "platform", { configurable: true, get: () => platform }),
+ platform,
+ );
+ const created = await page.request.post(
+ kind === "resume" ? "/api/openapi/resumes" : "/api/openapi/cover-letters",
+ {
+ data:
+ kind === "resume" ? { name: "Fictional shortcut audit", tags: [] } : { name: "Fictional shortcut audit" },
+ },
+ );
+ await expect(created).toBeOK();
+ const document = await created.json();
+ await page.goto(kind === "resume" ? `/builder/${document}` : `/builder/letter/${document.id}`);
+ const toggle = page.locator("[data-assistant-toggle]");
+ await expect(toggle).toHaveAttribute("aria-pressed", "false");
+ await toggle.focus();
+ const key = platform === "MacIntel" ? "Meta+j" : "Control+j";
+ if (platform === "MacIntel") await page.keyboard.press(key);
+ else {
+ // Inspect default handling without opening Chromium’s external Downloads UI.
+ const prevented = await toggle.evaluate((element) => {
+ const event = new KeyboardEvent("keydown", {
+ key: "j",
+ code: "KeyJ",
+ ctrlKey: true,
+ bubbles: true,
+ cancelable: true,
+ });
+ element.dispatchEvent(event);
+ element.dispatchEvent(
+ new KeyboardEvent("keyup", { key: "j", code: "KeyJ", ctrlKey: true, bubbles: true, cancelable: true }),
+ );
+ return event.defaultPrevented;
+ });
+ expect(prevented).toBe(false);
+ }
+ if (platform !== "MacIntel") {
+ await expect(toggle).toHaveAttribute("aria-pressed", "false");
+
+ await toggle.click();
+ }
+ await expect(toggle).toHaveAttribute("aria-pressed", "true");
+ await toggle.focus();
+ await page.keyboard.press(key);
+ await expect(toggle).toHaveAttribute("aria-pressed", "false");
+ });
+ }
+}