From 53522ecc5bcd81cba2f3f755c22105824f6bd5f7 Mon Sep 17 00:00:00 2001 From: Jackson Miller Date: Sun, 1 Nov 2026 14:33:57 -0500 Subject: [PATCH] fix(mobile): J5's sheets follow the app theme in dark mode The archive warning opened as a light sheet in dark mode, with its title and summary nearly invisible. Its surface was a className on react-native-safe-area-context's SafeAreaView, which uniwind doesn't theme, so the class was dropped and the Modal stayed white. Seven more J5 sheets had the same pattern, and some lost their flex-1 the same way. Every J5 sheet now puts its surface and flex on a View around the SafeAreaView, as upstream's sheets do, and the playbook sheets use mobile's colour names instead of web's. Closes #868 Co-Authored-By: Claude Opus 5.5 --- .../mobile/src/j5/agents/AgentCreateModal.tsx | 228 +++++++++--------- .../mobile/src/j5/agents/AgentEditorModal.tsx | 182 +++++++------- .../src/j5/agents/AgentFolderPickerModal.tsx | 145 +++++------ .../j5/agents/AgentImportConflictModal.tsx | 99 ++++---- .../src/j5/archive/ArchiveWarningSheet.tsx | 45 ++-- .../playbooks/PlaybookConversationModal.tsx | 97 ++++---- .../PlaybookLibrarySettingsScreen.tsx | 200 +++++++-------- apps/mobile/src/j5/sharing/NameQuestion.tsx | 132 +++++----- 8 files changed, 579 insertions(+), 549 deletions(-) diff --git a/apps/mobile/src/j5/agents/AgentCreateModal.tsx b/apps/mobile/src/j5/agents/AgentCreateModal.tsx index d2bc9a60cf67e..e04a3e7dc2d95 100644 --- a/apps/mobile/src/j5/agents/AgentCreateModal.tsx +++ b/apps/mobile/src/j5/agents/AgentCreateModal.tsx @@ -112,124 +112,126 @@ export function AgentCreateModal(props: { if (!saving) props.onClose(); }} > - {/* Inline flex: on Android a `flex-1` class left this Modal's content zero-height. */} - - - - - {props.initial ? "Duplicate persona" : "Create persona"} - - - Cancel - - - + + - - A personal persona for this environment. It joins the library like an import, so you - can edit, switch off, or remove it later. - - - Name - - setDraft({ - ...draft, - displayName, - id: draft.idEdited ? draft.id : agentPersonaIdFromName(displayName), - }) - } - /> - - - ID - setDraft({ ...draft, id: id.trim(), idEdited: true })} - /> - - {draft.id !== "" && idError !== null - ? idError - : "Stable identifier used in @persona: mentions. Lowercase letters, digits, hyphens."} - - - - Description - setDraft({ ...draft, description })} - /> - - - Instructions - setDraft({ ...draft, instructions })} - /> - - Markdown. Instructions describe behavior; the runtime policy below is what is - enforced. + + + {props.initial ? "Duplicate persona" : "Create persona"} - - {modelRoute === null ? ( - - Sign in to Codex or Claude on this environment to choose the persona's models. - - ) : ( - setDraft({ ...draft, ...next })} - /> - )} - {error ? ( - - {error} - - ) : null} - void submit()} + onPress={props.onClose} + className="px-3 py-2" + > + Cancel + + + - - {saving ? "Creating…" : "Create persona"} + + A personal persona for this environment. It joins the library like an import, so you + can edit, switch off, or remove it later. - - - - + + Name + + setDraft({ + ...draft, + displayName, + id: draft.idEdited ? draft.id : agentPersonaIdFromName(displayName), + }) + } + /> + + + ID + setDraft({ ...draft, id: id.trim(), idEdited: true })} + /> + + {draft.id !== "" && idError !== null + ? idError + : "Stable identifier used in @persona: mentions. Lowercase letters, digits, hyphens."} + + + + Description + setDraft({ ...draft, description })} + /> + + + Instructions + setDraft({ ...draft, instructions })} + /> + + Markdown. Instructions describe behavior; the runtime policy below is what is + enforced. + + + {modelRoute === null ? ( + + Sign in to Codex or Claude on this environment to choose the persona's models. + + ) : ( + setDraft({ ...draft, ...next })} + /> + )} + {error ? ( + + {error} + + ) : null} + void submit()} + > + + {saving ? "Creating…" : "Create persona"} + + + + + + ); } diff --git a/apps/mobile/src/j5/agents/AgentEditorModal.tsx b/apps/mobile/src/j5/agents/AgentEditorModal.tsx index 5036e6a064e51..64da2034622af 100644 --- a/apps/mobile/src/j5/agents/AgentEditorModal.tsx +++ b/apps/mobile/src/j5/agents/AgentEditorModal.tsx @@ -77,100 +77,102 @@ export function AgentEditorModal(props: { if (!saving) props.onClose(); }} > - {/* Inline flex: on Android a `flex-1` class left this Modal's content zero-height. */} - - - - Edit persona - - Cancel - - - + + - - Changes apply to this imported copy and future launches. The original file and - existing tasks stay unchanged. - - - Name - setDraft({ ...draft, displayName })} - /> + + Edit persona + + Cancel + - - Description - setDraft({ ...draft, description })} - /> - - - Instructions - - - Markdown. Instructions describe behavior; the runtime policy below is what is - enforced. - - - setDraft({ ...draft, ...next })} - /> - {error ? ( - - {error} - - ) : null} - void submit()} + - - {saving ? "Saving…" : "Save changes"} + + Changes apply to this imported copy and future launches. The original file and + existing tasks stay unchanged. - - - - + + Name + setDraft({ ...draft, displayName })} + /> + + + Description + setDraft({ ...draft, description })} + /> + + + Instructions + + + Markdown. Instructions describe behavior; the runtime policy below is what is + enforced. + + + setDraft({ ...draft, ...next })} + /> + {error ? ( + + {error} + + ) : null} + void submit()} + > + + {saving ? "Saving…" : "Save changes"} + + + + + + ); } diff --git a/apps/mobile/src/j5/agents/AgentFolderPickerModal.tsx b/apps/mobile/src/j5/agents/AgentFolderPickerModal.tsx index 5be7398f1b7b0..170eb119b478b 100644 --- a/apps/mobile/src/j5/agents/AgentFolderPickerModal.tsx +++ b/apps/mobile/src/j5/agents/AgentFolderPickerModal.tsx @@ -64,80 +64,85 @@ export function AgentFolderPickerModal(props: { presentationStyle="pageSheet" onRequestClose={props.onClose} > - {/* Inline flex: on Android a `flex-1` class left this Modal's content zero-height. */} - - - - Choose a library folder - - Cancel - - - - - Folders on {props.environmentLabel}. Open a folder to browse into it, then choose it. - - - - + + - {browsePath.canBrowseUp && browsePath.parentPath ? ( - setPathInput(browsePath.parentPath!)} + + Choose a library folder + + Cancel + + + + + Folders on {props.environmentLabel}. Open a folder to browse into it, then choose + it. + + - ) : null} - {browseState.error ? ( - {browseState.error} - ) : browseState.isPending && browseState.data === null ? ( - - - - ) : visibleEntries.length === 0 ? ( - No subfolders. - ) : ( - visibleEntries.map((entry) => ( + + + {browsePath.canBrowseUp && browsePath.parentPath ? ( - setPathInput(appendBrowsePathSegment(browsePath.directoryPath, entry.name)) - } + label=".." + symbol="arrow.turn.left.up" + onPress={() => setPathInput(browsePath.parentPath!)} /> - )) - )} - - - - {selection ?? "Enter a folder path to browse."} - - selection && props.onSelect(selection)} - > - Choose folder - - - - + ) : null} + {browseState.error ? ( + + {browseState.error} + + ) : browseState.isPending && browseState.data === null ? ( + + + + ) : visibleEntries.length === 0 ? ( + No subfolders. + ) : ( + visibleEntries.map((entry) => ( + + setPathInput(appendBrowsePathSegment(browsePath.directoryPath, entry.name)) + } + /> + )) + )} + + + + {selection ?? "Enter a folder path to browse."} + + selection && props.onSelect(selection)} + > + Choose folder + + + + + ); } diff --git a/apps/mobile/src/j5/agents/AgentImportConflictModal.tsx b/apps/mobile/src/j5/agents/AgentImportConflictModal.tsx index e1be52950b6a0..0b79bc5e6801c 100644 --- a/apps/mobile/src/j5/agents/AgentImportConflictModal.tsx +++ b/apps/mobile/src/j5/agents/AgentImportConflictModal.tsx @@ -20,58 +20,61 @@ export function AgentImportConflictModal(props: { presentationStyle="pageSheet" onRequestClose={() => props.onConfirm(null)} > - - - Replace existing personas? + {/* SafeAreaView takes no className, so the theme surface and flex go on a View. */} + + + + Replace existing personas? + props.onConfirm(null)} + > + Cancel + + + + {props.error.message} + + {AGENT_PERSONA_IMPORT_CONFIRMATION_MESSAGE} + + {props.error.conflicts.map((conflict) => { + const checked = selected.some(({ personaId }) => personaId === conflict.personaId); + return ( + + + {conflict.displayName} + + {conflict.personaId} · {checked ? "Replace" : "Skip"} + + + + setSelected( + enabled + ? [...selected, conflict] + : selected.filter(({ personaId }) => personaId !== conflict.personaId), + ) + } + /> + + ); + })} + props.onConfirm(null)} + className="mx-5 mb-4 items-center rounded-xl bg-danger-foreground px-4 py-3" + onPress={() => props.onConfirm(selected)} > - Cancel + Import selected - - - {props.error.message} - - {AGENT_PERSONA_IMPORT_CONFIRMATION_MESSAGE} - - {props.error.conflicts.map((conflict) => { - const checked = selected.some(({ personaId }) => personaId === conflict.personaId); - return ( - - - {conflict.displayName} - - {conflict.personaId} · {checked ? "Replace" : "Skip"} - - - - setSelected( - enabled - ? [...selected, conflict] - : selected.filter(({ personaId }) => personaId !== conflict.personaId), - ) - } - /> - - ); - })} - - props.onConfirm(selected)} - > - Import selected - - + + ); } diff --git a/apps/mobile/src/j5/archive/ArchiveWarningSheet.tsx b/apps/mobile/src/j5/archive/ArchiveWarningSheet.tsx index 21efa114872ac..0e9f1d7ee56ad 100644 --- a/apps/mobile/src/j5/archive/ArchiveWarningSheet.tsx +++ b/apps/mobile/src/j5/archive/ArchiveWarningSheet.tsx @@ -179,29 +179,32 @@ export function ArchiveWarningHost() { presentationStyle={Platform.OS === "ios" ? "pageSheet" : "fullScreen"} onRequestClose={() => answer(false)} > - {/* A Modal is its own native hierarchy, so it measures its own safe area. */} + {/* A Modal is its own native hierarchy, so it measures its own safe area. The theme's + surface goes on a View, as upstream's sheets do: SafeAreaView doesn't take className. */} - - - {warning.title} - - - {warning.payload === null ? null : } - - - -