Skip to content

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

fix: address review findings for RX-234

Amruth Pillai373d868ccf43
diff --git a/apps/mobile/scripts/experience.test.mjs b/apps/mobile/scripts/experience.test.mjs
index 279d6311a..7bd23da75 100644
--- a/apps/mobile/scripts/experience.test.mjs
+++ b/apps/mobile/scripts/experience.test.mjs
@@ -5095,6 +5095,34 @@ const { Composer: PasteComposer } = load(
polishBoundaries,
";module.exports.Composer=Composer;",
);
+reset();
+let recoveredSend;
+const recoveredProps = {
+ scope: "polish-account",
+ initialAttachments: [{ id: "recovered", filename: "Fictional native draft.txt", mediaType: "text/plain", size: 64 }],
+ draft: "Review recovered file",
+ disabled: false,
+ streaming: false,
+ privacy: "Explicit Send only",
+ ensureThread: async () => "paste-thread",
+ onSend: (text, files) => {
+ recoveredSend = { text, files };
+ return true;
+ },
+ onStop() {},
+};
+const recoveredTree = render(PasteComposer, recoveredProps);
+assert.ok(JSON.stringify(recoveredTree).includes("Fictional native draft.txt"));
+assert.equal(recoveredSend, undefined);
+nodes(recoveredTree)
+ .find((node) => node.props.accessibilityLabel === "Send")
+ .props.onPress();
+await settle();
+assert.deepEqual(recoveredSend, {
+ text: "Review recovered file",
+ files: [{ id: "recovered", filename: "Fictional native draft.txt", mediaType: "text/plain" }],
+});
+assert.equal(JSON.stringify(render(PasteComposer, recoveredProps)).includes("Fictional native draft.txt"), false);
for (const scenario of ["success", "failure", "changed"]) {
reset();
let finish;
@@ -5133,10 +5161,48 @@ for (const scenario of ["success", "failure", "changed"]) {
);
assert.equal(pasteFiles.size, 0, "Own temporary file must be deleted on success or failure");
}
-const { Coverage: GapCoverage, RememberMessage: RememberAnswer } = load(
+const {
+ Coverage: GapCoverage,
+ RememberMessage: RememberAnswer,
+ ToolPartView: NativeQuestionPart,
+} = load(
"features/assistant/messages.tsx",
polishBoundaries,
- ";module.exports.Coverage=Coverage;module.exports.RememberMessage=RememberMessage;",
+ ";module.exports.Coverage=Coverage;module.exports.RememberMessage=RememberMessage;module.exports.ToolPartView=ToolPartView;",
+);
+reset();
+const nativeQuestion = render(NativeQuestionPart, {
+ part: { type: "tool-ask_user_question", state: "output-available", output: "Fictional answer" },
+ message: { id: "question", role: "assistant", parts: [] },
+ streaming: false,
+ readOnly: false,
+ answerable: true,
+ proposals: [],
+ onAnswer() {},
+});
+for (const node of nodes(nativeQuestion).filter((node) => node.type === "View")) {
+ assert.ok(
+ node.props.children.flat(Infinity).every((child) => typeof child !== "string" && typeof child !== "number"),
+ "Native View children must not contain raw text",
+ );
+}
+reset();
+const repeatedRequirements = ["missing", "unassessed"].map((status) => ({
+ text: "Repeated requirement",
+ status,
+ evidence: [],
+}));
+let repeatedGaps = nodes(render(GapCoverage, { requirements: repeatedRequirements, factText: () => null })).filter(
+ (node) => node.props.accessibilityRole === "checkbox",
+);
+assert.equal(repeatedGaps.length, 2);
+repeatedGaps[0].props.onPress();
+repeatedGaps = nodes(render(GapCoverage, { requirements: repeatedRequirements, factText: () => null })).filter(
+ (node) => node.props.accessibilityRole === "checkbox",
+);
+assert.deepEqual(
+ repeatedGaps.map((node) => node.props.accessibilityState.checked),
+ [true, false],
);
reset();
const requirements = [{ text: "Accessibility audits", status: "missing", evidence: [] }];
diff --git a/apps/mobile/scripts/import-file.test.mjs b/apps/mobile/scripts/import-file.test.mjs
index cb5d5163c..ec6d6101e 100644
--- a/apps/mobile/scripts/import-file.test.mjs
+++ b/apps/mobile/scripts/import-file.test.mjs
@@ -32,6 +32,7 @@ const tag = (parts, ...values) => parts.reduce((text, part, index) => text + par
for (const scenario of [
"AI",
"explicit locale",
+ "interface locale",
"local",
"partial AI",
"partial local",
@@ -68,6 +69,8 @@ for (const scenario of [
if (scenario === "DOCX") data.sections.profiles.items[0].website.url = url;
class SessionChangedError extends Error {}
const mocks = {
+ "@lingui/core": { i18n: { locale: scenario === "interface locale" ? "ar-SA" : "en-US" } },
+ "@reactive-resume/utils/locale": { localeSchema: { parse: (locale) => locale } },
"@lingui/core/macro": { t: tag },
"expo-file-system": {
File: class extends Blob {
@@ -104,7 +107,11 @@ for (const scenario of [
assert.equal("aiOperationIds" in accepted, false);
assert.equal(
accepted.metadata.page.locale,
- scenario === "explicit locale" ? "de-DE" : data.metadata.page.locale,
+ scenario === "explicit locale"
+ ? "de-DE"
+ : scenario === "interface locale"
+ ? "ar-SA"
+ : data.metadata.page.locale,
);
assert.equal(data.metadata.page.locale, "en-US");
assert.equal(accepted.sections.profiles.items[0].website.url, url);
diff --git a/apps/mobile/scripts/security.test.mjs b/apps/mobile/scripts/security.test.mjs
index 402a3dbea..57db2f891 100644
--- a/apps/mobile/scripts/security.test.mjs
+++ b/apps/mobile/scripts/security.test.mjs
@@ -33,6 +33,8 @@ test("AI imports retain the selecting account through parsing", async () => {
let saved = 0;
class SessionChangedError extends Error {}
const { importDocument } = load("features/documents/import-file.ts", {
+ "@lingui/core": { i18n: { locale: "en-US" } },
+ "@reactive-resume/utils/locale": { localeSchema: { parse: (locale) => locale } },
"@lingui/core/macro": { t: tag },
"expo-file-system": {
File: class {
@@ -77,6 +79,8 @@ test("AI imports retain the selecting account through parsing", async () => {
test("AI imports wait for the user's review before anything is saved", async () => {
let saved = 0;
const { importDocument, createReviewedResume } = load("features/documents/import-file.ts", {
+ "@lingui/core": { i18n: { locale: "en-US" } },
+ "@reactive-resume/utils/locale": { localeSchema: { parse: (locale) => locale } },
"@lingui/core/macro": { t: tag },
"expo-file-system": {
File: class {
@@ -95,7 +99,7 @@ test("AI imports wait for the user's review before anything is saved", async ()
"@/api/client": {
SessionChangedError: class extends Error {},
client: {
- ai: { parseDocx: async () => ({ basics: { name: "Priya Raman" } }) },
+ ai: { parseDocx: async () => ({ basics: { name: "Priya Raman" }, metadata: { page: { locale: "en-US" } } }) },
resume: {
import: async ({ data }) => {
saved++;
diff --git a/apps/mobile/src/features/assistant/chat-view.tsx b/apps/mobile/src/features/assistant/chat-view.tsx
index 6c28b3ffe..80f9a64d4 100644
--- a/apps/mobile/src/features/assistant/chat-view.tsx
+++ b/apps/mobile/src/features/assistant/chat-view.tsx
@@ -271,6 +271,7 @@ function Session(props: SessionProps) {
<Conversation
{...props}
initialMessages={thread.data.messages as UIMessage[]}
+ initialAttachments={(thread.data.attachments ?? []).filter((file) => !file.messageId)}
activeRun={Boolean(thread.data.thread.activeRunId)}
readOnly={thread.data.isReadOnly}
/>
@@ -288,7 +289,12 @@ function Session(props: SessionProps) {
);
}
-type ConversationProps = SessionProps & { initialMessages: UIMessage[]; activeRun: boolean; readOnly: boolean };
+type ConversationProps = SessionProps & {
+ initialMessages: UIMessage[];
+ initialAttachments?: Upload[];
+ activeRun: boolean;
+ readOnly: boolean;
+};
function Conversation(props: ConversationProps) {
const pull = usePullRefresh(...(props.onRefresh ? [props.onRefresh] : []));
@@ -904,6 +910,7 @@ type Upload = ChatAttachment & { size: number; busy?: boolean };
type ComposerProps = Pick<ScopedChatViewProps, "chips" | "notice" | "placeholder" | "scope" | "draft"> & {
privacy: string;
+ initialAttachments?: Upload[];
streaming: boolean;
disabled: boolean;
ensureThread: () => Promise<string>;
@@ -917,7 +924,7 @@ function Composer(props: ComposerProps) {
const { t } = useLingui();
const { colors, radius, size, space, type } = useTheme();
const [text, setText] = useState(props.draft ?? "");
- const [attachments, setAttachments] = useState<Upload[]>([]);
+ const [attachments, setAttachments] = useState<Upload[]>(props.initialAttachments ?? []);
// Chips removed while their upload was still running: the finished upload is deleted, not kept.
const removedUploads = useRef(new Set<string>());
const uploading = attachments.some((attachment) => attachment.busy);
diff --git a/apps/mobile/src/features/assistant/messages.tsx b/apps/mobile/src/features/assistant/messages.tsx
index 6dd568f0d..d007983d0 100644
--- a/apps/mobile/src/features/assistant/messages.tsx
+++ b/apps/mobile/src/features/assistant/messages.tsx
@@ -378,7 +378,6 @@ function ToolPartView({
case "tool-ask_user_question":
return (
<View style={{ gap: space.s2 }}>
- {" "}
<QuestionCard
part={part}
readOnly={readOnly || !answerable}
@@ -1229,7 +1228,7 @@ function Coverage({ requirements, factText }: { requirements: readonly Requireme
const labels = useReviewLabels();
const gaps = requirements.filter((item) => item.status === "missing" || item.status === "unassessed").length;
const [open, setOpen] = useState(gaps > 0);
- const [selected, setSelected] = useState<ReadonlySet<string>>(new Set());
+ const [selected, setSelected] = useState<ReadonlySet<number>>(new Set());
return (
<View
@@ -1256,24 +1255,24 @@ function Coverage({ requirements, factText }: { requirements: readonly Requireme
</Pressable>
{open ? (
<>
- {requirements.map((item) => (
- <View key={item.text} style={{ gap: 2 }}>
+ {requirements.map((item, index) => (
+ <View key={index} style={{ gap: 2 }}>
{item.status === "missing" || item.status === "unassessed" ? (
<Pressable
accessibilityRole="checkbox"
accessibilityLabel={item.text}
- accessibilityState={{ checked: selected.has(item.text) }}
+ accessibilityState={{ checked: selected.has(index) }}
onPress={() =>
setSelected((previous) => {
const next = new Set(previous);
- if (next.has(item.text)) next.delete(item.text);
- else next.add(item.text);
+ if (next.has(index)) next.delete(index);
+ else next.add(index);
return next;
})
}
style={{ minHeight: 44, flexDirection: "row", alignItems: "center", gap: space.s2 }}
>
- <Icon name={selected.has(item.text) ? "check-square" : "square"} size={20} color={colors.ink2} />
+ <Icon name={selected.has(index) ? "check-square" : "square"} size={20} color={colors.ink2} />
<Text variant="caption" style={{ flex: 1 }}>
{item.text}
</Text>
diff --git a/apps/mobile/src/features/documents/import-file.ts b/apps/mobile/src/features/documents/import-file.ts
index 9e8b1be43..bb0a5c1f6 100644
--- a/apps/mobile/src/features/documents/import-file.ts
+++ b/apps/mobile/src/features/documents/import-file.ts
@@ -2,6 +2,7 @@ import type { ImportReview, PdfImportPreview } from "@reactive-resume/import/rev
import type { ResumeData } from "@reactive-resume/schema/resume/data";
import type { Locale } from "@reactive-resume/utils/locale";
import type { DocumentPickerAsset } from "expo-document-picker";
+import { i18n } from "@lingui/core";
import { t } from "@lingui/core/macro";
import { File } from "expo-file-system";
import { extractDocxText } from "@reactive-resume/import/docx-text";
@@ -12,6 +13,7 @@ import {
withLinkTargets,
} from "@reactive-resume/import/review";
import { coverLetterDocumentSchema } from "@reactive-resume/schema/cover-letter/data";
+import { localeSchema } from "@reactive-resume/utils/locale";
import { client, rest, SessionChangedError } from "@/api/client";
import { getAccountScope } from "@/auth/session";
@@ -60,7 +62,8 @@ export async function createReviewedResume(
keepLeftovers && pending.review.notImported.length > 0
? withLeftoverSection(pending.data, pending.review.notImported, t`More from your file`)
: pending.data;
- const chosen = locale ? { ...data, metadata: { ...data.metadata, page: { ...data.metadata.page, locale } } } : data;
+ const pageLocale = locale ?? localeSchema.parse(i18n.locale);
+ const chosen = { ...data, metadata: { ...data.metadata, page: { ...data.metadata.page, locale: pageLocale } } };
const id = await client.resume.import(
{ data: chosen, ...(pending.aiOperationIds ? { aiOperationIds: pending.aiOperationIds } : {}) },
{ signal, context: { scope } },
diff --git a/apps/web/src/features/assistant/assistant-panel.tsx b/apps/web/src/features/assistant/assistant-panel.tsx
index c46c73b83..b52cdbf88 100644
--- a/apps/web/src/features/assistant/assistant-panel.tsx
+++ b/apps/web/src/features/assistant/assistant-panel.tsx
@@ -367,6 +367,9 @@ function ConversationLoader({ threadId, document, destinationUnavailable, ...pro
<Conversation
threadId={threadId}
initialMessages={thread.data.messages}
+ initialAttachments={(thread.data.attachments ?? []).filter(
+ (file) => !file.messageId && !props.promptAttachments.some((sent) => sent.id === file.id),
+ )}
activeRun={Boolean(thread.data.thread.activeRunId)}
document={document}
readOnly={thread.data.isReadOnly || destinationUnavailable}
diff --git a/apps/web/src/features/assistant/conversation.test.tsx b/apps/web/src/features/assistant/conversation.test.tsx
index 5e884fbad..87a90e451 100644
--- a/apps/web/src/features/assistant/conversation.test.tsx
+++ b/apps/web/src/features/assistant/conversation.test.tsx
@@ -825,3 +825,30 @@ it("does not save a reviewed answer after its account has changed", () => {
fireEvent.click(screen.getByRole("button", { name: "Remember" }));
expect(mocks.saveFact).not.toHaveBeenCalled();
});
+
+it("restores owned unsent files as visible chips and waits for explicit Send", () => {
+ const send = vi.fn();
+ const files = [{ id: "recovered", filename: "Fictional draft.txt", mediaType: "text/plain" }];
+ render(
+ <I18nProvider i18n={i18n}>
+ <Composer
+ document={document}
+ context={{ document: false, posting: false }}
+ onContextChange={() => {}}
+ providerLabel="Local"
+ streaming={false}
+ disabled={false}
+ threadId="original-thread"
+ initialAttachments={files}
+ onSend={send}
+ onStop={() => {}}
+ />
+ </I18nProvider>,
+ );
+ expect(screen.getByText("Fictional draft.txt")).toBeDefined();
+ expect(send).not.toHaveBeenCalled();
+ fireEvent.change(screen.getByRole("textbox"), { target: { value: "Review this recovered file" } });
+ fireEvent.click(screen.getByRole("button", { name: "Send" }));
+ expect(send).toHaveBeenCalledWith("Review this recovered file", files);
+ expect(screen.queryByText("Fictional draft.txt")).toBeNull();
+});
diff --git a/apps/web/src/features/assistant/conversation.tsx b/apps/web/src/features/assistant/conversation.tsx
index 886e69960..3924eb4f8 100644
--- a/apps/web/src/features/assistant/conversation.tsx
+++ b/apps/web/src/features/assistant/conversation.tsx
@@ -79,6 +79,7 @@ type ToolPart = Part & {
type ConversationProps = {
threadId: string;
initialMessages: UIMessage[];
+ initialAttachments?: ChatAttachment[];
/** A reply was still streaming when the conversation opened. */
activeRun: boolean;
document: AssistantDocument;
@@ -462,6 +463,7 @@ export function Conversation(props: ConversationProps) {
</MessageScrollerProvider>
<Composer
+ initialAttachments={props.initialAttachments ?? []}
document={document}
context={context}
onContextChange={setContext}
@@ -859,7 +861,6 @@ function ToolPartView({
case "tool-ask_user_question":
return (
<div className="group/message grid gap-2">
- {" "}
<QuestionCard
part={part}
readOnly={readOnly || !answerable}
@@ -1061,6 +1062,7 @@ type ComposerProps = {
onStop: () => void;
/** Text the box starts with (a link's `?ask=`); the user still presses Send. */
initialText?: string | undefined;
+ initialAttachments?: ChatAttachment[];
/** Above the box: what needs a decision before the next message. */
notice?: ReactNode;
/** The conversation already has messages, which are sent again with the next one. */
@@ -1075,7 +1077,7 @@ export function Composer(props: ComposerProps) {
const { document, context, onContextChange, streaming, disabled } = props;
const openDialog = useDialogStore((state) => state.openDialog);
const [text, setText] = useState(props.initialText ?? "");
- const [attachments, setAttachments] = useState<ChatAttachment[]>([]);
+ const [attachments, setAttachments] = useState<ChatAttachment[]>(props.initialAttachments ?? []);
const removal = useAttachmentRemoval(`${document.kind}:${document.id}:${props.threadId ?? "draft"}`, (id) =>
setAttachments((current) => current.filter((item) => item.id !== id)),
);
diff --git a/apps/web/src/features/documents/new-document-dialog.tsx b/apps/web/src/features/documents/new-document-dialog.tsx
index 0afdc8512..fe1d74a0f 100644
--- a/apps/web/src/features/documents/new-document-dialog.tsx
+++ b/apps/web/src/features/documents/new-document-dialog.tsx
@@ -104,6 +104,7 @@ function useResumeImport(
applicationId?: string,
locale?: Locale,
) {
+ const { i18n } = useLingui();
const queryClient = useQueryClient();
const markNew = useNewDocumentsStore((state) => state.markNew);
const providerState = useHasUsableAiProvider();
@@ -187,6 +188,7 @@ function useResumeImport(
onRead: (note) => advance(1, note),
});
if (!current()) return;
+ if (kind !== "reactive-resume-json") resume.metadata.page.locale = locale ?? localeSchema.parse(i18n.locale);
// A PDF or Word file is read by a model or a heuristic: the user sees what came in, and what didn't,
// before anything is created. Structured files (JSON, LinkedIn) come in as they are.
if (kind === "pdf" || kind === "docx") {
diff --git a/apps/web/src/features/resume/editor/proposals/proposal-list.test.tsx b/apps/web/src/features/resume/editor/proposals/proposal-list.test.tsx
index 7b5d90fd3..317b4f746 100644
--- a/apps/web/src/features/resume/editor/proposals/proposal-list.test.tsx
+++ b/apps/web/src/features/resume/editor/proposals/proposal-list.test.tsx
@@ -9,7 +9,7 @@ vi.mock("../store", () => ({ useEditorStore: () => () => {} }));
vi.mock("./proposals", () => ({ acceptResumeProposals: () => {} }));
vi.mock("@/features/resume/builder/draft", () => ({ useIsResumeLocked: () => false }));
-import { ChangeSet } from "./proposal-list";
+import { ChangeSet, Coverage } from "./proposal-list";
afterEach(cleanup);
@@ -215,3 +215,25 @@ it("lets the user tick a posting gap without changing evidence, status or accept
fireEvent.click(input);
expect(gap.getAttribute("aria-checked")).toBe("false");
});
+
+it("checks identical posting gaps independently", () => {
+ i18n.loadAndActivate({ locale: "en", messages: {} });
+ const requirements = ["missing", "unassessed"].map((status) => ({
+ text: "Accessibility audits",
+ status: status as "missing" | "unassessed",
+ evidence: [],
+ }));
+ render(
+ <I18nProvider i18n={i18n}>
+ <Coverage requirements={requirements} factText={() => null} />
+ </I18nProvider>,
+ );
+ const [first, second] = screen.getAllByRole("checkbox", { name: "Accessibility audits" });
+ if (!first || !second) throw new Error("Both requirements must render");
+ const input = first.parentElement?.querySelector("input");
+ if (!input) throw new Error("First checkbox input missing");
+ fireEvent.click(input);
+ expect(first.getAttribute("aria-checked")).toBe("true");
+ expect(second.getAttribute("aria-checked")).toBe("false");
+ expect(requirements.map((item) => item.status)).toEqual(["missing", "unassessed"]);
+});
diff --git a/apps/web/src/features/resume/editor/proposals/proposal-list.tsx b/apps/web/src/features/resume/editor/proposals/proposal-list.tsx
index d0f6ad417..c2e2067fd 100644
--- a/apps/web/src/features/resume/editor/proposals/proposal-list.tsx
+++ b/apps/web/src/features/resume/editor/proposals/proposal-list.tsx
@@ -639,7 +639,7 @@ type CoverageProps = {
/** Every posting requirement as the assistant read it, gaps included. Separate from Check's term list. */
export function Coverage({ requirements, factText }: CoverageProps) {
- const [selected, setSelected] = useState<ReadonlySet<string>>(new Set());
+ const [selected, setSelected] = useState<ReadonlySet<number>>(new Set());
const gaps = requirements.filter((item) => item.status === "missing" || item.status === "unassessed").length;
return (
@@ -653,17 +653,17 @@ export function Coverage({ requirements, factText }: CoverageProps) {
{gaps > 0 && <Plural value={gaps} one="· # gap" other="· # gaps" />}
</summary>
<ul className="mt-1.5 grid gap-1.5">
- {requirements.map((item) => (
- <li key={item.text} className="grid gap-0.5">
+ {requirements.map((item, index) => (
+ <li key={index} className="grid gap-0.5">
{item.status === "missing" || item.status === "unassessed" ? (
<label className="flex min-h-11 items-center gap-2 text-ink">
<Checkbox
- checked={selected.has(item.text)}
+ checked={selected.has(index)}
onCheckedChange={(checked) =>
setSelected((previous) => {
const next = new Set(previous);
- if (checked === true) next.add(item.text);
- else next.delete(item.text);
+ if (checked === true) next.add(index);
+ else next.delete(index);
return next;
})
}
diff --git a/docs/guides/importing-resumes.mdx b/docs/guides/importing-resumes.mdx
index 51f10b920..67a2a7b64 100644
--- a/docs/guides/importing-resumes.mdx
+++ b/docs/guides/importing-resumes.mdx
@@ -27,7 +27,7 @@ A cover letter exported from Reactive Resume as JSON imports as a letter, not a
## Import a file
-In **New**, **Resume language** lets you choose the imported document's language before saving. Leave it at **Default** to keep the file's own language. An explicit choice changes generated headings, date words and text direction; it does not translate imported content. PDF and Word review also lets you change this choice before **Create resume**. Your source file and existing resumes remain unchanged.
+In **New**, **Resume language** lets you choose the imported document's language before saving. Leave it at **Default** to keep a Reactive Resume JSON file's own language. Formats without a stored language use your interface language. An explicit choice changes generated headings, date words and text direction; it does not translate imported content. PDF and Word review also lets you change this choice before **Create resume**. Your source file and existing resumes remain unchanged.
<Steps>
<Step title="Open the import">
diff --git a/docs/guides/using-the-assistant.mdx b/docs/guides/using-the-assistant.mdx
index 73759ef16..3706079d7 100644
--- a/docs/guides/using-the-assistant.mdx
+++ b/docs/guides/using-the-assistant.mdx
@@ -209,7 +209,7 @@ If a question did not finish or could not be asked, send a new message to contin
## Choose what's shared with each message
-Above the message box, chips show what goes with your next message: the document, and the job posting when the document is linked to an application. Select the **×** on a chip to leave it out, including before your first message. A chip you left out stays as a dashed outline; select it to send that item again. Without the document, the assistant can't read or edit it for that message. The line under the box always says what will be sent and to which provider, names any attached files, and mentions earlier messages only once there are some. Nothing is sent until you press send. A long pasted message folds to its first lines in the conversation, with **Show all**. Before sending a long paste, **Attach a file instead** offers to upload those words as `message.txt`, using the existing destination approval. After a successful upload, the unchanged message box says **Read the attachment**; text you typed while it uploaded stays intact. A failed upload keeps your paste. Review the named file and disclosure, then press **Send** yourself. Removing the file releases its upload before the next message.
+Above the message box, chips show what goes with your next message: the document, and the job posting when the document is linked to an application. Select the **×** on a chip to leave it out, including before your first message. A chip you left out stays as a dashed outline; select it to send that item again. Without the document, the assistant can't read or edit it for that message. The line under the box always says what will be sent and to which provider, names any attached files, and mentions earlier messages only once there are some. Nothing is sent until you press send. A long pasted message folds to its first lines in the conversation, with **Show all**. Before sending a long paste, **Attach a file instead** offers to upload those words as `message.txt`, using the existing destination approval. After a successful upload, the unchanged message box says **Read the attachment**; text you typed while it uploaded stays intact. A failed upload keeps your paste. Review the named file and disclosure, then press **Send** yourself. Removing the file releases its upload before the next message. Unsent uploads stay with their conversation. Reopening it on web or mobile restores their named chips, including an upload that finished while you changed accounts. Review or remove those files before sending; reopening never sends them to a provider.
Removing either context chip also leaves earlier conversation history out of the next reply. Pending questions or approvals from a different context cannot resume; send a new message with your current choices.
diff --git a/packages/api/src/features/resume/imports.test.ts b/packages/api/src/features/resume/imports.test.ts
index 8175f1c14..290bdb9ad 100644
--- a/packages/api/src/features/resume/imports.test.ts
+++ b/packages/api/src/features/resume/imports.test.ts
@@ -827,3 +827,18 @@ it.each([undefined, "ar-SA"] as const)(
expect(original.metadata.page.locale).toBe("de-DE");
},
);
+
+it.each([undefined, "ar-SA"] as const)("uses interface language for a locale-less JSON Resume: %s", async (locale) => {
+ create.mockClear();
+ const file = new File([JSON.stringify({ basics: { name: "Fictional portfolio" } })], "Resume.json", {
+ type: "application/json",
+ });
+ await call(
+ importResumeFile,
+ { file, format: "JSON_RESUME", ...(locale ? { locale } : {}) },
+ { context: { locale: "de-DE", reqHeaders: new Headers() } },
+ );
+ const saved = create.mock.calls[0]?.[0] as { data: ResumeData };
+ expect(saved.data.metadata.page.locale).toBe(locale ?? "de-DE");
+ expect(saved.data.basics.name).toBe("Fictional portfolio");
+});
diff --git a/packages/api/src/features/resume/imports.ts b/packages/api/src/features/resume/imports.ts
index 703459c2a..bdbeb5894 100644
--- a/packages/api/src/features/resume/imports.ts
+++ b/packages/api/src/features/resume/imports.ts
@@ -95,6 +95,7 @@ export const importResumeFile = protectedProcedure
cause: error,
});
}
- if (input.locale) data.metadata.page.locale = input.locale;
+ data.metadata.page.locale =
+ input.locale ?? (input.format === "REACTIVE_RESUME" ? data.metadata.page.locale : context.locale);
return call(crudRouter.import, { data }, { context });
});
diff --git a/tests/e2e/fixtures/auth.ts b/tests/e2e/fixtures/auth.ts
index 62c346884..53d5f20ec 100644
--- a/tests/e2e/fixtures/auth.ts
+++ b/tests/e2e/fixtures/auth.ts
@@ -1,5 +1,6 @@
import type { E2EAccount } from "./data";
import type { APIRequestContext, Browser, BrowserContext, Page } from "@playwright/test";
+import { request } from "@playwright/test";
async function assertAuthResponse(response: Awaited<ReturnType<APIRequestContext["post"]>>) {
if (response.ok()) return;
@@ -68,3 +69,18 @@ export async function createAuthenticatedContext(
storageState: await request.storageState(),
});
}
+
+/** A fresh authenticated reader keeps long UI flows independent of an expired idle API socket. */
+export async function readAuthenticatedJson(page: Page, path: string) {
+ const reader = await request.newContext({
+ baseURL: new URL(page.url()).origin,
+ storageState: await page.context().storageState(),
+ });
+ try {
+ const response = await reader.get(path);
+ if (!response.ok()) throw new Error(`Read failed with ${response.status()}: ${path}`);
+ return await response.json();
+ } finally {
+ await reader.dispose();
+ }
+}
diff --git a/tests/e2e/specs/assistant.spec.ts b/tests/e2e/specs/assistant.spec.ts
index 2a888b1f3..f71565be0 100644
--- a/tests/e2e/specs/assistant.spec.ts
+++ b/tests/e2e/specs/assistant.spec.ts
@@ -4,6 +4,7 @@ import { Pool } from "pg";
import { defaultResumeData } from "@reactive-resume/schema/resume/default";
import { approveLocalStubOperations } from "../fixtures/ai-consent";
import { startAiStub } from "../fixtures/ai-stub";
+import { readAuthenticatedJson } from "../fixtures/auth";
import { createSampleResumeFromDashboard } from "../fixtures/resume";
import { expect, test } from "../fixtures/test";
@@ -132,7 +133,7 @@ for (const failure of ["uncommitted", "committed-lost"] as const)
await page.getByLabel("Company", { exact: true }).fill("Cancelled Fictional");
await page.getByLabel("Role", { exact: true }).fill("Cancelled Role");
await page.getByRole("button", { name: "Cancel", exact: true }).last().click();
- expect(await (await page.request.get("/api/openapi/applications")).json()).toMatchObject([{ id: oldJobId }]);
+ expect(await readAuthenticatedJson(page, "/api/openapi/applications")).toMatchObject([{ id: oldJobId }]);
expect(stub.requests).toHaveLength(calls);
await action.click();
await page.getByLabel("Company", { exact: true }).fill("Fictional Lumen");
@@ -181,7 +182,7 @@ for (const failure of ["uncommitted", "committed-lost"] as const)
await page.getByRole("button", { name: "Save and link this resume", exact: true }).click();
if (failure === "uncommitted") {
await expect(page.getByRole("button", { name: "Save and link this resume", exact: true })).toBeEnabled();
- expect(await (await page.request.get("/api/openapi/applications")).json()).toHaveLength(2);
+ expect(await readAuthenticatedJson(page, "/api/openapi/applications")).toHaveLength(2);
await expect(
page.getByRole("button", { name: "Send Previous Fictional posting again", exact: true }),
).toBeVisible();
@@ -208,7 +209,7 @@ for (const failure of ["uncommitted", "committed-lost"] as const)
await page.getByRole("button", { name: "Save and link this resume", exact: true }).click();
}
await expect(page.getByText("Saved as a job and linked to this resume", { exact: true }).first()).toBeVisible();
- const jobs = await (await page.request.get("/api/openapi/applications")).json();
+ const jobs = await readAuthenticatedJson(page, "/api/openapi/applications");
const id = jobs.find((job: { id: string }) => job.id !== oldJobId).id;
expect(new URL(page.url()).searchParams.get("applicationId")).toBe(id);
expect(writes.map((write) => write.path)).toEqual([
@@ -348,7 +349,7 @@ test("posting create and resume link reject foreign resources and mismatched acc
});
expect(mismatch.ok()).toBe(false);
expect(JSON.parse(await resumeJson(page, resumeId)).applicationId).toBeNull();
- expect(await (await page.request.get("/api/openapi/applications")).json()).toHaveLength(1);
+ expect(await readAuthenticatedJson(page, "/api/openapi/applications")).toHaveLength(1);
expect(await (await other.get("/api/openapi/applications")).json()).toEqual([]);
} finally {
await other.delete("/api/openapi/auth/account");
diff --git a/tests/e2e/specs/career-workspace-undo.spec.ts b/tests/e2e/specs/career-workspace-undo.spec.ts
index e8adac37b..5cd916adc 100644
--- a/tests/e2e/specs/career-workspace-undo.spec.ts
+++ b/tests/e2e/specs/career-workspace-undo.spec.ts
@@ -1,7 +1,6 @@
import type { Page } from "@playwright/test";
-import { request } from "@playwright/test";
import { Pool } from "pg";
-import { createAuthenticatedContext } from "../fixtures/auth";
+import { createAuthenticatedContext, readAuthenticatedJson } from "../fixtures/auth";
import { createAccount } from "../fixtures/data";
import { deleteE2EUser } from "../fixtures/db";
import { expect, test } from "../fixtures/test";
@@ -40,19 +39,8 @@ async function removeFirst(page: Page) {
await expect(page.getByRole("button", { name: "Undo", exact: true })).toBeVisible();
}
-async function readCommittedWorkspace(page: Page, applicationId: string) {
- // Undo outlives the server's idle HTTP connection; read once as an independent authenticated client.
- const reader = await request.newContext({
- baseURL: new URL(page.url()).origin,
- storageState: await page.context().storageState(),
- });
- try {
- const response = await reader.get(`/api/openapi/career/workspace/${applicationId}`);
- await expect(response).toBeOK();
- return await response.json();
- } finally {
- await reader.dispose();
- }
+function readCommittedWorkspace(page: Page, applicationId: string) {
+ return readAuthenticatedJson(page, `/api/openapi/career/workspace/${applicationId}`);
}
for (const mode of ["reload", "close"] as const)
diff --git a/tests/e2e/specs/document-language-assistant-polish.spec.ts b/tests/e2e/specs/document-language-assistant-polish.spec.ts
index 1ebb3d49c..db43ecc29 100644
--- a/tests/e2e/specs/document-language-assistant-polish.spec.ts
+++ b/tests/e2e/specs/document-language-assistant-polish.spec.ts
@@ -170,7 +170,7 @@ for (const override of [false, true])
expect((await read(page, sourceId)).data).toEqual(source.data);
});
-for (const action of ["remove", "send", "failure", "changed"])
+for (const action of ["remove", "send", "failure", "changed", "reopen"])
test(`A2-27 explicit long-paste attachment ${action}`, async ({ authPage: page }, info) => {
await provider(page);
await createSampleResumeFromDashboard(page, info);
@@ -226,6 +226,16 @@ for (const action of ["remove", "send", "failure", "changed"])
return (await r.json()).json;
};
expect((await get()).attachments).toHaveLength(1);
+ if (action === "reopen") {
+ const reopened = new URL(page.url());
+ reopened.searchParams.set("assistant", threadId);
+ await page.goto(reopened.toString());
+ await expect(region.getByText("message.txt", { exact: true })).toBeVisible();
+ expect(sends).toBe(0);
+ await region.getByRole("button", { name: "Remove message.txt", exact: true }).click();
+ await expect(region.getByText("message.txt", { exact: true })).toHaveCount(0);
+ expect((await get()).attachments).toHaveLength(0);
+ }
if (action === "remove") {
await region.getByRole("button", { name: "Remove message.txt", exact: true }).click();
await expect(region.getByText("message.txt", { exact: true })).toHaveCount(0);
@@ -288,3 +298,25 @@ test("A2-25 real posting gap is tickable without changing its evidence or the do
.getByRole("region", { name: "Assistant", exact: true })
.screenshot({ path: info.outputPath("assistant-posting-gaps.png") });
});
+
+test("locale-less JSON Resume import uses the chosen interface language", async ({ authPage: page }) => {
+ await page.goto("/dashboard?locale=de-DE");
+ await expect(page.locator("html")).toHaveAttribute("lang", "de-DE");
+ await page.getByRole("button", { name: "Neu", exact: true }).click();
+ const dialog = page.getByRole("dialog");
+ await dialog.locator('input[type="file"]').setInputFiles({
+ name: "Fictional-JSON-Resume.json",
+ mimeType: "application/json",
+ buffer: Buffer.from(JSON.stringify({ basics: { name: "Fictional language choice" } })),
+ });
+ await expect
+ .poll(async () => {
+ const rows = await (await page.request.get("/api/openapi/resumes")).json();
+ return rows.find((row: { name: string }) => row.name.includes("Fictional"))?.id;
+ })
+ .toBeTruthy();
+ const rows = await (await page.request.get("/api/openapi/resumes")).json();
+ const saved = await read(page, rows.find((row: { name: string }) => row.name.includes("Fictional")).id);
+ expect(saved.data.metadata.page.locale).toBe("de-DE");
+ expect(saved.data.basics.name).toBe("Fictional language choice");
+});