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!
TypeScript agent-skillsaidsh-pluginhacktoberfestjavascriptmcp-serverreactresume-builderself-hostedtypescript
fix: restore alias startup and mobile usability
Amruth Pillaid644b9963290
diff --git a/.agents/docs/mobile-foldable-ui-audit-2026-10-28.md b/.agents/docs/mobile-foldable-ui-audit-2026-10-28.mdnew file mode 100644index 000000000..78cc32580--- /dev/null+++ b/.agents/docs/mobile-foldable-ui-audit-2026-10-28.md@@ -0,0 +1,98 @@+# Native UI audit — 28 October 2026++Tested and repaired the React Native app on T3 Code's Pixel 10 Pro Fold emulator in folded and unfolded postures, with supplementary iPhone testing. The tablet editor now has compact mode pills, space between the title, modes and Download, and a separate centred mode row when enlarged text needs it. Concrete defects found in the exercised workflows were fixed and retested. This is simulator and local-source evidence, not a claim that every device, integration or rendering combination is perfect.++## Environment and evidence++| Target | Coverage |+| ----------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |+| Pixel 10 Pro Fold, Android 17 | Folded 1080 × 2364 px, approximately 443 dp wide; unfolded 2076 × 2152 px, approximately 852 dp wide; density 2.4375 |+| Postures | Closed/open transitions during editing and sheets; half-open and landscape inspected during the audit |+| Android typography/appearance | Font scales 1.0, 1.35 and 2.0; light/dark; selected German, Portuguese and Polish layouts |+| iPhone 18 Pro, iOS 27 | 402 pt viewport; real software keyboard; default and accessibility text, including scale 3.12 |+| App | Development native builds running the current local Metro source; production Hermes bundles exported separately for Android and iOS |+| Backend/data | Local backend on port 18400, disposable database `rr_fold_ui_20261028`, fictional documents and career/application data |++Screenshots, measured node trees, assertions, exports and check logs are in `/tmp/rr-fold-ui-20261028/`. `ledger.json` indexes results. These local artifacts are outside Git and are temporary. `01-folded-sign-in.png` shows the browser login page, not the native sign-in landing; native landing evidence is in 41/42 and the iOS captures.++Nine focused design reviews used Claude Opus 5.5 with Extra High effort through T3 Code Orchestrator V2. Reviews covered onboarding, editor/navigation, applications and responsive layouts, keyboard behavior, and final alignment. The ninth review confirmed the requested header spacing and toolbar alignment, and identified the final letter-card, Share inset and row accessibility refinements. The subsequent iPhone accessibility-text check caught and verified the company/stage wrapping refinement.++## Repairs++- **Authentication:** bounded the server form and footer to the existing panel width, made the sticky footer opaque, removed extra keyboard spacing, stacked footer actions at large text, and retained the configured host when changing servers.+- **Editor chrome:** removed Android's duplicate top inset in nested tablet headers; gave Saving/Saved a stable glyph box; removed the preview's extra bottom inset while the keyboard is visible.+- **Tablet/phablet header:** mode pills use their intrinsic width, with horizontal breathing room and a centred second row at large text. Download aligns vertically with Assistant and the title/status block. Phone navigation retains its compact layout.+- **Rich text:** put borders and focus rings on native wrapper views for resume, letter and note inputs; pinned Improve and enabled it on first focus of a nonempty line; kept Underline and Strikethrough available through Text style. Focused tools clear the gesture area with the software keyboard hidden, and align with the preview zoom bar.+- **Keyboard/scrolling:** shared `KeyboardFrame` and `useKeyboardScrollSpace` prevent duplicate keyboard padding inside resized viewports while preserving focus scrolling. Letter body focus scrolls into view. Actual animated keyboard height now drives visibility, fixing missing bottom navigation after Android text-size changes recreate the activity with stale keyboard-event caches.+- **Responsive content:** bounded application detail and Knowledge content; retained the full-width Facts list viewport for refresh gestures; grouped application Stage controls and omitted an empty What you sent card. The linked-application card in the letter editor reflows role, company, stage and Change at accessibility sizes.+- **Navigation/accessibility:** improved long/localized bottom-navigation labels, stacked appearance choices at large text, preserved library search across remounts, removed a forced grid remount, and removed duplicate calendar weekday announcements. Passive rows use a View so native switches remain reachable; informational rows retain grouped announcements. Full screen-reader traversal remains unverified.+- **Sharing/exports:** replaced an unregistered Share icon that crashed the screen, grouped Public link consistently with other settings, and encoded letter-export localization parameters using bracketed query keys, fixing non-PDF export requests that returned 400.+- **Application history:** metadata and bulk tag edits no longer mark newly linked draft documents as submitted. Explicit stage/link actions still record submission snapshots. This shared API fix benefits both web and native consumers.++No native dependencies, native source, permissions or app configuration were changed. No release, OTA publication, store submission, commit or push was performed.++## Executed workflows++“Passed” below describes the stated checks, not exhaustive coverage of the whole feature.++| Area | Result and evidence |+| ---------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |+| Authentication | Native browser sign-in, cancellation, retry, consent and local token return passed. Invalid/mismatched issuers were rejected. Final native server footer checked with keyboards/default and large text on Android/iOS (66–69). |+| Resume editing | Created a resume; edited basics, summary formatting, experience dates/present state, template, accent and font; confirmed persistence through API assertions and cold restart. Native selected-word underline/strikethrough persisted as HTML (`selected-format.json`). |+| Fold continuity | Drafts and current routes retained across closed/open changes in basics, summary, private notes, application/interview forms, letter body and workspace answer. Password sheet retained both masked fields and focus. Letter application selection sheet retained its selected application through a fold. |+| Offline recovery | Stopped the owned backend, edited and folded, cold-restarted before recovery, observed the local draft, resumed backend and verified retry synchronization (`offline-regression.json`, 43/44). This tests backend outage, not OS airplane mode. |+| Save feedback | Measured identical title and status origins in Saving/Saved states; only status text width changed (45/46 and `offline-regression.json`). |+| History | Saved named checkpoints, selected preview, restored a checkpoint and compared the complete ResumeData object (`history-restore-result.json`). |+| Applications | Created fictional applications, moved stage, linked resume/letter, checked submitted snapshots, edited notes, and saved a note draft after folding. An application without linked documents shows preparation actions without an empty sent card (62). Metadata/tag edits and explicit submission were checked separately (`submission-regression.json`). |+| Calendar | Previous/next month and This month worked; the selected interview agenda showed the expected Berlin time for the stored UTC event (25). |+| Cover letters | Created from an application, retained linked sender/design, typed/formatted body with live preview, and verified export share sheets. Final linked-application readability checked at Android 2.0 and iOS 3.12 text scales (82–84). |+| Career/workspace | Saved fact, story and salary/remote/notice preferences; rejected invalid salary; retained an Apply answer and emoji input across folds; retained selected Messages tab across posture changes. Facts refresh triggered from outside the bounded content column while the backend was paused, then recovered (75/76). |+| Check/AI setup | Local resume check reported 22/22; Job match and Writing review opened. Coach/Prepare/Writing review setup guards and Connect form were exercised; blank API key kept Save disabled. No live AI generation was run. |+| Sharing/privacy | Share opened without a crash. Publishing, QR sheet, password sheet and hide-contact controls worked. Protected public page returned 401 without resume content; hidden-contact page omitted email/phone. Original private/no-password/contact-visible settings restored; public endpoint then returned 404 (`share-privacy-validation.json`). |+| Library | Search remained visible and clearable after remount. A 24-resume stress fixture retained the same visible items through folding/unfolding (`anchor-validation.json`). Both measured postures used two columns; this is not proof of a column-count transition. |+| iPhone keyboard | Summary formatting/Improve/Done and return to bottom navigation passed with the real keyboard; profile and letter focus scrolling checked (34/35, 50, 74). |++The 24 extra stress resumes and the JSON re-import were moved to Trash using their owned fixture IDs. The active library returned to four fictional documents. No production data was used or deleted.++## Export evidence++All five native iPhone resume exports were recovered from the simulator and inspected. Expected fictional name and employer were present in every format. ZIP containers passed integrity checks, JSON parsed, and the PDF was one page with extractable text.++| Native iPhone file | Bytes | Inspection |+| ------------------ | -----: | ------------------------------------------------------- |+| PDF | 27,847 | One page; `pdfinfo` and `pdftotext` |+| DOCX | 10,557 | ZIP integrity and `word/document.xml` |+| JSON | 6,016 | Parse; full ResumeData equality after OpenAPI re-import |+| ODT | 3,025 | ZIP integrity and `content.xml` |+| Markdown | 469 | Expected text |++Android reached native share sheets for all five cover-letter formats and resume export/print surfaces; PDF preview survived unfolding. Authenticated local API exports for DOCX, ODT, Markdown and JSON returned 200 with expected content for both resume and letter. `export-validation.json` records the distinct native-file and API proofs. The JSON roundtrip used OpenAPI, not the native document picker (`json-roundtrip.json`).++## Source validation++| Check | Result |+| -------------------------------------------------------------------------------- | ------------------------------------------------------------ |+| `pnpm --filter mobile test` | 19 passed; 0 failed, skipped or cancelled |+| `pnpm --filter mobile typecheck` | Passed |+| Application service focused tests | 31 passed |+| API typecheck and server production build | Passed during the API repair; API source unchanged afterward |+| `pnpm lint:agent` | Passed on final tree |+| `pnpm format:check` | Passed on final tree |+| `pnpm exec turbo boundaries` | Passed |+| `git diff --check` | Passed |+| `EXPO_MOBILE_WEB_PREVIEW=0 pnpm --filter mobile exec expo export --platform all` | Android and iOS production Hermes bundles exported |++Meaningful regressions execute shipped components/client behavior: native inset/keyboard geometry, first-focus Improve and formatting actions, letter-export query encoding, stale keyboard-cache navigation, row accessibility semantics, and literal icon registration. Intended assertions were observed failing before their corresponding fixes. Device measurements supplement these boundary fixtures; they do not turn them into native end-to-end tests.++Representative final captures: 48/51/59/80 for editor header spacing, 66–69 for auth footer, 70 for navigation after activity recreation, 72 for aligned letter/preview bars, 74 for iPhone keyboard, 75/76 for Facts width/refresh, 78 for iPhone Share, and 82–84 for final large-text letter readability.++## Not verified++- Physical foldables, iPad, ordinary Android hardware/AVD, physical keyboard or hinge occlusion, haptics, and measured frame rate/performance.+- Full TalkBack/VoiceOver traversal. Native accessibility snapshots confirm control labels/states and the passive-row repair; iOS exposes some duplicate internal SwiftUI switch nodes.+- Live AI, voice, search-provider and offer generation, or production identity-provider accounts.+- OS airplane-mode/network switching and native document-picker import roundtrip.+- Every template/font, multipage/non-Latin export, RTL locale, or viewer application's rendering of DOCX/ODT.+- Signed release binaries, hosted CI, production deployment, OTA/runtime-fingerprint compatibility, or store/publication state.++Expo's floating development-menu gear appears in some screenshots and can overlap top-right chrome. It is development tooling, not a production UI element. Source checks and production bundling do not substitute for the unverified gates above.diff --git a/apps/mobile/app/(auth)/server.tsx b/apps/mobile/app/(auth)/server.tsxindex 5b541184e..7491f3248 100644--- a/apps/mobile/app/(auth)/server.tsx+++ b/apps/mobile/app/(auth)/server.tsx@@ -2,13 +2,13 @@ import type { ImperativeRouter } from "expo-router";import { useLingui } from "@lingui/react/macro";import { useRouter, Stack } from "expo-router";import { useEffect, useEffectEvent, useRef, useState } from "react";-import { ActivityIndicator, ScrollView, View } from "react-native";-import { KeyboardStickyView } from "react-native-keyboard-controller";+import { ActivityIndicator, View, useWindowDimensions } from "react-native";+import { KeyboardAwareScrollView, KeyboardStickyView } from "react-native-keyboard-controller";import { useSafeAreaInsets } from "react-native-safe-area-context";import { hostOf } from "@/auth/auth-header";import { serverErrorMessage } from "@/auth/messages";import { discover, isAllowedServer, ServerError, toOrigin } from "@/auth/oauth";-import { DEFAULT_SERVER, useSession } from "@/auth/session";+import { useSession } from "@/auth/session";import { routes } from "@/routes";import { Button, Screen, Text, TextField, useTheme } from "@/ui";@@ -26,12 +26,11 @@ const checkDelay = 600;export default function CustomServer() {const router = useRouter();const { t, i18n } = useLingui();- const { colors, space } = useTheme();+ const { colors, size, space } = useTheme();const insets = useSafeAreaInsets();+ const stacked = useWindowDimensions().fontScale > 1.3;const { server } = useSession();- const [address, setAddress] = useState(- server === DEFAULT_SERVER ? "" : server.startsWith("http:") ? server : hostOf(server),- );+ const [address, setAddress] = useState(server.startsWith("http:") ? server : hostOf(server));const [check, setCheck] = useState<Check>({ state: "idle" });const latest = useRef(0);@@ -71,9 +70,14 @@ export default function CustomServer() {const ready = check.state === "ok";return (- <Screen scroll={false} edges={["bottom"]}>+ <Screen+ scroll={false}+ edges={["bottom"]}+ contentStyle={{ width: "100%", maxWidth: size.panel, alignSelf: "center", paddingBottom: 0 }}+ ><Stack.Screen options={{ headerShown: true, title: t`Another server`, headerBackTitle: t`Back` }} />- <ScrollView+ <KeyboardAwareScrollView+ extraKeyboardSpace={-insets.bottom}style={{ flex: 1 }}contentInsetAdjustmentBehavior="automatic"contentContainerStyle={{ gap: space.s3 }}@@ -102,19 +106,20 @@ export default function CustomServer() {<Text variant="callout" color="ink3">{t`Enter the address you open Reactive Resume at in a browser. The app checks it's a Reactive Resume server that allows app sign-in before you continue.`}</Text>- </ScrollView>- <KeyboardStickyView offset={{ opened: insets.bottom - space.s2 }}>- <View style={{ flexDirection: "row", gap: space.s2, paddingTop: space.s2 }}>+ </KeyboardAwareScrollView>+ <KeyboardStickyView offset={{ opened: insets.bottom }} style={{ backgroundColor: colors.bg }}>+ <View style={{ flexDirection: stacked ? "column" : "row", gap: space.s2, paddingVertical: space.s2 }}>{check.state === "error" ? (<Buttonlabel={t`Try again`}variant="secondary"size="lg"icon="arrow-clockwise"+ fullWidth={stacked}onPress={() => void run(address)}/>) : null}- <View style={{ flex: 1 }}>+ <View style={{ flex: stacked ? undefined : 1 }}><Buttonlabel={t`Continue`}size="lg"diff --git a/apps/mobile/app/(tabs)/_layout.tsx b/apps/mobile/app/(tabs)/_layout.tsxindex caf846dca..65c1ca0ef 100644--- a/apps/mobile/app/(tabs)/_layout.tsx+++ b/apps/mobile/app/(tabs)/_layout.tsx@@ -3,7 +3,6 @@ import { useNetworkState } from "expo-network";import { useRouter } from "expo-router";import { Tabs } from "expo-router/tabs";import { View } from "react-native";-import { KeyboardAvoidingView } from "react-native-keyboard-controller";import {SafeAreaInsetsContext,SafeAreaProvider,@@ -16,6 +15,7 @@ import { AppSidebar, PhoneTabBar } from "@/shell/app-tabs";import { useKeyCommands } from "@/shell/key-commands";import { useIsTablet } from "@/shell/use-is-tablet";import { useReducedMotion, useTheme } from "@/ui";+import { KeyboardFrame } from "@/ui/keyboard";/*** Five tabs: Documents, Applications, the raised "+" (opens New as a modal), Career, Settings. Phone: the bottom tab@@ -53,7 +53,7 @@ export default function TabsLayout() {{/* Under a banner the status bar is already cleared, so the tabs' headers must not pad it again. */}<SafeAreaInsetsContext value={offline ? { ...insets, top: 0 } : insets}><BannerAbove value={offline}>- <KeyboardAvoidingView behavior="padding" automaticOffset style={{ flex: 1 }}>+ <KeyboardFrame behavior="padding" automaticOffset style={{ flex: 1 }}><SafeAreaView edges={["left", "right"]} style={{ flex: 1 }}><SafeAreaProvider><Tabs@@ -86,7 +86,7 @@ export default function TabsLayout() {</Tabs></SafeAreaProvider></SafeAreaView>- </KeyboardAvoidingView>+ </KeyboardFrame></BannerAbove></SafeAreaInsetsContext></View>diff --git a/apps/mobile/app/(tabs)/settings/preferences.tsx b/apps/mobile/app/(tabs)/settings/preferences.tsxindex 497197be7..36693e281 100644--- a/apps/mobile/app/(tabs)/settings/preferences.tsx+++ b/apps/mobile/app/(tabs)/settings/preferences.tsx@@ -3,7 +3,7 @@ import type { Locale } from "@reactive-resume/utils/locale";import { useLingui } from "@lingui/react/macro";import { useMutation, useQueryClient } from "@tanstack/react-query";import { useState } from "react";-import { DevSettings, View } from "react-native";+import { DevSettings, View, useWindowDimensions } from "react-native";import { localeSchema } from "@reactive-resume/utils/locale";import { timezoneSchema } from "@reactive-resume/utils/timezone";import { client, orpc } from "@/api/client";@@ -40,6 +40,7 @@ export default function PreferencesScreen() {haptics.selection();};const { space } = useTheme();+ const { fontScale } = useWindowDimensions();const profile = useProfile();const queryClient = useQueryClient();const [locale, setLocale] = useState(getLocalePreference);@@ -94,6 +95,7 @@ export default function PreferencesScreen() {<Text variant="caption" color="ink2">{t`Appearance`}</Text><Segmented<ThemePreference>label={t`Theme`}+ orientation={fontScale > 1.3 ? "vertical" : "horizontal"}value={theme}onChange={(value) => {try {diff --git a/apps/mobile/scripts/experience.test.mjs b/apps/mobile/scripts/experience.test.mjsindex cf2558c84..1938b57c1 100644--- a/apps/mobile/scripts/experience.test.mjs+++ b/apps/mobile/scripts/experience.test.mjs@@ -42,6 +42,7 @@ const ui = Object.fromEntries("ConfirmDialog","Icon","IconButton",+ "ListGroup","ListRow","SelectSheet","Switch",@@ -124,6 +125,55 @@ const draftBoundary = {};const document = load("features/share/document.ts", { "@/draft": draftBoundary });const { safeFileName } = load("features/share/model.ts");+const exportedBytes = new Uint8Array([1, 2, 3]);+const translatedLetterWords = {+ greeting: (name) => `Liebe ${name},`,+ teamGreeting: "Liebes Team & Personal,",+ hiringTeam: "Personal + Team",+ signOff: "Mit freundlichen Grüßen",+};+let exportPath;+const { exportFile } = load("features/share/files.ts", {+ "expo-file-system": {+ Directory: class {},+ File: class {+ async write(bytes) {+ assert.deepEqual(bytes, exportedBytes);+ }+ },+ Paths: {},+ },+ "expo-print": {},+ "expo-sharing": {},+ "@reactive-resume/resume/export-sections": {},+ "./letter": { letterWords: async () => translatedLetterWords },+ "./messages": {},+ "./model": { safeFileName },+ "@/preview/pipeline": {},+ "@/api/client": {+ client: { coverLetters: { getById: async () => ({ style: { metadata: { page: { locale: "de-DE" } } } }) } },+ rest: async (path) => {+ exportPath = new URL(path, "https://example.test");+ return { ok: true, arrayBuffer: async () => exportedBytes.buffer };+ },+ },+});+for (const format of ["docx", "odt", "md", "json"]) {+ await exportFile({ directory: {}, id: "letter-a", name: "Letter", format, letter: true });+ assert.equal(exportPath.pathname, `/cover-letters/letter-a/exports/${format}`);+ assert.deepEqual(+ Object.fromEntries(exportPath.searchParams),+ format === "json"+ ? {}+ : {+ "words[greeting]": "Liebe {name},",+ "words[teamGreeting]": translatedLetterWords.teamGreeting,+ "words[hiringTeam]": translatedLetterWords.hiringTeam,+ "words[signOff]": translatedLetterWords.signOff,+ },+ "Localized letter exports must use OpenAPI object query parameters",+ );+}let rejectExport = false;let releaseExport;let holdExport = false;@@ -246,8 +296,8 @@ assert.equal(const stages = load("features/applications/stages.ts");const nextSteps = load("features/applications/next-step.ts", { "./stages": stages });-const time = { locale: "en-US", timeZone: "UTC", when: String, time: String, day: String };-const { StageStepper, NextStepCard } = load("features/application-detail/sections.tsx", {+const time = { locale: "en-US", timeZone: "UTC", when: String, time: String, day: String, utcDay: String };+const { StageStepper, NextStepCard, WhatYouSent } = load("features/application-detail/sections.tsx", {"@tanstack/react-query": {},"expo-document-picker": {},"expo-file-system": {},@@ -256,6 +306,8 @@ const { StageStepper, NextStepCard } = load("features/application-detail/section"./attachment": {},"./notes-queue": { createNotesQueue: () => ({}) },"./hooks": {+ useDocuments: () => ({ data: [] }),+ useDetailMutations: () => ({ createLetter: { isPending: false } }),useNow: () => new Date(),useUserTime: () => time,followUpReminder: () => null,@@ -298,6 +350,33 @@ assert.deepEqual(calls, ["mark-applied"], "Explicit Saved → Applied still captcontrol(tree, "Change stage").onChange("interview");assert.deepEqual(calls.at(-1), { id: "job-a", status: "interview" });+for (const [resumeId, coverLetterId] of [+ [null, null],+ ["resume-a", null],+ [null, "letter-a"],+ ["resume-a", "letter-a"],+]) {+ reset();+ tree = render(WhatYouSent, { application: { ...application, resumeId, coverLetterId } });+ assert.equal(+ nodes(tree).filter((node) => node.type === "Card").length,+ resumeId || coverLetterId ? 1 : 0,+ "Only linked documents should create a card; an empty card leaves a stray border",+ );+ assert.equal(+ nodes(tree).filter((node) => node.type === "ListRow").length,+ Number(!!resumeId) + Number(!!coverLetterId),+ );+ assert.equal(+ nodes(tree).some((node) => node.props.label === "Prepare a resume"),+ !resumeId,+ );+ assert.equal(+ nodes(tree).some((node) => node.props.label === "Write a letter"),+ !coverLetterId,+ );+}+for (const [overrides, label, destination] of [[{}, "Prepare application", "fit"],[{ status: "applied" }, "Review application", "apply"],diff --git a/apps/mobile/scripts/layout.test.mjs b/apps/mobile/scripts/layout.test.mjsindex 4b0107877..a4a13af98 100644--- a/apps/mobile/scripts/layout.test.mjs+++ b/apps/mobile/scripts/layout.test.mjs@@ -14,6 +14,8 @@ const native = {View: "View",Text: "NativeText",ScrollView: "ScrollView",+ TextInput: "TextInput",+ Keyboard: { dismiss() {} },Pressable: "Pressable",I18nManager: { isRTL: false },Platform: { OS: "ios", select: (values) => values.ios ?? values.default },@@ -42,9 +44,17 @@ const mocks = {"@lingui/react/macro": { useLingui: () => ({ t: tag }) },"expo-router": { useRouter: () => router, usePathname: () => "/documents" },"expo-observe": { useObserve: () => ({ markInteractive() {} }) },- "react-native-keyboard-controller": { useKeyboardState: () => false },+ "react-native-keyboard-controller": { KeyboardAwareScrollView: "ScrollView", useKeyboardState: () => false },+ "react-native-reanimated": { useAnimatedReaction: (prepare, react) => effects.push(() => react(prepare(), null)) },+ "react-native-worklets": { scheduleOnRN: (run, ...args) => run(...args) },"@/routes": { routes },};+let keyboardHeight = 0;+mocks["react-native-keyboard-controller"].useKeyboardState = (select) =>+ select({ height: keyboardHeight, isVisible: keyboardHeight > 0 });+mocks["react-native-keyboard-controller"].useReanimatedKeyboardAnimation = () => ({+ height: { get: () => keyboardHeight },+});function load(path, extra = {}) {const module = { exports: {} };const source = readFileSync(new URL(`../src/${path}`, import.meta.url), "utf8");@@ -84,6 +94,23 @@ mocks["@/ui/use-pull-refresh"] = pullRefresh;mocks["@/components/collection-header"] = { CollectionHeader: "CollectionHeader" };const { useIsTablet: isTablet } = load("shell/use-is-tablet.ts");mocks["./use-is-tablet"] = { useIsTablet: isTablet };+const keyboardLayout = load("ui/keyboard.tsx");+mocks["./keyboard"] = keyboardLayout;+mocks["@/ui/keyboard"] = keyboardLayout;+const resizedKeyboard = keyboardLayout.KeyboardFrame({}).type;+for (const height of [0, 300, 200]) {+ keyboardHeight = height;+ resizedKeyboard.current = false;+ assert.equal(keyboardLayout.useKeyboardScrollSpace() + height, height, "Overlaid keyboards need scroll space");+ resizedKeyboard.current = true;+ assert.equal(+ keyboardLayout.useKeyboardScrollSpace() + height,+ 0,+ "Resized viewports must not add keyboard space twice",+ );+}+resizedKeyboard.current = false;+keyboardHeight = 0;const { Screen } = load("ui/text.tsx");const { TopBar } = load("shell/top-bar.tsx");const { AppSidebar } = load("shell/app-tabs.tsx", { "react-native-reanimated": {} });@@ -302,8 +329,134 @@ const render = (component, props = {}) => {for (const effect of effects) effect();return tree;};+// Android activity recreation can leave event caches visible after the native keyboard has closed.+react.Children = { count: (children) => (children == null ? 0 : Array.isArray(children) ? children.length : 1) };+const { Bar: VisibilityBar } = load("shell/app-tabs.tsx", {+ "react-native-reanimated": {},+ "react-native-keyboard-controller": { useKeyboardState: () => true },+});+hooks.length = 0;+assert.ok(render(VisibilityBar), "Native keyboard is hidden: stale event cache must not hide navigation");+for (const height of [300, 450, 0, 300, 0]) {+ keyboardHeight = height;+ render(VisibilityBar);+ assert.equal(render(VisibilityBar) === null, height !== 0, "Navigation follows native frames after recreation");+}+// Native nested headers clear the status bar only on phones; the tablet top bar already clears it.+const builderStack = { Screen: "Stack.Screen" };+const { BuilderChrome } = load("shell/builder-chrome.tsx", {+ "expo-router": {+ useRouter: () => router,+ useNavigation: () => ({}),+ useSegments: () => ["builder", "fictional", "basics"],+ Stack: builderStack,+ },+ "./app-banner": { AppStrip: "AppStrip" },+ "./app-tabs": { Bar: "Bar", BarItem: "BarItem" },+ "./key-commands": { useKeyCommands() {} },+ "./slot": { createSlot: () => ({ Provider: "SlotProvider", useFill() {} }) },+ "./top-bar": { TopBar },+});+const builderProps = {+ panes: [{ pane: "write", label: "Write", icon: "pencil", href: "/write" }],+ tabletPanes: ["write"],+ page: element("Preview", {}),+ title: "Fictional resume",+};+const builderFrame = nodes(BuilderChrome(builderProps)).find((node) => typeof node.type === "function");+hooks.length = 0;+insets = { top: 48, bottom: 32, left: 0, right: 0 };+for (const width of [443, 852, 443, 852]) {+ window = { width, height: 883, fontScale: 1 };+ for (const visible of [false, true, false]) {+ keyboardHeight = visible ? 300 : 0;+ render(builderFrame.type, builderProps);+ const tree = render(builderFrame.type, builderProps);+ const stack = nodes(tree).find((node) => node.type === builderStack);+ assert.equal(+ stack.props.screenOptions({ route: { name: "basics" } }).unstable_nativeProps?.headerConfig+ ?.disableTopInsetApplication,+ width >= 750,+ "Fold transitions must switch native header insets without changing the route",+ );+ const preview = nodes(tree).find(+ (node) =>+ nodes(node.props.children).some((child) => child.type === "Preview") &&+ node.props.style?.paddingBottom !== undefined,+ );+ if (width >= 750) {+ assert.equal(+ preview.props.style.paddingBottom,+ visible ? 0 : 32,+ "Keyboard replaces the preview's bottom safe area",+ );+ } else {+ assert.equal(preview, undefined, "Phones keep preview in its own pane");+ }+ }+}+hooks.length = 0;react.useRef = (initial) => react.useState({ current: initial })[0];react.useCallback = (callback) => callback;+// The first focus must allow Improve for an existing line without requiring another caret tap.+const richText = load("features/write/rich-text.ts");+const { RichTextField, RichTextToolbar } = load("features/write/rich-text-field.tsx", {+ react: {+ ...react,+ useState: (initial) => react.useState(typeof initial === "function" ? initial() : initial),+ useEffect() {},+ useMemo: (compute) => compute(),+ useSyncExternalStore: (_subscribe, snapshot) => snapshot(),+ },+ "@lingui/core/macro": { plural: () => "characters" },+ "react-native-enriched-html": { EnrichedTextInput: "RichInput" },+ "./rich-text": richText,+ "./improve": { ImprovePanel: "ImprovePanel" },+ "./pickers": { PromptSheet: "PromptSheet" },+ "@/draft": { resumeFieldFocus: { onFocus() {}, onBlur() {} } },+});+for (const text of ["Existing line", ""]) {+ hooks.length = 0;+ const field = render(RichTextField, { label: "Summary", value: `<p>${text}</p>`, onChange() {} });+ const input = nodes(field).find((node) => node.type === "RichInput");+ input.props.onChangeText({ nativeEvent: { value: text } });+ input.props.onFocus();+ const toolbar = render(RichTextToolbar);+ for (const height of [300, 0]) {+ keyboardHeight = height;+ render(RichTextToolbar);+ const dock = nodes(render(RichTextToolbar)).find((node) => node.props.accessibilityRole === "toolbar");+ assert.equal(dock.props.style.paddingBottom, height ? 0 : insets.bottom, "Hardware-keyboard tools clear gestures");+ }+ keyboardHeight = 0;+ const improve = nodes(toolbar).find((node) => node.props.label === "Improve selected line");+ assert.equal(improve.props.disabled, text === "", "First focus enables Improve only for nonempty lines");+ if (text) {+ const commands = [];+ input.props.ref.current = {+ toggleUnderline: () => commands.push("underline"),+ toggleStrikeThrough: () => commands.push("strikethrough"),+ focus: () => commands.push("focus"),+ };+ for (const [title, command] of [+ ["Underline", "underline"],+ ["Strikethrough", "strikethrough"],+ ]) {+ nodes(render(RichTextToolbar))+ .find((node) => node.props.label === "Text style")+ .props.onPress();+ const menu = nodes(render(RichTextToolbar)).find((node) => node.props.title === "Text style");+ assert.equal(menu.props.open, true);+ nodes(menu)+ .find((node) => node.props.title === title)+ .props.onPress();+ assert.deepEqual(commands.splice(0), [command, "focus"], "Text style preserves formatting and returns focus");+ assert.equal(nodes(render(RichTextToolbar)).find((node) => node.props.title === "Text style").props.open, false);+ }+ }+ input.props.onBlur();+}+hooks.length = 0;native.StyleSheet = { hairlineWidth: 1 };const animation = {View: "Animated.View",@@ -371,6 +524,29 @@ const { DocumentsLibrary } = load("features/documents/library.tsx", {useFirstAppearance: () => false,},});+// Changing library columns remounts its header; an active filter must remain visible and clearable.+hooks.length = 0;+let restoredSearch = "Fold QA duplicate";+const searchedHeader = render(CollectionHeader, {+ title: "Documents",+ searchLabel: "Search documents",+ placeholder: "Search",+ value: restoredSearch,+ onChangeText(value) {+ restoredSearch = value;+ },+});+assert.equal(nodes(searchedHeader).find((node) => node.type === "TextInput")?.props.value, restoredSearch);+assert.equal(+ nodes(searchedHeader).find((node) => node.type === "TextInput").props.autoFocus,+ false,+ "Restoring an active filter must not summon the keyboard",+);+nodes(searchedHeader)+ .find((node) => node.props.label === "Close search")+ .props.onPress();+assert.equal(restoredSearch, "");+for (const fontScale of [1, 1.95, 3.12]) {window = { width: 320, height: 568, fontScale };hooks.length = 0;@@ -393,9 +569,10 @@ for (const fontScale of [1, 1.95, 3.12]) {});const title = nodes(row).find((node) => node.props.children?.includes("Preferences"));const content = nodes(row).find((node) => node.props.children?.includes(title));- assert.equal(row.props.style({ pressed: false }).flexDirection, fontScale > 1.3 ? "column" : "row");+ const rowStyle = typeof row.props.style === "function" ? row.props.style({ pressed: false }) : row.props.style;+ assert.equal(rowStyle.flexDirection, fontScale > 1.3 ? "column" : "row");if (fontScale > 1.3) {- assert.equal(row.props.style({ pressed: false }).alignItems, "stretch", "Large row titles need full width");+ assert.equal(rowStyle.alignItems, "stretch", "Large row titles need full width");assert.equal(nodes(content).some((node) => node.type === "Icon"),false,@@ -417,10 +594,12 @@ for (const fontScale of [1, 1.95, 3.12]) {assert.ok(choice, "Three Knowledge choices must remain inline");const segments = render(Segmented, choice.props);assert.equal(segments.props.style.flexDirection, fontScale > 1.3 ? "column" : "row");- for (const label of ["Documents", "Applications", "Career", "Settings"]) {+ for (const label of ["Documents", "Applications", "Career", "Settings", "Podania o pracę", "தொழில் வாழ்க்கை"]) {const item = render(BarItem, { label, icon: "file-text", focused: false, onPress() {} });const text = nodes(item).find((node) => node.props.children?.includes(label));- assert.equal(text.props.numberOfLines, undefined, "Navigation labels must wrap instead of ellipsizing");+ assert.equal(text.props.numberOfLines, label.split(" ").length, "Translated phrases must retain room to wrap");+ assert.equal(text.props.adjustsFontSizeToFit, true, "Long navigation words must fit their cells");+ assert.equal(text.props.minimumFontScale, 0.7);assert.equal(item.props.accessibilityLabel, label);}for (const isError of [false, true]) {@@ -488,6 +667,14 @@ assert.ok(nodes(workspace).some((node) => node.props.label === "Next workspace tselectedTab = "apply";workspace = render(frame.type, frame.props);assert.equal(scrolled.at(-1), 40, "Changing route must reveal the selected tab again");+assert.ok(nodes(workspace).some((node) => node.type === keyboardLayout.KeyboardFrame));+selectedTab = "details";+hooks.length = 0;+assert.equal(+ nodes(render(frame.type, frame.props)).some((node) => node.type === keyboardLayout.KeyboardFrame),+ false,+ "Application details keep their own full-height scroll space outside workspace keyboard resizing",+);console.log("PASS safe areas, measured Screen viewport, Duo rail navigation/targets, tablet sidebar, responsive editor modes, history split, measured PDF pages, large-text chrome/rows/navigation, workspace selection and overflow",);@@ -559,6 +746,37 @@ const search = (query) => {picker = search(" Arrow ");assert.ok(picker.props.data.length > 60, "Search must not truncate large result sets");assert.ok(picker.props.data.every((name) => !name || name.includes("arrow")));++assert.equal(+ render(ListRow, { title: "Setting", trailing: element("Switch", {}) }).props.accessible,+ false,+ "Passive rows must expose their child switches as independent accessibility controls",+);+assert.equal(render(ListRow, { title: "Setting", trailing: element("Switch", {}) }).type, "View");+assert.equal(render(ListRow, { title: "Status", value: "Saved" }).props.accessible, true);+assert.equal(render(ListRow, { title: "Open", onPress() {} }).props.accessible, true);++// An unknown decorative icon crashes its entire screen, including rows accepting ReactNode leading content.+const { Icon: NativeIcon } = load(+ "ui/icon.tsx",+ Object.fromEntries(+ [+ ...readFileSync(new URL("../src/ui/icon.tsx", import.meta.url), "utf8").matchAll(+ /import \{ (\w+) \} from "(phosphor-react-native\/src\/icons\/[^"]+)"/g,+ ),+ ].map(([, symbol, path]) => [path, { [symbol]: symbol }]),+ ),+);+for (const directory of [new URL("../src/", import.meta.url), new URL("../app/", import.meta.url)]) {+ for (const path of readdirSync(directory, { recursive: true }).filter((path) => path.endsWith(".tsx"))) {+ const source = readFileSync(new URL(path, directory), "utf8");+ for (const pattern of [/\b(?:icon|leading)="([^"]+)"/g, /<Icon\b[^>]*\bname="([^"]+)"/g]) {+ for (const [, name] of source.matchAll(pattern)) {+ assert.ok(NativeIcon({ name }).type, `${path}: icon "${name}" must resolve before its screen renders`);+ }+ }+ }+}picker = search("no-such-icon");assert.deepEqual(picker.props.data, [""]);assert.ok(picker.props.ListFooterComponent);diff --git a/apps/mobile/src/components/collection-header.tsx b/apps/mobile/src/components/collection-header.tsxindex fbcb6513d..206b57861 100644--- a/apps/mobile/src/components/collection-header.tsx+++ b/apps/mobile/src/components/collection-header.tsx@@ -36,7 +36,7 @@ export function CollectionHeader({}: CollectionHeaderProps) {const { t } = useLingui();const { colors, radius, size, space, type } = useTheme();- const [searching, setSearching] = useState(false);+ const [searching, setSearching] = useState(Boolean(value));const { fontScale } = useWindowDimensions();const stacked = fontScale > 1.3;return (@@ -71,7 +71,7 @@ export function CollectionHeader({value={value}onChangeText={onChangeText}editable={!disabled}- autoFocus+ autoFocus={!value}autoCorrect={false}autoCapitalize="none"returnKeyType="search"diff --git a/apps/mobile/src/features/application-detail/detail-screen.tsx b/apps/mobile/src/features/application-detail/detail-screen.tsxindex 3d621732d..1902f4c93 100644--- a/apps/mobile/src/features/application-detail/detail-screen.tsx+++ b/apps/mobile/src/features/application-detail/detail-screen.tsx@@ -25,7 +25,7 @@ type Overlay =/** One application: stage stepper, next step, what was sent, facts, contacts, notes, timeline and attachments. */export function ApplicationDetail({ id }: ApplicationDetailProps) {const { t } = useLingui();- const { space } = useTheme();+ const { space, size } = useTheme();const router = useRouter();const session = useSession();const query = useApplication(id);@@ -71,7 +71,16 @@ export function ApplicationDetail({ id }: ApplicationDetailProps) {const openInterview = (interview: InterviewTimelineEntry | null) => setOverlay({ kind: "interview", interview });return (- <Screen onRefresh={query.refetch} contentStyle={{ gap: space.s6, paddingBottom: space.s12 }}>+ <Screen+ onRefresh={query.refetch}+ contentStyle={{+ gap: space.s6,+ paddingBottom: space.s12,+ width: "100%",+ maxWidth: size.sheetDetail,+ alignSelf: "center",+ }}+ ><Stack.Screen options={{ title: application.company }} /><View style={{ gap: space.s1 }}><Text variant="display">{application.role}</Text>diff --git a/apps/mobile/src/features/application-detail/sections.tsx b/apps/mobile/src/features/application-detail/sections.tsxindex 208444ffc..256291ba6 100644--- a/apps/mobile/src/features/application-detail/sections.tsx+++ b/apps/mobile/src/features/application-detail/sections.tsx@@ -40,6 +40,7 @@ import {ConfirmDialog,Icon,IconButton,+ ListGroup,ListRow,SelectSheet,showToast,@@ -125,14 +126,16 @@ export function StageStepper({ application, onMarkApplied }: StageStepperProps){closed ? "" : plural(days, { 0: "· since today", one: "· for # day", other: "· for # days" })}</Text></View>- <SelectSheet- appearance="row"- label={t`Change stage`}- value={status}- options={PIPELINE.map((stage) => ({ value: stage, label: getStageLabel(stage) }))}- disabled={update.isPending || closed}- onChange={move}- />+ <ListGroup>+ <SelectSheet+ appearance="row"+ label={t`Change stage`}+ value={status}+ options={PIPELINE.map((stage) => ({ value: stage, label: getStageLabel(stage) }))}+ disabled={update.isPending || closed}+ onChange={move}+ />+ </ListGroup></View>);}@@ -304,36 +307,38 @@ export function WhatYouSent({ application }: SectionProps) {return (<Section title={application.status === "saved" ? t`Documents for this job` : t`What you sent`}>- <Card style={{ padding: 0 }}>- {resumeId ? (- <ListRow- leading="file-text"- title={resume?.name ?? t`Linked resume`}- subtitle={- sentResumeVersionId- ? application.sentCheckScore !== null- ? t`Version sent ${date} · Check ${application.sentCheckScore}`- : t`Version sent ${date}`- : t`Linked · not sent yet`- }- chevron- onPress={() =>- router.push(- sentResumeVersionId ? routes.history(resumeId, sentResumeVersionId) : routes.builder(resumeId),- )- }- />- ) : null}- {coverLetterId ? (- <ListRow- leading="envelope-simple"- title={letter?.name ?? t`Cover letter`}- subtitle={sentCoverLetterVersionId ? t`Version sent ${date}` : t`Linked · not sent yet`}- chevron- onPress={() => router.push(routes.letter(coverLetterId, "write", sentCoverLetterVersionId ?? undefined))}- />- ) : null}- </Card>+ {resumeId || coverLetterId ? (+ <Card style={{ padding: 0 }}>+ {resumeId ? (+ <ListRow+ leading="file-text"+ title={resume?.name ?? t`Linked resume`}+ subtitle={+ sentResumeVersionId+ ? application.sentCheckScore !== null+ ? t`Version sent ${date} · Check ${application.sentCheckScore}`+ : t`Version sent ${date}`+ : t`Linked · not sent yet`+ }+ chevron+ onPress={() =>+ router.push(+ sentResumeVersionId ? routes.history(resumeId, sentResumeVersionId) : routes.builder(resumeId),+ )+ }+ />+ ) : null}+ {coverLetterId ? (+ <ListRow+ leading="envelope-simple"+ title={letter?.name ?? t`Cover letter`}+ subtitle={sentCoverLetterVersionId ? t`Version sent ${date}` : t`Linked · not sent yet`}+ chevron+ onPress={() => router.push(routes.letter(coverLetterId, "write", sentCoverLetterVersionId ?? undefined))}+ />+ ) : null}+ </Card>+ ) : null}{!resumeId || !coverLetterId ? (<View style={{ flexDirection: "row", flexWrap: "wrap", gap: space.s2 }}>{!resumeId ? (diff --git a/apps/mobile/src/features/applications-board/calendar-screen.tsx b/apps/mobile/src/features/applications-board/calendar-screen.tsxindex 455ac09bd..b6215734e 100644--- a/apps/mobile/src/features/applications-board/calendar-screen.tsx+++ b/apps/mobile/src/features/applications-board/calendar-screen.tsx@@ -86,7 +86,6 @@ function ApplicationCalendar() {new Intl.DateTimeFormat(i18n.locale, { timeZone: "UTC", ...options });const monthTitle = utc({ month: "long", year: "numeric" }).format(Date.UTC(month.year, month.month, 1));const weekday = utc({ weekday: "narrow" });- const weekdayLong = utc({ weekday: "long" });const fullDay = utc({ weekday: "long", day: "numeric", month: "long" });const tomorrow = new Date(dateOfKey(today).getTime() + 86_400_000).toISOString().slice(0, 10);const dayHeading = (key: string) =>@@ -233,7 +232,7 @@ function ApplicationCalendar() {key={day.key}accessibilityRole="button"accessibilityState={{ selected: isSelected }}- accessibilityLabel={`${weekdayLong.format(dateOfKey(day.key))} ${fullDay.format(dateOfKey(day.key))}${summary ? `: ${summary}` : ""}`}+ accessibilityLabel={`${fullDay.format(dateOfKey(day.key))}${summary ? `: ${summary}` : ""}`}onPress={() => setSelected(day.key)}style={{flex: 1,diff --git a/apps/mobile/src/features/career/facts.tsx b/apps/mobile/src/features/career/facts.tsxindex 8a79c1875..d2be05157 100644--- a/apps/mobile/src/features/career/facts.tsx+++ b/apps/mobile/src/features/career/facts.tsx@@ -57,7 +57,7 @@ const keyOf = (fact: Fact) => fact.id;export function Facts({ children, onRefresh }: FactsProps) {const { t } = useLingui();- const { colors, space } = useTheme();+ const { colors, size, space } = useTheme();const { facts } = useCareerQueries();const pull = usePullRefresh(onRefresh);const [search, setSearch] = useState("");@@ -128,7 +128,15 @@ export function Facts({ children, onRefresh }: FactsProps) {);const header = (- <View style={{ gap: space.s4, paddingBottom: space.s4 }}>+ <View+ style={{+ gap: space.s4,+ paddingBottom: space.s4,+ width: "100%",+ maxWidth: size.formSheet - space.s4 * 2,+ alignSelf: "center",+ }}+ >{children}<TextField label={t`Search facts`} value={search} onChangeText={setSearch} /><SelectSheet@@ -206,9 +214,17 @@ type FactRowProps = { fact: Fact; index: number; first: boolean; pending: boolea// Memoized: the app has no React Compiler, and typing or one toggle shouldn't re-render every card.const FactRow = memo(function FactRow({ fact, index, first, pending, actions }: FactRowProps) {const { t } = useLingui();- const { space } = useTheme();+ const { size, space } = useTheme();return (- <Animated.View {...listItemMotion(index, first)} style={{ paddingBottom: space.s4 }}>+ <Animated.View+ {...listItemMotion(index, first)}+ style={{+ paddingBottom: space.s4,+ width: "100%",+ maxWidth: size.formSheet - space.s4 * 2,+ alignSelf: "center",+ }}+ ><Card style={{ gap: space.s3 }}><Actions><Chip label={categoryLabel(fact.category)} />diff --git a/apps/mobile/src/features/career/knowledge.tsx b/apps/mobile/src/features/career/knowledge.tsxindex dfa3250d2..36daecb36 100644--- a/apps/mobile/src/features/career/knowledge.tsx+++ b/apps/mobile/src/features/career/knowledge.tsx@@ -7,12 +7,13 @@ import { Preferences } from "./preferences";import { LoadState } from "./shared";import { Stories } from "./stories";import { useSession } from "@/auth/session";-import { Screen, Segmented, Text } from "@/ui";+import { Screen, Segmented, Text, useTheme } from "@/ui";export function KnowledgeScreen() {const { t } = useLingui();const [tab, setTab] = useState("facts");const { fontScale } = useWindowDimensions();+ const { size } = useTheme();const session = useSession();const { facts, stories, profile } = useCareerQueries();const refresh = () => Promise.allSettled([facts.refetch(), stories.refetch(), profile.refetch()]);@@ -42,7 +43,7 @@ export function KnowledgeScreen() {</Screen>);return (- <Screen onRefresh={refresh}>+ <Screen onRefresh={refresh} contentStyle={{ width: "100%", maxWidth: size.formSheet, alignSelf: "center" }}>{intro}{tab === "stories" ? (<Stories key={session.server} />diff --git a/apps/mobile/src/features/design/design-pane.tsx b/apps/mobile/src/features/design/design-pane.tsxindex 7c5e0e59b..2244a5021 100644--- a/apps/mobile/src/features/design/design-pane.tsx+++ b/apps/mobile/src/features/design/design-pane.tsx@@ -27,6 +27,7 @@ import { nativeEnvironment } from "@/draft/native";import { ResumePage } from "@/preview/page";import { useIsTablet } from "@/shell/use-is-tablet";import { Banner, IconButton, Skeleton, Text, haptics, showToast, useReducedMotion, useTheme } from "@/ui";+import { useKeyboardScrollSpace } from "@/ui/keyboard";type Tab = "template" | "type" | "color" | "page";type Entry = { kind: "advanced"; id: AdvancedId } | { kind: "picker"; spec: PickerSpec };@@ -43,6 +44,7 @@ export function DesignPane({ id }: { id: string }) {const { colors, fonts, radius, space, size, motion, shadows } = useTheme();const window = useWindowDimensions();const tablet = useIsTablet();+ const keyboardSpace = useKeyboardScrollSpace();const reduced = useReducedMotion();const draft = useDesignDraft(id);const session = useSession();@@ -252,6 +254,7 @@ export function DesignPane({ id }: { id: string }) {style={{ flex: 1 }}><KeyboardAwareScrollView+ extraKeyboardSpace={keyboardSpace}scrollEnabled={!scrollLocked}keyboardShouldPersistTaps="handled"contentContainerStyle={{ padding: space.s4, paddingBottom: space.s12 }}diff --git a/apps/mobile/src/features/document-menu/index.tsx b/apps/mobile/src/features/document-menu/index.tsxindex 93c79e3f5..33e92da65 100644--- a/apps/mobile/src/features/document-menu/index.tsx+++ b/apps/mobile/src/features/document-menu/index.tsx@@ -278,6 +278,8 @@ function NotesEditor({ id, value, locked }: NotesEditorProps) {const editor = useRef<EnrichedTextInputInstance>(null);const last = useRef(value);const focused = useRef(false);+ const [isFocused, setIsFocused] = useState(false);+ const border = isFocused ? 2 : 1;useEffect(() => () => {if (focused.current) {@@ -294,42 +296,50 @@ function NotesEditor({ id, value, locked }: NotesEditorProps) {}}, [value]);return (- <EnrichedTextInput- key={id}- ref={editor}- accessibilityLabel={t`Notes`}- defaultValue={value}- editable={!locked}- onFocus={() => {- focused.current = true;- resumeFieldFocus.onFocus();- }}- onBlur={() => {- focused.current = false;- resumeFieldFocus.onBlur();- }}+ <Viewstyle={{- minHeight: space.s12 * 3,- color: colors.ink,- backgroundColor: colors.raised,- borderColor: colors.lineStrong,- borderWidth: 1,+ borderWidth: border,borderRadius: radius.rMd,- padding: space.s3,- fontFamily: type.body.fontFamily,- fontSize: type.body.fontSize,- }}- onChangeHtml={(event) => {- if (!focused.current) return;- const html = event.nativeEvent.value;- last.current = html;- useResumeStore.getState().update(- (data) => {- data.metadata.notes = html;- },- { coalesceKey: "metadata.notes" },- );+ borderColor: isFocused ? colors.accent : colors.lineStrong,+ backgroundColor: locked ? colors.sunken : colors.raised,+ overflow: "hidden",}}- />+ >+ <EnrichedTextInput+ key={id}+ ref={editor}+ accessibilityLabel={t`Notes`}+ defaultValue={value}+ editable={!locked}+ onFocus={() => {+ focused.current = true;+ setIsFocused(true);+ resumeFieldFocus.onFocus();+ }}+ onBlur={() => {+ focused.current = false;+ setIsFocused(false);+ resumeFieldFocus.onBlur();+ }}+ style={{+ minHeight: space.s12 * 3 - border * 2,+ color: colors.ink,+ padding: space.s3 - (border - 1),+ fontFamily: type.body.fontFamily,+ fontSize: type.body.fontSize,+ }}+ onChangeHtml={(event) => {+ if (!focused.current) return;+ const html = event.nativeEvent.value;+ last.current = html;+ useResumeStore.getState().update(+ (data) => {+ data.metadata.notes = html;+ },+ { coalesceKey: "metadata.notes" },+ );+ }}+ />+ </View>);}diff --git a/apps/mobile/src/features/documents/library.tsx b/apps/mobile/src/features/documents/library.tsxindex 339d87be9..675536fcd 100644--- a/apps/mobile/src/features/documents/library.tsx+++ b/apps/mobile/src/features/documents/library.tsx@@ -423,7 +423,6 @@ export function DocumentsLibrary({ trashed = false }: DocumentsLibraryProps) {><Stack.Screen options={{ title: trashed ? t`Trash` : t`Documents`, headerShown: false }} /><AnimatedLegendList- key={columns}data={session.status === "signed-in" ? filtered : []}ListHeaderComponent={header}numColumns={columns}diff --git a/apps/mobile/src/features/letters/rich-text-field.tsx b/apps/mobile/src/features/letters/rich-text-field.tsxindex 17c7ed470..c2e771418 100644--- a/apps/mobile/src/features/letters/rich-text-field.tsx+++ b/apps/mobile/src/features/letters/rich-text-field.tsx@@ -6,9 +6,11 @@ import { useLingui } from "@lingui/react/macro";import { useEffect, useRef, useState, useSyncExternalStore } from "react";import { ScrollView, View } from "react-native";import { EnrichedTextInput } from "react-native-enriched-html";+import { useSafeAreaInsets } from "react-native-safe-area-context";import { letterFieldFocus } from "@/draft";import { createRichTextSession } from "@/features/write/rich-text";import { Button, IconButton, Text, useTheme } from "@/ui";+import { useKeyboardVisible } from "@/ui/keyboard";/** The focused editor, for the toolbar docked above the keyboard (one per screen). */type ActiveEditor = {@@ -62,6 +64,7 @@ export function LetterRichText({ label, value, onChange, disabled, autoFocus, miconst ref = useRef<EnrichedTextInputInstance>(null);const [session] = useState(() => createRichTextSession(value));const [focused, setFocused] = useState(false);+ const border = focused ? 2 : 1;// Undo, a kept draft and remote updates change the text from outside; load them while the field isn't focused.useEffect(() => {@@ -81,55 +84,61 @@ export function LetterRichText({ label, value, onChange, disabled, autoFocus, mireturn (<View style={{ gap: space.s1 }}><Text variant="label">{label}</Text>- <EnrichedTextInput- ref={ref}- accessibilityLabel={label}- // The initial markup only: changing defaultValue reloads the editor and moves the caret.- defaultValue={session.markup}- editable={!disabled}- autoFocus={autoFocus ?? false}- placeholderTextColor={colors.ink3}- cursorColor={colors.accent}- selectionColor={colors.accentSoft}- linkRegex={null}+ <Viewstyle={{- minHeight: type.bodyLarge.lineHeight * minLines + space.s3 * 2,- paddingHorizontal: space.s3,- paddingVertical: space.s3,- borderWidth: 1,+ borderWidth: border,borderRadius: radius.rLg,borderColor: focused ? colors.accent : colors.lineStrong,backgroundColor: disabled ? colors.sunken : colors.raised,- color: colors.ink,- fontFamily: fonts.ui[400],- fontSize: type.bodyLarge.fontSize,+ overflow: "hidden",}}- htmlStyle={{- a: { color: colors.accentText, textDecorationLine: "underline" },- ul: { bulletColor: colors.ink2 },- ol: { markerColor: colors.ink2 },- }}- onFocus={() => {- session.focus();- letterFieldFocus.onFocus();- setFocused(true);- loadBaseline(ref, session, onChange);- setActive({ ref, state: active?.ref === ref ? active.state : null, command: session.command });- }}- onBlur={() => {- session.blur();- letterFieldFocus.onBlur();- setFocused(false);- if (active?.ref === ref) setActive(null);- }}- onChangeHtml={(event) => {- const html = session.change(event.nativeEvent.value);- if (html !== null) onChange(html);- }}- onChangeState={(event) => {- if (active?.ref === ref) setActive({ ...active, state: event.nativeEvent });- }}- />+ >+ <EnrichedTextInput+ ref={ref}+ accessibilityLabel={label}+ // The initial markup only: changing defaultValue reloads the editor and moves the caret.+ defaultValue={session.markup}+ editable={!disabled}+ autoFocus={autoFocus ?? false}+ placeholderTextColor={colors.ink3}+ cursorColor={colors.accent}+ selectionColor={colors.accentSoft}+ linkRegex={null}+ style={{+ minHeight: type.bodyLarge.lineHeight * minLines + space.s3 * 2 - border * 2,+ paddingHorizontal: space.s3 - (border - 1),+ paddingVertical: space.s3 - (border - 1),+ color: colors.ink,+ fontFamily: fonts.ui[400],+ fontSize: type.bodyLarge.fontSize,+ }}+ htmlStyle={{+ a: { color: colors.accentText, textDecorationLine: "underline" },+ ul: { bulletColor: colors.ink2 },+ ol: { markerColor: colors.ink2 },+ }}+ onFocus={() => {+ session.focus();+ letterFieldFocus.onFocus();+ setFocused(true);+ loadBaseline(ref, session, onChange);+ setActive({ ref, state: active?.ref === ref ? active.state : null, command: session.command });+ }}+ onBlur={() => {+ session.blur();+ letterFieldFocus.onBlur();+ setFocused(false);+ if (active?.ref === ref) setActive(null);+ }}+ onChangeHtml={(event) => {+ const html = session.change(event.nativeEvent.value);+ if (html !== null) onChange(html);+ }}+ onChangeState={(event) => {+ if (active?.ref === ref) setActive({ ...active, state: event.nativeEvent });+ }}+ />+ </View></View>);}@@ -141,6 +150,8 @@ export function LetterRichText({ label, value, onChange, disabled, autoFocus, miexport function LetterRichTextToolbar() {const { t } = useLingui();const { colors, size, space } = useTheme();+ const insets = useSafeAreaInsets();+ const keyboardVisible = useKeyboardVisible();const editor = useSyncExternalStore(subscribe, () => active);if (!editor) return null;const input = () => {@@ -183,7 +194,8 @@ export function LetterRichTextToolbar() {style={{flexDirection: "row",alignItems: "center",- minHeight: size.hit + 2,+ minHeight: size.hit + space.s1 * 2 + (keyboardVisible ? 0 : insets.bottom),+ paddingBottom: keyboardVisible ? 0 : insets.bottom,borderTopWidth: 1,borderTopColor: colors.line,backgroundColor: colors.raised,diff --git a/apps/mobile/src/features/letters/write.tsx b/apps/mobile/src/features/letters/write.tsxindex eda1cab94..658ece5a3 100644--- a/apps/mobile/src/features/letters/write.tsx+++ b/apps/mobile/src/features/letters/write.tsx@@ -8,7 +8,8 @@ import { useLingui } from "@lingui/react/macro";import { ORPCError } from "@orpc/client";import { useRouter } from "expo-router";import { useState } from "react";-import { Keyboard, ScrollView, View } from "react-native";+import { Keyboard, View, useWindowDimensions } from "react-native";+import { KeyboardAwareScrollView } from "react-native-keyboard-controller";import { coverLetterTextToHtml, defaultCoverLetterSignOff, greetingName } from "@reactive-resume/resume/cover-letter";import { useLetterWords } from "./compose";import { designSummary } from "./design-presets";@@ -38,6 +39,7 @@ import {useReducedMotion,useTheme,} from "@/ui";+import { useKeyboardScrollSpace } from "@/ui/keyboard";type Recipe = (letter: WritableDraft<LetterDocument>) => void;@@ -78,6 +80,7 @@ export function LetterWrite({ id }: { id: string }) {const draft = useLetterDrafting((state) => state.draft);const applications = useApplications();const { size, space } = useTheme();+ const keyboardSpace = useKeyboardScrollSpace();if (!letter) {return status === "error" ? (@@ -103,7 +106,12 @@ export function LetterWrite({ id }: { id: string }) {return (<View style={{ flex: 1 }}>- <ScrollView keyboardShouldPersistTaps="handled" keyboardDismissMode="interactive">+ <KeyboardAwareScrollView+ extraKeyboardSpace={keyboardSpace}+ bottomOffset={size.hit + space.s4}+ keyboardShouldPersistTaps="handled"+ keyboardDismissMode="interactive"+ >{disabled ? (<Banner icon="lock" tone="info" message={t`This letter is locked. Unlock it in Documents to edit.`} />) : null}@@ -117,7 +125,7 @@ export function LetterWrite({ id }: { id: string }) {/><DesignNote letter={letter} /><View style={{ height: size.hit + space.s5 }} />- </ScrollView>+ </KeyboardAwareScrollView><LetterRichTextToolbar /></View>);@@ -143,6 +151,8 @@ type ForSectionProps = {function ForSection({ application, applications, disabled }: ForSectionProps) {const { t } = useLingui();const { colors, radius, size, space } = useTheme();+ const { fontScale } = useWindowDimensions();+ const stacked = fontScale > 1.3;const [open, setOpen] = useState(false);const [query, setQuery] = useState("");const search = query.trim().toLocaleLowerCase();@@ -167,8 +177,8 @@ function ForSection({ application, applications, disabled }: ForSectionProps) {{application ? (<Viewstyle={{- flexDirection: "row",- alignItems: "center",+ flexDirection: stacked ? "column" : "row",+ alignItems: stacked ? "flex-start" : "center",gap: space.s3,padding: space.s3,borderWidth: 1,@@ -190,25 +200,38 @@ function ForSection({ application, applications, disabled }: ForSectionProps) {{application.company.charAt(0).toLocaleUpperCase()}</Text></View>- <View style={{ flex: 1, minWidth: 0 }}>- <Text weight={500} numberOfLines={1}>+ <View style={stacked ? { alignSelf: "stretch" } : { flex: 1, minWidth: 0 }}>+ <Text weight={500} numberOfLines={stacked ? undefined : 2}>{application.role}</Text>- <View style={{ flexDirection: "row", alignItems: "center", gap: space.s1 }}>- <Text variant="caption" color="ink3" numberOfLines={1} style={{ flexShrink: 1 }}>- {application.company} ·- </Text>- <View- style={{- width: space.s2 - space.s0,- height: space.s2 - space.s0,- borderRadius: radius.rLg,- backgroundColor: getStageColor(application.status, colors),- }}- />- <Text variant="caption" color="ink3">- {getStageLabel(application.status)}+ <View+ style={{+ flexDirection: stacked ? "column" : "row",+ alignItems: stacked ? "flex-start" : "center",+ gap: space.s1,+ }}+ >+ <Text+ variant="caption"+ color="ink3"+ numberOfLines={stacked ? undefined : 1}+ style={stacked ? { alignSelf: "stretch" } : { flexShrink: 1 }}+ >+ {application.company}</Text>+ <View style={{ flexDirection: "row", alignItems: "center", gap: space.s1 }}>+ <View+ style={{+ width: space.s2 - space.s0,+ height: space.s2 - space.s0,+ borderRadius: radius.rLg,+ backgroundColor: getStageColor(application.status, colors),+ }}+ />+ <Text variant="caption" color="ink3">+ {getStageLabel(application.status)}+ </Text>+ </View></View></View><Button size="sm" variant="secondary" label={t`Change`} disabled={disabled} onPress={() => setOpen(true)} />diff --git a/apps/mobile/src/features/share/files.ts b/apps/mobile/src/features/share/files.tsindex 38157ee23..c00e6cb06 100644--- a/apps/mobile/src/features/share/files.ts+++ b/apps/mobile/src/features/share/files.ts@@ -81,14 +81,12 @@ export async function exportFile({ directory, id, name, format, data, letter }:if (letter && format !== "json") {const document = await client.coverLetters.getById({ id });const words = await letterWords(document.style.metadata.page.locale);- query = `?words=${encodeURIComponent(- JSON.stringify({- greeting: words.greeting("{name}"),- teamGreeting: words.teamGreeting,- hiringTeam: words.hiringTeam,- signOff: words.signOff,- }),- )}`;+ query = `?${new URLSearchParams({+ "words[greeting]": words.greeting("{name}"),+ "words[teamGreeting]": words.teamGreeting,+ "words[hiringTeam]": words.hiringTeam,+ "words[signOff]": words.signOff,+ })}`;}const response = await rest(`/${letter ? "cover-letters" : "resumes"}/${encodeURIComponent(id)}/exports/${format}${query}`,diff --git a/apps/mobile/src/features/share/link.tsx b/apps/mobile/src/features/share/link.tsxindex f00b64226..07032e48b 100644--- a/apps/mobile/src/features/share/link.tsx+++ b/apps/mobile/src/features/share/link.tsx@@ -22,7 +22,19 @@ import { getServer } from "@/auth/session";import { useResumeStore } from "@/draft";import { resume as draftResume } from "@/draft/runtime";import { useDocumentOperations } from "@/features/documents/queries";-import { Banner, Button, ListRow, Sheet, Skeleton, Switch, Text, TextField, showToast, useTheme } from "@/ui";+import {+ Banner,+ Button,+ ListGroup,+ ListRow,+ Sheet,+ Skeleton,+ Switch,+ Text,+ TextField,+ showToast,+ useTheme,+} from "@/ui";/** Sharing settings: saved beside the resume, not in its data. */export type ShareSettings = Partial<@@ -123,20 +135,22 @@ export function LinkTab({ resume, offline }: LinkProps) {return (<View style={{ gap: space.s4 }}>{operations.error && <Banner tone="danger" message={operations.error} />}- <ListRow- title={t`Public link`}- subtitle={- resume.isPublic ? t`On. Anyone with the link can see your web page.` : t`Off. Only you can see this resume.`- }- trailing={- <Switch- label={t`Public link`}- value={resume.isPublic}- disabled={disabled}- onValueChange={(value) => void save({ isPublic: value })}- />- }- />+ <ListGroup>+ <ListRow+ title={t`Public link`}+ subtitle={+ resume.isPublic ? t`On. Anyone with the link can see your web page.` : t`Off. Only you can see this resume.`+ }+ trailing={+ <Switch+ label={t`Public link`}+ value={resume.isPublic}+ disabled={disabled}+ onValueChange={(value) => void save({ isPublic: value })}+ />+ }+ />+ </ListGroup><TextFieldlabel={t`Address`}value={slug}diff --git a/apps/mobile/src/features/share/web-page.tsx b/apps/mobile/src/features/share/web-page.tsxindex f7944367f..854be60e7 100644--- a/apps/mobile/src/features/share/web-page.tsx+++ b/apps/mobile/src/features/share/web-page.tsx@@ -104,7 +104,7 @@ export function WebPageSettings({ resume, offline, username, origin, flags, oper{shortLink && (<ListRowtitle={shortLink.replace(/^https?:\/\//, "")}- leading="link"+ leading="link-simple-horizontal"disabled={offline}onPress={() =>void operations.run(async () => {diff --git a/apps/mobile/src/features/workspace/shell.tsx b/apps/mobile/src/features/workspace/shell.tsxindex 76e453b8f..f0f6ea816 100644--- a/apps/mobile/src/features/workspace/shell.tsx+++ b/apps/mobile/src/features/workspace/shell.tsx@@ -23,6 +23,7 @@ import { getStageColor, getStageLabel } from "@/features/applications/stages";import { routes } from "@/routes";import { useWorkspaceChrome } from "@/shell/workspace-chrome";import { Banner, Button, EmptyState, Screen, Text, useTheme } from "@/ui";+import { useKeyboardScrollSpace } from "@/ui/keyboard";export type WorkspaceSearch = { version?: string; speak?: boolean; story?: string };@@ -68,6 +69,7 @@ type WorkspaceScreenProps = { tab: WorkspaceTab; children: (props: WorkspaceTabPexport function WorkspaceScreen({ tab, children }: WorkspaceScreenProps) {const { t } = useLingui();const { space } = useTheme();+ const keyboardSpace = useKeyboardScrollSpace();const router = useRouter();const params = useLocalSearchParams<{ id: string; version?: string; speak?: string; story?: string }>();const id = params.id;@@ -128,6 +130,7 @@ export function WorkspaceScreen({ tab, children }: WorkspaceScreenProps) {<View style={{ flex: 1 }}><Stack.Screen options={{ title: application.company }} /><KeyboardAwareScrollView+ extraKeyboardSpace={keyboardSpace}bottomOffset={space.s6}keyboardShouldPersistTaps="handled"contentInsetAdjustmentBehavior="automatic"diff --git a/apps/mobile/src/features/write/entry-screen.tsx b/apps/mobile/src/features/write/entry-screen.tsxindex e0b12c48a..ebd0cd39b 100644--- a/apps/mobile/src/features/write/entry-screen.tsx+++ b/apps/mobile/src/features/write/entry-screen.tsx@@ -13,12 +13,14 @@ import { describeEntry, getSectionKind, getSectionType, isDraftEntry, PRIMARY_FIimport { RichTextField, RichTextToolbar } from "./rich-text-field";import { useIsResumeLocked, useResumeStore } from "@/draft";import { Banner, EmptyState, IconButton, Text, useTheme } from "@/ui";+import { useKeyboardScrollSpace } from "@/ui/keyboard";type EditorScreenProps = { title: string; backTitle?: string | undefined; right?: ReactNode; children: ReactNode };/** A full-screen editor: scrolls above the keyboard and docks the rich-text toolbar. */export function EditorScreen({ title, backTitle, right, children }: EditorScreenProps) {const { colors, size, space } = useTheme();+ const keyboardSpace = useKeyboardScrollSpace();const ready = useResumeStore((state) => state.document !== null);const locked = useIsResumeLocked();const { t } = useLingui();@@ -35,6 +37,7 @@ export function EditorScreen({ title, backTitle, right, children }: EditorScreen<EmptyState icon="hourglass" title={t`Loading…`} />) : (<KeyboardAwareScrollView+ extraKeyboardSpace={keyboardSpace}keyboardShouldPersistTaps="handled"bottomOffset={size.hit + space.s4}contentContainerStyle={{ padding: space.s4, gap: space.s4, paddingBottom: size.hit * 2 }}diff --git a/apps/mobile/src/features/write/rich-text-field.tsx b/apps/mobile/src/features/write/rich-text-field.tsxindex dee15b3d2..823a71d61 100644--- a/apps/mobile/src/features/write/rich-text-field.tsx+++ b/apps/mobile/src/features/write/rich-text-field.tsx@@ -1,17 +1,19 @@import type { RichTextSession } from "./rich-text";import type { IconName } from "@/ui";-import type { RefObject } from "react";+import type { ComponentRef, RefObject } from "react";import type { EnrichedTextInputInstance, OnChangeStateEvent } from "react-native-enriched-html";import { plural } from "@lingui/core/macro";import { useLingui } from "@lingui/react/macro";import { useEffect, useMemo, useRef, useState, useSyncExternalStore } from "react";import { ScrollView, View } from "react-native";import { EnrichedTextInput } from "react-native-enriched-html";+import { useSafeAreaInsets } from "react-native-safe-area-context";import { ImprovePanel } from "./improve";import { PromptSheet } from "./pickers";import { createRichTextSession, fromEnrichedHtml, lineAtCaret, replaceLine } from "./rich-text";import { resumeFieldFocus } from "@/draft";import { Button, IconButton, ListRow, Sheet, Text, useTheme } from "@/ui";+import { useKeyboardVisible } from "@/ui/keyboard";/** The focused editor, for the toolbar docked above the keyboard (one per screen). */type ActiveEditor = {@@ -72,6 +74,7 @@ export function RichTextField({ label, value, onChange, hint, disabled = false,const ref = useRef<EnrichedTextInputInstance>(null);const [session] = useState(() => createRichTextSession(value));const [focused, setFocused] = useState(false);+ const border = focused ? 2 : 1;const [text, setText] = useState("");const [improving, setImproving] = useState<{ index: number; text: string } | null>(null);const plain = useRef("");@@ -116,76 +119,82 @@ export function RichTextField({ label, value, onChange, hint, disabled = false,{t`Original table formatting is preserved. This content is read-only because it cannot be edited safely.`}</Text>) : null}- <EnrichedTextInput- ref={ref}- accessibilityLabel={label}- // The initial markup only: changing defaultValue reloads the editor and moves the caret.- defaultValue={session.markup}- editable={editable}- autoFocus={autoFocus ?? false}- placeholderTextColor={colors.ink3}- cursorColor={colors.accent}- selectionColor={colors.accentSoft}- linkRegex={null}+ <Viewstyle={{- minHeight: type.bodyLarge.lineHeight * 4 + space.s3 * 2,- maxHeight: 360,- paddingHorizontal: space.s3,- paddingVertical: space.s3,- borderWidth: 1,+ borderWidth: border,borderRadius: radius.rLg,borderColor: focused ? colors.accent : colors.lineStrong,backgroundColor: editable ? colors.raised : colors.sunken,- color: colors.ink,- fontFamily: fonts.ui[400],- fontSize: type.bodyLarge.fontSize,+ overflow: "hidden",}}- htmlStyle={{- a: { color: colors.accentText, textDecorationLine: "underline" },- code: { color: colors.ink, backgroundColor: colors.sunken },- ul: { bulletColor: colors.ink2 },- ol: { markerColor: colors.ink2 },- }}- onFocus={() => {- session.focus();- resumeFieldFocus.onFocus();- setFocused(true);- readBaseline();- editor.current = {- ref,- focused: true,- state: editor.current?.state ?? null,- selection: editor.current?.selection ?? { start: 0, end: 0, text: "" },- canImprove: false,- improve: startImprove,- command: session.command,- };- setActive(editor.current);- }}- onBlur={() => {- session.blur();- resumeFieldFocus.onBlur();- setFocused(false);- publish({ focused: false });- }}- onChangeHtml={(event) => {- const html = session.change(event.nativeEvent.value);- if (html !== null) onChange(html);- }}- onChangeText={(event) => {- plain.current = event.nativeEvent.value;- setText(event.nativeEvent.value);- }}- onChangeState={(event) => publish({ state: event.nativeEvent })}- onChangeSelection={(event) => {- const selection = event.nativeEvent;- publish({- selection,- canImprove: lineAtCaret(plain.current, selection.start) !== null,- improve: startImprove,- });- }}- />+ >+ <EnrichedTextInput+ ref={ref}+ accessibilityLabel={label}+ // The initial markup only: changing defaultValue reloads the editor and moves the caret.+ defaultValue={session.markup}+ editable={editable}+ autoFocus={autoFocus ?? false}+ placeholderTextColor={colors.ink3}+ cursorColor={colors.accent}+ selectionColor={colors.accentSoft}+ linkRegex={null}+ style={{+ minHeight: type.bodyLarge.lineHeight * 4 + space.s3 * 2 - border * 2,+ maxHeight: 360 - border * 2,+ paddingHorizontal: space.s3 - (border - 1),+ paddingVertical: space.s3 - (border - 1),+ color: colors.ink,+ fontFamily: fonts.ui[400],+ fontSize: type.bodyLarge.fontSize,+ }}+ htmlStyle={{+ a: { color: colors.accentText, textDecorationLine: "underline" },+ code: { color: colors.ink, backgroundColor: colors.sunken },+ ul: { bulletColor: colors.ink2 },+ ol: { markerColor: colors.ink2 },+ }}+ onFocus={() => {+ session.focus();+ resumeFieldFocus.onFocus();+ setFocused(true);+ readBaseline();+ editor.current = {+ ref,+ focused: true,+ state: editor.current?.state ?? null,+ selection: editor.current?.selection ?? { start: 0, end: 0, text: "" },+ canImprove: lineAtCaret(plain.current, editor.current?.selection.start ?? 0) !== null,+ improve: startImprove,+ command: session.command,+ };+ setActive(editor.current);+ }}+ onBlur={() => {+ session.blur();+ resumeFieldFocus.onBlur();+ setFocused(false);+ publish({ focused: false });+ }}+ onChangeHtml={(event) => {+ const html = session.change(event.nativeEvent.value);+ if (html !== null) onChange(html);+ }}+ onChangeText={(event) => {+ plain.current = event.nativeEvent.value;+ setText(event.nativeEvent.value);+ }}+ onChangeState={(event) => publish({ state: event.nativeEvent })}+ onChangeSelection={(event) => {+ const selection = event.nativeEvent;+ publish({+ selection,+ canImprove: lineAtCaret(plain.current, selection.start) !== null,+ improve: startImprove,+ });+ }}+ />+ </View>{focused || improving ? (<View style={{ flexDirection: "row", justifyContent: "space-between", gap: space.s3 }}><Text variant="caption" color="ink3" style={{ flex: 1 }}>@@ -227,9 +236,12 @@ type ToolbarButton = { key: string; icon: IconName; label: string; isActive: booexport function RichTextToolbar() {const { t } = useLingui();const { colors, size, space } = useTheme();+ const insets = useSafeAreaInsets();+ const keyboardVisible = useKeyboardVisible();const editor = useActiveEditor();const [linkOpen, setLinkOpen] = useState(false);const [styleOpen, setStyleOpen] = useState(false);+ const formattingScroll = useRef<ComponentRef<typeof ScrollView>>(null);// The last focused editor stays active after blur, so sheets keep working on it after taking focus.const target = () => {editor?.command();@@ -247,20 +259,6 @@ export function RichTextToolbar() {isActive: state?.italic.isActive,run: () => target()?.toggleItalic(),},- {- key: "u",- icon: "text-underline",- label: t`Underline`,- isActive: state?.underline.isActive,- run: () => target()?.toggleUnderline(),- },- {- key: "s",- icon: "text-strikethrough",- label: t`Strikethrough`,- isActive: state?.strikeThrough.isActive,- run: () => target()?.toggleStrikeThrough(),- },{key: "ul",icon: "list-bullets",@@ -290,6 +288,22 @@ export function RichTextToolbar() {run: () => setStyleOpen(true),},];+ const marks: ToolbarButton[] = [+ {+ key: "u",+ icon: "text-underline",+ label: t`Underline`,+ isActive: state?.underline.isActive,+ run: () => target()?.toggleUnderline(),+ },+ {+ key: "s",+ icon: "text-strikethrough",+ label: t`Strikethrough`,+ isActive: state?.strikeThrough.isActive,+ run: () => target()?.toggleStrikeThrough(),+ },+ ];const setHeading = (level: number) => {const input = target();@@ -317,13 +331,20 @@ export function RichTextToolbar() {style={{flexDirection: "row",alignItems: "center",- minHeight: size.hit + 2,+ minHeight: size.hit + space.s1 * 2 + (keyboardVisible ? 0 : insets.bottom),+ paddingBottom: keyboardVisible ? 0 : insets.bottom,borderTopWidth: 1,borderTopColor: colors.line,backgroundColor: colors.raised,}}>- <ScrollView horizontal keyboardShouldPersistTaps="always" showsHorizontalScrollIndicator={false}>+ <ScrollView+ ref={formattingScroll}+ horizontal+ keyboardShouldPersistTaps="always"+ persistentScrollbar+ onLayout={() => formattingScroll.current?.flashScrollIndicators()}+ ><View style={{ flexDirection: "row", alignItems: "center", paddingHorizontal: space.s1 }}>{buttons.map((button) => (<IconButton@@ -334,14 +355,16 @@ export function RichTextToolbar() {onPress={button.run}/>))}- <IconButton- icon="sparkle"- label={t`Improve selected line`}- disabled={!editor.canImprove}- onPress={editor.improve}- /></View></ScrollView>+ <View style={{ borderStartWidth: 1, borderStartColor: colors.line }}>+ <IconButton+ icon="sparkle"+ label={t`Improve selected line`}+ disabled={!editor.canImprove}+ onPress={editor.improve}+ />+ </View><Button variant="link" label={t`Done`} onPress={() => editor?.ref.current?.blur()} /><View style={{ width: space.s3 }} /></View>@@ -365,6 +388,19 @@ export function RichTextToolbar() {}}/><Sheet open={styleOpen} onClose={() => setStyleOpen(false)} title={t`Text style`}>+ {marks.map((mark) => (+ <ListRow+ key={mark.key}+ title={mark.label}+ leading={mark.icon}+ selected={mark.isActive ?? false}+ onPress={() => {+ mark.run();+ setStyleOpen(false);+ editor?.ref.current?.focus();+ }}+ />+ ))}{[{ level: 0, icon: "paragraph" as const, label: t`Paragraph` },{ level: 1, icon: "text-h-one" as const, label: t`Heading 1` },diff --git a/apps/mobile/src/shell/app-tabs.tsx b/apps/mobile/src/shell/app-tabs.tsxindex f3e13ce83..dffc59263 100644--- a/apps/mobile/src/shell/app-tabs.tsx+++ b/apps/mobile/src/shell/app-tabs.tsx@@ -5,7 +5,6 @@ import { useLingui } from "@lingui/react/macro";import { useRouter, usePathname } from "expo-router";import { Children, useEffect, useState } from "react";import { I18nManager, Platform, Pressable, ScrollView, View, useWindowDimensions } from "react-native";-import { useKeyboardState } from "react-native-keyboard-controller";import Animated, {useAnimatedStyle,useSharedValue,@@ -16,6 +15,7 @@ import Animated, {import { useSafeAreaInsets } from "react-native-safe-area-context";import { routes } from "@/routes";import { Button, Icon, IconButton, Text, haptics, useReducedMotion, useTheme } from "@/ui";+import { useKeyboardVisible } from "@/ui/keyboard";/** The tab routes of `app/(tabs)`, in tab-bar order. `create` is the raised "+" that opens New. */const appTabIcons: Record<string, IconName> = {@@ -125,15 +125,16 @@ export function BarItem({ label, icon, focused, onPress, badge, badgeTone = "accflex: 1,minHeight: android ? androidTabHeight : size.tabBar,alignItems: "center",- justifyContent: "center",+ justifyContent: "flex-start",gap: space.s0,- paddingVertical: space.s1,- paddingHorizontal: space.s0,+ paddingTop: space.s2,+ paddingBottom: space.s1,+ paddingHorizontal: space.s1,backgroundColor: pressed && !android ? colors.press : "transparent",})}>{icon ? (- <View style={{ alignItems: "center", justifyContent: "center" }}>+ <View style={{ height: size.newPill.height, alignItems: "center", justifyContent: "center" }}><Icon name={icon} filled={focused} color={focused ? colors.ink : colors.ink2} size={size.icon.bar} />{badge === undefined ? null : <TabBadge value={badge} tone={badgeTone} />}</View>@@ -150,7 +151,16 @@ export function BarItem({ label, icon, focused, onPress, badge, badgeTone = "acc<Icon name="plus" color={colors.onAccent} size={size.icon.row} /></View>)}- <Text variant="micro" color={focused ? "ink" : "ink2"} align="center" style={{ alignSelf: "stretch" }}>+ <Text+ variant="micro"+ color={focused ? "ink" : "ink2"}+ align="center"+ // Fit long words within a cell; translated phrases can still wrap at spaces.+ numberOfLines={label.split(" ").length}+ adjustsFontSizeToFit+ minimumFontScale={0.7}+ style={{ alignSelf: "stretch" }}+ >{label}</Text></Pressable>@@ -226,7 +236,7 @@ type BarProps = {export function Bar({ children, activeIndex }: BarProps) {const insets = useSafeAreaInsets();const { colors } = useTheme();- const keyboardVisible = useKeyboardState((keyboard) => keyboard.isVisible);+ const keyboardVisible = useKeyboardVisible();const [width, setWidth] = useState(0);const count = Children.count(children);@@ -258,7 +268,7 @@ export function Bar({ children, activeIndex }: BarProps) {/*** The phone tab bar (app.html): five cells, the active tab with a filled icon and the `accent` 28×3 marker on the top* rule (both platforms), and the raised "+" pill in the middle. Labels stay under the icons at every text- * size (`micro` caps its scale); the bar grows taller instead of truncating.+ * size (`micro` caps its scale); phrases wrap and long words fit within their cells.*/export function PhoneTabBar(props: BottomTabBarProps) {const { t } = useLingui();diff --git a/apps/mobile/src/shell/builder-chrome.tsx b/apps/mobile/src/shell/builder-chrome.tsxindex bd63beeda..44fbcf441 100644--- a/apps/mobile/src/shell/builder-chrome.tsx+++ b/apps/mobile/src/shell/builder-chrome.tsx@@ -6,7 +6,6 @@ import { useLingui } from "@lingui/react/macro";import { useRouter, Stack, useNavigation, useSegments } from "expo-router";import { createContext, use, useEffect, useState } from "react";import { ActivityIndicator, I18nManager, Platform, Pressable, View } from "react-native";-import { KeyboardAvoidingView } from "react-native-keyboard-controller";import { SafeAreaInsetsContext, useSafeAreaInsets } from "react-native-safe-area-context";import { AppStrip } from "./app-banner";import { Bar, BarItem } from "./app-tabs";@@ -16,6 +15,7 @@ import { TopBar } from "./top-bar";import { useIsTablet } from "./use-is-tablet";import { routes } from "@/routes";import { Button, Icon, IconButton, Segmented, Text, useReducedMotion, useTheme } from "@/ui";+import { KeyboardFrame, useKeyboardVisible } from "@/ui/keyboard";export type SaveStatusSlot = {status: SaveStatus;@@ -113,6 +113,7 @@ function Frame<T extends string>({ panes, tabletPanes, page, title, onExport, moconst tablet = useIsTablet();const navigation = useNavigation();const insets = useSafeAreaInsets();+ const keyboardVisible = useKeyboardVisible();const { colors, size } = useTheme();const reduced = useReducedMotion();const current = useSegments().at(-1);@@ -163,6 +164,7 @@ function Frame<T extends string>({ panes, tabletPanes, page, title, onExport, moleave: () => (navigation.canGoBack() ? navigation.goBack() : router.replace(routes.documents())),modes: activePane ? (<Segmented+ compactlabel={t`Editor mode`}value={activePane.pane}options={shownPanes.map(({ pane, label, icon }) => ({ value: pane, label, icon }))}@@ -178,7 +180,7 @@ function Frame<T extends string>({ panes, tabletPanes, page, title, onExport, mo<FrameContext value={frame}><View style={{ flex: 1, backgroundColor: colors.bg }}>{tablet ? <ChromeTopBar /> : null}- <KeyboardAvoidingView+ <KeyboardFramebehavior="padding"automaticOffsetstyle={{ flex: 1, paddingLeft: insets.left, paddingRight: insets.right }}@@ -200,7 +202,11 @@ function Frame<T extends string>({ panes, tabletPanes, page, title, onExport, mo><StackscreenOptions={({ route }) => {- if (!paneNames.has(route.name)) return { headerTransparent: false };+ if (!paneNames.has(route.name))+ return {+ headerTransparent: false,+ unstable_nativeProps: { headerConfig: { disableTopInsetApplication: tablet } },+ };const animation = reduced ? "fade" : paneAnimation;return tablet ? { headerShown: false, animation } : { header: () => <ChromeTopBar />, animation };}}@@ -214,11 +220,13 @@ function Frame<T extends string>({ panes, tabletPanes, page, title, onExport, mo))}</Stack></View>- {tablet && page ? <View style={{ flex: 1, paddingBottom: insets.bottom }}>{page}</View> : null}+ {tablet && page ? (+ <View style={{ flex: 1, paddingBottom: keyboardVisible ? 0 : insets.bottom }}>{page}</View>+ ) : null}</View>{!tablet && barPane ? <PaneBar panes={panes} active={barPane.pane} onSwitch={switchPane} /> : null}</SafeAreaInsetsContext>- </KeyboardAvoidingView>+ </KeyboardFrame></View></FrameContext>);@@ -297,7 +305,11 @@ type ExportButtonProps = {function ExportButton({ tablet, onPress }: ExportButtonProps) {const { t } = useLingui();if (tablet)- return <Button variant="secondary" size="sm" icon="download-simple" label={t`Download`} onPress={onPress} />;+ return (+ <View>+ <Button variant="secondary" size="sm" icon="download-simple" label={t`Download`} onPress={onPress} />+ </View>+ );return <IconButton icon="download-simple" label={t`Download & history`} onPress={onPress} />;}@@ -331,11 +343,13 @@ function SaveStatusLine({ status, locked, onRetry }: SaveStatusLineProps) {accessibilityLiveRegion="polite"style={{ flexDirection: "row", alignItems: "center", gap: space.s1, minWidth: 0 }}>- {look.icon ? (- <Icon name={look.icon} size={size.icon.meta} color={colors[look.color]} />- ) : (- <ActivityIndicator size="small" color={colors.ink3} style={{ transform: [{ scale: 0.7 }] }} />- )}+ <View style={{ width: size.icon.meta, height: size.icon.meta, alignItems: "center", justifyContent: "center" }}>+ {look.icon ? (+ <Icon name={look.icon} size={size.icon.meta} color={colors[look.color]} />+ ) : (+ <ActivityIndicator size="small" color={colors.ink3} style={{ transform: [{ scale: 0.7 }] }} />+ )}+ </View><Text variant="caption" color={look.color} numberOfLines={1} style={{ flexShrink: 1 }}>{label}</Text>diff --git a/apps/mobile/src/shell/top-bar.tsx b/apps/mobile/src/shell/top-bar.tsxindex a2271d25d..737da9c4c 100644--- a/apps/mobile/src/shell/top-bar.tsx+++ b/apps/mobile/src/shell/top-bar.tsx@@ -86,10 +86,20 @@ export function TopBar({ backLabel, onBack, title, onTitlePress, titleLabel, sub)}{subtitle}</View>- {tablet ? <View style={{ flex: 1, alignItems: "center" }}>{stackedModes ? null : center}</View> : null}+ {tablet ? (+ <View+ style={{+ flexGrow: 1,+ alignItems: "center",+ paddingHorizontal: center && !stackedModes ? space.s4 : 0,+ }}+ >+ {stackedModes ? null : center}+ </View>+ ) : null}<View style={{ flexDirection: "row", alignItems: "center", gap: tablet ? space.s2 : 0 }}>{actions}</View></View>- {stackedModes ? <View style={{ paddingBottom: space.s2 }}>{center}</View> : null}+ {stackedModes ? <View style={{ alignItems: "center", paddingVertical: space.s2 }}>{center}</View> : null}</View>);}diff --git a/apps/mobile/src/shell/workspace-chrome.tsx b/apps/mobile/src/shell/workspace-chrome.tsxindex 58054d093..7caf73aa6 100644--- a/apps/mobile/src/shell/workspace-chrome.tsx+++ b/apps/mobile/src/shell/workspace-chrome.tsx@@ -4,7 +4,6 @@ import { useLingui } from "@lingui/react/macro";import { useRouter, useGlobalSearchParams, useLocalSearchParams, useNavigation } from "expo-router";import { useEffect, useRef, useState } from "react";import { Pressable, ScrollView, View } from "react-native";-import { KeyboardAvoidingView } from "react-native-keyboard-controller";import { SafeAreaInsetsContext, useSafeAreaInsets } from "react-native-safe-area-context";import { WORKSPACE_TABS } from "@reactive-resume/schema/career";import { createSlot } from "./slot";@@ -12,6 +11,7 @@ import { TopBar } from "./top-bar";import { useIsTablet } from "./use-is-tablet";import { routes } from "@/routes";import { IconButton, Text, useTheme } from "@/ui";+import { KeyboardFrame } from "@/ui/keyboard";/** What workspace tabs put into the application chrome with `useWorkspaceChrome`. */export type WorkspaceChromeSlots = {@@ -181,7 +181,7 @@ function Frame({ children }: { children: ReactNode }) {)}</View>{slots.banner}- <KeyboardAvoidingView+ <KeyboardFramebehavior="padding"automaticOffsetstyle={{ flex: 1, flexDirection: "row", paddingLeft: insets.left, paddingRight: insets.right }}@@ -201,7 +201,7 @@ function Frame({ children }: { children: ReactNode }) {<SafeAreaInsetsContext value={{ ...insets, left: 0, right: 0, top: 0 }}><View style={{ flex: 1 }}>{children}</View></SafeAreaInsetsContext>- </KeyboardAvoidingView>+ </KeyboardFrame></View>);}diff --git a/apps/mobile/src/ui/fields.tsx b/apps/mobile/src/ui/fields.tsxindex 1d39cc8a3..1dc4ffc48 100644--- a/apps/mobile/src/ui/fields.tsx+++ b/apps/mobile/src/ui/fields.tsx@@ -314,6 +314,8 @@ export type SegmentedProps<T extends string> = {/** The accessible name of the group. */label?: string | undefined;orientation?: "horizontal" | "vertical";+ /** Size horizontal choices to their content instead of filling the row. */+ compact?: boolean;};type SegmentProps = {@@ -322,9 +324,10 @@ type SegmentProps = {active: boolean;onPress: () => void;stacked: boolean;+ compact: boolean;};-function Segment({ label, icon, active, onPress, stacked }: SegmentProps) {+function Segment({ label, icon, active, onPress, stacked, compact }: SegmentProps) {const { colors, motion, radius, shadows, size, space } = useTheme();const shown = useSharedValue(active ? 1 : 0);@@ -343,7 +346,7 @@ function Segment({ label, icon, active, onPress, stacked }: SegmentProps) {// 40 pt inside the track's 2 pt padding; the slop brings the target to 44.hitSlop={{ top: space.s0, bottom: space.s0 }}style={{- flex: stacked ? undefined : 1,+ flex: stacked || compact ? undefined : 1,minHeight: size.hit - space.s0 * 2,flexDirection: "row",alignItems: "center",@@ -382,6 +385,7 @@ export function Segmented<T extends string>({onChange,label,orientation = "horizontal",+ compact = false,}: SegmentedProps<T>) {const { colors, radius, space } = useTheme();const stacked = orientation === "vertical";@@ -405,6 +409,7 @@ export function Segmented<T extends string>({icon={option.icon}active={option.value === value}stacked={stacked}+ compact={compact}onPress={() => {if (option.value === value) return;haptics.selection();diff --git a/apps/mobile/src/ui/keyboard.tsx b/apps/mobile/src/ui/keyboard.tsxnew file mode 100644index 000000000..82608e93b--- /dev/null+++ b/apps/mobile/src/ui/keyboard.tsx@@ -0,0 +1,41 @@+import type { KeyboardAvoidingViewProps } from "react-native-keyboard-controller";+import { createContext, use, useState } from "react";+import {+ KeyboardAvoidingView,+ useKeyboardState,+ useReanimatedKeyboardAnimation,+} from "react-native-keyboard-controller";+import { useAnimatedReaction } from "react-native-reanimated";+import { scheduleOnRN } from "react-native-worklets";++const ResizedKeyboard = createContext(false);++export function useKeyboardVisible() {+ const { height } = useReanimatedKeyboardAnimation();+ const [visible, setVisible] = useState(false);+ // Android activity recreation resets native height but can leave keyboard-event caches visible.+ useAnimatedReaction(+ () => height.get() !== 0,+ (next, previous) => {+ if (next !== previous) scheduleOnRN(setVisible, next);+ },+ [height],+ );+ return visible;+}++export function KeyboardFrame(props: KeyboardAvoidingViewProps) {+ // Native modals outside this resized viewport must not inherit its keyboard-space cancellation.+ return (+ <ResizedKeyboard value>+ <KeyboardAvoidingView {...props} />+ </ResizedKeyboard>+ );+}++export function useKeyboardScrollSpace() {+ const resized = use(ResizedKeyboard);+ const height = useKeyboardState((keyboard) => keyboard.height);+ // A resized viewport already clears the keyboard; keep focus scrolling without adding its height twice.+ return resized ? -height : 0;+}diff --git a/apps/mobile/src/ui/layout.tsx b/apps/mobile/src/ui/layout.tsxindex 5c3a6ea00..8913a7289 100644--- a/apps/mobile/src/ui/layout.tsx+++ b/apps/mobile/src/ui/layout.tsx@@ -76,6 +76,18 @@ export function ListRow({// ink3 is too light on selectedFill (tokens.md §1); secondary text uses ink2 there.const quiet: ColorToken = selected ? "ink2" : "ink3";const pressable = !!onPress || !!onLongPress;+ const Container = pressable ? Pressable : View;+ const rowStyle = (pressed: boolean): ViewStyle => ({+ minHeight: subtitle ? size.row + space.s3 : android ? size.row + space.s1 : size.row,+ flexDirection: stacked ? "column" : "row",+ alignItems: stacked ? "stretch" : "center",+ gap: stacked ? space.s2 : android ? space.s4 : space.s3,+ paddingVertical: space.s2,+ paddingStart: space.s4,+ paddingEnd: android ? space.s4 : space.s3,+ backgroundColor: pressed && !android ? colors.press : selected ? colors.selectedFill : "transparent",+ opacity: disabled ? 0.45 : 1,+ });const leadingGraphic =typeof leading === "string" ? (<Icon name={leading as IconName} size={size.icon.row} color={colors[tone === "ink" ? "ink2" : tone]} />@@ -105,11 +117,12 @@ export function ListRow({);return (- <Pressable+ <Container+ accessible={pressable || trailing === undefined}accessibilityRole={pressable ? "button" : undefined}accessibilityState={{ disabled: !!disabled, selected: !!selected }}accessibilityHint={accessibilityHint}- disabled={disabled || !pressable}+ disabled={disabled}onPress={onPress}onLongPress={onLongPress@@ -120,17 +133,7 @@ export function ListRow({: undefined}android_ripple={pressable ? { color: colors.press } : undefined}- style={({ pressed }) => ({- minHeight: subtitle ? size.row + space.s3 : android ? size.row + space.s1 : size.row,- flexDirection: stacked ? "column" : "row",- alignItems: stacked ? "stretch" : "center",- gap: stacked ? space.s2 : android ? space.s4 : space.s3,- paddingVertical: space.s2,- paddingStart: space.s4,- paddingEnd: android ? space.s4 : space.s3,- backgroundColor: pressed && !android ? colors.press : selected ? colors.selectedFill : "transparent",- opacity: disabled ? 0.45 : 1,- })}+ style={pressable ? ({ pressed }) => rowStyle(pressed) : rowStyle(false)}>{divider && !android ? (<View@@ -174,7 +177,7 @@ export function ListRow({{indicators}</>)}- </Pressable>+ </Container>);}diff --git a/apps/mobile/src/ui/text.tsx b/apps/mobile/src/ui/text.tsxindex 28956b4db..b90e59a17 100644--- a/apps/mobile/src/ui/text.tsx+++ b/apps/mobile/src/ui/text.tsx@@ -1,8 +1,10 @@import type { ColorToken, type as typeScale } from "./tokens";import type { ReactNode } from "react";import type { TextProps as NativeTextProps, StyleProp, ViewProps, ViewStyle } from "react-native";-import { RefreshControl, ScrollView, Text as NativeText, View } from "react-native";+import { RefreshControl, Text as NativeText, View } from "react-native";+import { KeyboardAwareScrollView } from "react-native-keyboard-controller";import { useSafeAreaInsets } from "react-native-safe-area-context";+import { useKeyboardScrollSpace } from "./keyboard";import { useTheme } from "./theme";import { usePullRefresh } from "./use-pull-refresh";@@ -57,6 +59,7 @@ export type ScreenProps = {export function Screen({ children, scroll = true, edges = [], contentStyle, onLayout, onRefresh }: ScreenProps) {const { colors, space } = useTheme();const insets = useSafeAreaInsets();+ const keyboardSpace = useKeyboardScrollSpace();const pull = usePullRefresh(...(onRefresh ? [onRefresh] : []));const padding = [{ padding: space.s4, gap: space.s4 }, contentStyle];@@ -72,8 +75,11 @@ export function Screen({ children, scroll = true, edges = [], contentStyle, onLa}}>{scroll ? (- <ScrollView+ <KeyboardAwareScrollView+ extraKeyboardSpace={keyboardSpace}onLayout={onLayout}+ bottomOffset={space.s4}+ keyboardShouldPersistTaps="handled"contentInsetAdjustmentBehavior="automatic"contentContainerStyle={padding}alwaysBounceVertical@@ -82,7 +88,7 @@ export function Screen({ children, scroll = true, edges = [], contentStyle, onLa}>{children}- </ScrollView>+ </KeyboardAwareScrollView>) : (<View onLayout={onLayout} style={[{ flex: 1 }, padding]}>{children}diff --git a/packages/api/src/context.test.ts b/packages/api/src/context.test.tsindex 488cc18b6..bc8722bb9 100644--- a/packages/api/src/context.test.ts+++ b/packages/api/src/context.test.ts@@ -21,8 +21,12 @@ vi.mock("@reactive-resume/auth/config", () => ({vi.mock("@reactive-resume/db/client", () => ({ db: dbMock }));vi.mock("@reactive-resume/db/schema", () => ({ user: { __table: "user" } }));vi.mock("drizzle-orm", () => ({ eq: () => "EQ" }));+vi.mock("@reactive-resume/env/server", async (importOriginal) => {+ const { env } = await importOriginal<typeof import("@reactive-resume/env/server")>();+ return { env: { ...env, APP_ALIAS_URL: "https://rx.cv" } };+});-const { resolveUserFromRequestHeaders, resolveAuthenticationFromRequestHeaders, protectedProcedure } =+const { resolveUserFromRequestHeaders, resolveAuthenticationFromRequestHeaders, publicProcedure, protectedProcedure } =await import("./context");const setupDbResolves = (userResult: unknown) => {@@ -80,16 +84,40 @@ describe("resolveUserFromRequestHeaders", () => {});describe("cookie request origins", () => {- it.each([{ origin: "https://attacker.example" }, { origin: "null" }, { "sec-fetch-site": "cross-site" }])(- "rejects ambient credentials from another origin: %j",- async (originHeaders) => {- reset();- authMock.api.getSession.mockResolvedValue({ user: { id: "owner" } });- const headers = new Headers({ cookie: "session=valid", ...originHeaders });- await expect(resolveUserFromRequestHeaders(headers)).rejects.toMatchObject({ code: "FORBIDDEN" });- expect(authMock.api.getSession).not.toHaveBeenCalled();- },- );+ it.each([+ { origin: "https://attacker.example" },+ { origin: "null" },+ { "sec-fetch-site": "cross-site" },+ { origin: "https://rx.cv", "sec-fetch-site": "cross-site" },+ { origin: "https://rx.cv.attacker.example", "sec-fetch-site": "same-origin" },+ { origin: "http://rx.cv", "sec-fetch-site": "same-origin" },+ { origin: "https://rx.cv:8443", "sec-fetch-site": "same-origin" },+ ])("rejects ambient credentials from another origin: %j", async (originHeaders) => {+ reset();+ authMock.api.getSession.mockResolvedValue({ user: { id: "owner" } });+ const headers = new Headers({ cookie: "session=valid", ...originHeaders });+ await expect(resolveUserFromRequestHeaders(headers)).rejects.toMatchObject({ code: "FORBIDDEN" });+ expect(authMock.api.getSession).not.toHaveBeenCalled();+ });++ it("serves anonymous public procedures on the alias when incidental cookies are present", async () => {+ reset();+ authMock.api.getSession.mockResolvedValue(null);+ const context = {+ locale: "en-US" as const,+ reqHeaders: new Headers({ cookie: "theme=dark", origin: "https://rx.cv", "sec-fetch-site": "same-origin" }),+ };+ const publicOperation = createProcedureClient(+ publicProcedure.handler(({ context }) => context.user),+ { context },+ );+ await expect(publicOperation(undefined)).resolves.toBeNull();+ const protectedOperation = createProcedureClient(+ protectedProcedure.handler(() => "private"),+ { context },+ );+ await expect(protectedOperation(undefined)).rejects.toMatchObject({ code: "UNAUTHORIZED" });+ });it("accepts same-origin cookies and explicit bearer credentials from other origins", async () => {reset();diff --git a/packages/api/src/context.ts b/packages/api/src/context.tsindex adfb18dba..00d73031f 100644--- a/packages/api/src/context.ts+++ b/packages/api/src/context.ts@@ -25,6 +25,8 @@ interface ORPCContext {}const TRUSTED_ORIGINS = getTrustedOrigins(env.APP_URL);+// Public pages on the alias call the same API, including when incidental cookies are present.+if (env.APP_ALIAS_URL) TRUSTED_ORIGINS.push(new URL(env.APP_ALIAS_URL).origin);const fullPermissions: readonly RequestPermission[] = ["read", "write", "delete"];async function findActiveUser(id: string): Promise<User | null> {diff --git a/packages/api/src/features/applications/service.test.ts b/packages/api/src/features/applications/service.test.tsindex 75c3a6a59..12bcc1cd1 100644--- a/packages/api/src/features/applications/service.test.ts+++ b/packages/api/src/features/applications/service.test.ts@@ -235,6 +235,34 @@ describe("applicationService sent resume", () => {},);+ it.each([{ notes: "Private interview note" }, { role: "Senior Engineer" }])(+ "does not record linked drafts as submitted during metadata edits: %j",+ async (fields) => {+ const data = structuredClone((await import("@reactive-resume/schema/resume/default")).defaultResumeData);+ setSelectResults([sentRow], [{ id: "user-1" }], [sentRow], [{ id: "resume-1", data }]);+ dbMock.update.mockReturnValue({+ set: () => ({ where: () => ({ returning: () => Promise.resolve([sentRow]) }) }),+ });++ const result = await applicationService.update({ id: sentRow.id, userId: sentRow.userId, ...fields });++ expect(writeVersionMock).not.toHaveBeenCalled();+ expect(result.sentResumeVersionId).toBeNull();+ },+ );++ it("does not record linked drafts as submitted when bulk-adding tags", async () => {+ const data = structuredClone((await import("@reactive-resume/schema/resume/default")).defaultResumeData);+ setSelectResults([{ id: "user-1" }], [{ id: "resume-1", data }]);+ dbMock.update.mockReturnValue({+ set: () => ({ where: () => ({ returning: () => Promise.resolve([sentRow]) }) }),+ });++ await applicationService.bulkUpdate({ userId: sentRow.userId, ids: [sentRow.id], addTags: ["priority"] });++ expect(writeVersionMock).not.toHaveBeenCalled();+ });+it("saves it once, and not before the application is sent", async () => {setSelectResults([existing], [{ id: "user-1" }], [existing], [existing], [{ id: "user-1" }], [existing]);const set = vi.fn(() => ({diff --git a/packages/api/src/features/applications/service.ts b/packages/api/src/features/applications/service.tsindex e54848832..a780f9955 100644--- a/packages/api/src/features/applications/service.ts+++ b/packages/api/src/features/applications/service.ts@@ -712,7 +712,12 @@ export const applicationService = {.returning();if (!updated) throw new ORPCError("NOT_FOUND");- return stripUserId(await recordSentResume(updated, tx));+ // Editing metadata must not mark a linked draft as submitted.+ const result =+ status !== undefined || fields.resumeId !== undefined || fields.coverLetterId !== undefined+ ? await recordSentResume(updated, tx)+ : updated;+ return stripUserId(result);});if (fields.resumeFileUrl !== undefined || fields.coverLetterUrl !== undefined || resumeFile || coverLetterFile) {await deleteApplicationAttachments(userId, [existing]).catch(() => {});@@ -992,7 +997,9 @@ export const applicationService = {.where(scope).returning();- for (const row of rows) await recordSentResume(row, tx);+ if (input.status !== undefined) {+ for (const row of rows) await recordSentResume(row, tx);+ }return { updated: rows.length };});},