Skip to content

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

fix: preserve import language and recover pending attachments

Amruth Pillai08e831e18040
diff --git a/apps/mobile/scripts/experience.test.mjs b/apps/mobile/scripts/experience.test.mjs
index 1b38565fb..7b4f97fe6 100644
--- a/apps/mobile/scripts/experience.test.mjs
+++ b/apps/mobile/scripts/experience.test.mjs
@@ -1895,6 +1895,13 @@ const loadOfferEntry = () =>
const { OfferEntry, OfferForm } = loadOfferEntry();
reset();
offerPreferences = { minBase: { amount: 8000, currency: "EUR", period: "month" } };
+const annualHintView = render(OfferForm, {
+ application: { id: "annual-job", company: "Fictional Salary", role: "Engineer", salary: "$120k–140k" },
+ onClose() {},
+});
+assert.equal(control(annualHintView, "Pay period").value, "year");
+assert.equal(control(annualHintView, "Base salary").value, "120000");
+reset();
const defaultPeriodView = () =>
render(OfferForm, { application: { id: "period-job", company: "Fictional Labs", role: "Engineer" }, onClose() {} });
assert.equal(
@@ -2096,10 +2103,11 @@ searchParams = {};
console.log("PASS native percentage entry and immutable offer-version action");
// Native Save must stay reachable for validation, then focus the actual missing input.
+let storyReadState = {};
const { Stories } = load("features/career/stories.tsx", {
"@reactive-resume/schema/career": careerSchema,
"./hooks": {
- useCareerQueries: () => ({ stories: { data: [] }, facts: { data: [] } }),
+ useCareerQueries: () => ({ stories: { data: [], ...storyReadState }, facts: { data: [] } }),
useUndoRows: () => ({ hidden: [] }),
useCareerAction: () => ({ pending: false, run: (save) => save() }),
client: { career: { saveStory: (payload) => calls.push({ story: payload }) } },
@@ -2107,6 +2115,15 @@ const { Stories } = load("features/career/stories.tsx", {
"./shared": { Actions: "Actions", EditorSheet: "EditorSheet", LoadState: "LoadState", SwitchRow: "SwitchRow" },
});
reset();
+for (const state of [{ isPending: true }, { isError: true }]) {
+ storyReadState = state;
+ reset();
+ const tree = render(Stories, {});
+ control(tree, "Add a story").onPress();
+ assert.ok(nodes(render(Stories, {})).some((node) => typeof node.type === "function" && node.props.story === null));
+}
+storyReadState = {};
+reset();
const emptyStory = nodes(render(Stories, {})).find((node) => node.props.title === "No stories yet");
assert.ok(emptyStory);
assert.equal(emptyStory.props.variant, "card");
@@ -3894,6 +3911,7 @@ const { useCareerAction: memoryAction } = load("features/career/hooks.ts", {
"@/auth/session": memorySession,
"@/features/settings/queries": {},
});
+let factsReadState = {};
const { Facts: KnowledgeFacts } = load("features/career/facts.tsx", {
"@tanstack/react-query": {},
"@reactive-resume/schema/career": careerSchema,
@@ -3914,7 +3932,7 @@ const { Facts: KnowledgeFacts } = load("features/career/facts.tsx", {
"expo-crypto": {},
"./hooks": {
client: memoryApi,
- useCareerQueries: () => ({ facts: { data: [] }, profile: { data: memoryProfile } }),
+ useCareerQueries: () => ({ facts: { data: [], ...factsReadState }, profile: { data: memoryProfile } }),
useCareerAction: memoryAction,
useCareerTime: () => ({ when() {}, profile: { data: memoryAccount } }),
useUndoRows: () => ({ hidden: [] }),
@@ -3926,6 +3944,18 @@ const factsHeader = () =>
nodes(render(KnowledgeFacts, { onRefresh: async () => {} })).find((node) => node.type === "LegendList").props
.ListHeaderComponent;
reset();
+for (const state of [{ isPending: true }, { isError: true }]) {
+ factsReadState = state;
+ reset();
+ control(factsHeader(), "Add a fact").onPress();
+ assert.ok(
+ nodes(render(KnowledgeFacts, { onRefresh: async () => {} })).some(
+ (node) => typeof node.type === "function" && node.props.fact === null,
+ ),
+ );
+}
+factsReadState = {};
+reset();
for (const memoryMode of ["ask", "auto", "off"]) {
let header = factsHeader();
assert.equal(control(header, "Remember facts from my messages").value, memoryProfile.memoryMode);
@@ -5130,6 +5160,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;
@@ -5168,10 +5226,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 3854555fe..ae5079bdb 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/career/facts.tsx b/apps/mobile/src/features/career/facts.tsx
index f4a4c0b30..94336c373 100644
--- a/apps/mobile/src/features/career/facts.tsx
+++ b/apps/mobile/src/features/career/facts.tsx
@@ -178,7 +178,9 @@ export function Facts({ children, onRefresh }: FactsProps) {
options={[{ value: "all", label: t`All` }, ...factCategories()]}
/>
<ResumeFacts />
- {facts.data?.length ? <Button label={t`Add a fact`} onPress={() => setEditor({ fact: null })} /> : null}
+ {facts.data?.length || facts.isPending || facts.isError ? (
+ <Button label={t`Add a fact`} onPress={() => setEditor({ fact: null })} />
+ ) : null}
<SwitchRow label={t`Show forgotten`} value={showForgotten} onValueChange={setShowForgotten} />
{showForgotten ? <ForgottenFacts /> : null}
<LoadState query={facts} />
diff --git a/apps/mobile/src/features/career/offer-entry.tsx b/apps/mobile/src/features/career/offer-entry.tsx
index 3efd9bb78..500c387ea 100644
--- a/apps/mobile/src/features/career/offer-entry.tsx
+++ b/apps/mobile/src/features/career/offer-entry.tsx
@@ -227,7 +227,10 @@ export function OfferForm({ application, offer: initialOffer, onClose, onSaved }
const terms = {
...draft,
currency: offer || currencyTyped ? draft.currency : (hint?.currency ?? previousCurrency ?? preferred ?? ""),
- period: offer || periodTyped ? draft.period : (hint?.period ?? careerProfile?.minBase.period ?? "year"),
+ period:
+ offer || periodTyped
+ ? draft.period
+ : (hint?.period ?? (hint?.base != null ? "year" : (careerProfile?.minBase.period ?? "year"))),
};
const currencies = useMemo(() => getCurrencyOptions(locale, terms.currency), [locale, terms.currency]);
const [more, setMore] = useState(Boolean(offer));
diff --git a/apps/mobile/src/features/career/stories.tsx b/apps/mobile/src/features/career/stories.tsx
index cecc2fda3..7c4cd3e0d 100644
--- a/apps/mobile/src/features/career/stories.tsx
+++ b/apps/mobile/src/features/career/stories.tsx
@@ -51,7 +51,9 @@ export function Stories() {
return (
<View style={{ gap: space.s4 }}>
<Text color="ink3">{t`Situation, Task, Action, Result, Reflection. Link each story to facts you can support; leave unknown outcomes blank.`}</Text>
- {rows.length || editor ? <Button label={t`Add a story`} onPress={() => setEditor({ story: null })} /> : null}
+ {rows.length || editor || stories.isPending || stories.isError ? (
+ <Button label={t`Add a story`} onPress={() => setEditor({ story: null })} />
+ ) : null}
<LoadState query={stories} />
<LoadState query={facts} />
{!stories.isError && !stories.isPending && !rows.length && !editor ? (
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 49c633556..52bcc6d30 100644
--- a/apps/web/src/features/assistant/conversation.test.tsx
+++ b/apps/web/src/features/assistant/conversation.test.tsx
@@ -835,3 +835,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 544de26e4..ba2876ff0 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/career/knowledge/knowledge.test.tsx b/apps/web/src/features/career/knowledge/knowledge.test.tsx
index 0c65e5095..4039a32ce 100644
--- a/apps/web/src/features/career/knowledge/knowledge.test.tsx
+++ b/apps/web/src/features/career/knowledge/knowledge.test.tsx
@@ -994,3 +994,15 @@ it("keeps an open global offer draft mounted when application metadata refresh f
await waitFor(() => expect(screen.queryAllByRole("alert")).toHaveLength(0));
expect(screen.getByLabelText("Base salary")).toHaveValue("123456");
});
+
+it("keeps an amount-only job salary annual beside monthly Preferences", async () => {
+ api.data.profile = { ...profile(), minBase: { amount: 8000, currency: "EUR", period: "month" } };
+ mount(
+ <OfferEntry
+ application={{ id: "salary-job", company: "Fictional Salary", role: "Engineer", salary: "$120k–140k" }}
+ />,
+ );
+ fireEvent.click(screen.getByRole("button", { name: "Add offer" }));
+ await waitFor(() => expect((screen.getByLabelText("Pay period") as HTMLSelectElement).value).toBe("year"));
+ expect((screen.getByLabelText("Base salary") as HTMLInputElement).value).toBe("120000");
+});
diff --git a/apps/web/src/features/career/offer-entry.tsx b/apps/web/src/features/career/offer-entry.tsx
index d9d2dafea..8cb9dfa0a 100644
--- a/apps/web/src/features/career/offer-entry.tsx
+++ b/apps/web/src/features/career/offer-entry.tsx
@@ -306,7 +306,10 @@ export function OfferForm({ application, offer: initialOffer, onClose, onSaved }
const terms = {
...draft,
currency: offer || currencyTyped ? draft.currency : (hint?.currency ?? previousCurrency ?? preferred ?? ""),
- period: offer || periodTyped ? draft.period : (hint?.period ?? profile?.minBase.period ?? "year"),
+ period:
+ offer || periodTyped
+ ? draft.period
+ : (hint?.period ?? (hint?.base != null ? "year" : (profile?.minBase.period ?? "year"))),
};
const [more, setMore] = useState(Boolean(offer));
const [submitted, setSubmitted] = useState(false);
@@ -516,6 +519,7 @@ export function OfferForm({ application, offer: initialOffer, onClose, onSaved }
className="w-full justify-start font-normal"
onChange={(currency) => {
setCurrencyTyped(true);
+ touch("currency");
change({ currency });
}}
/>
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/comparing-job-offers.mdx b/docs/guides/comparing-job-offers.mdx
index 6f2c6642e..c785ecb9f 100644
--- a/docs/guides/comparing-job-offers.mdx
+++ b/docs/guides/comparing-job-offers.mdx
@@ -12,7 +12,7 @@ Offer-stage applications appear first in **Add offer**; applications closed as *
## Save each offer
Moving an application to **Offer** shows **Add the offer's terms** in the confirmation, which opens this form in its **Messages** tab.
-Choose **Add offer** in **Career → Offers**, or in the relevant application's **Messages** tab. An offer belongs to an application: with none yet, the button reads **Add an application first** and opens **Save a job**. Select an application, choose a currency by its code and localized symbol, and check the pay period. A job's salary line supplies starting currency, period and base when it states them. Otherwise currency starts from your latest saved offer, then your minimum salary in Preferences; the pay period follows Preferences until you choose one. Changing the application or loading Preferences later never replaces a period you explicitly selected. Enter the base salary and response deadline only when you know them. Base salary, bonus and learning budget can stay blank when unknown; enter `0` only when the amount is confirmed as zero. A deadline asks for a time too, in your account timezone. **More options** holds the offer type (written or verbal), bonus, bonus conditions, equity, learning budget, office days, location, leave and other benefits. Choose **Save offer**. For applications before **Offer**, saving moves them to **Offer** with **Undo**, which keeps the offer and restores the prior stage. The newest terms stay visible in **Messages**, with **Compare**. Manual entry needs no AI connection and sends no terms to an AI provider.
+Choose **Add offer** in **Career → Offers**, or in the relevant application's **Messages** tab. An offer belongs to an application: with none yet, the button reads **Add an application first** and opens **Save a job**. Select an application, choose a currency by its code and localized symbol, and check the pay period. A job's salary line supplies starting currency, period and base when it states them. A salary amount without a named period starts at **Per year**; check it before saving. Otherwise currency starts from your latest saved offer, then your minimum salary in Preferences; the pay period follows Preferences until you choose one. Changing the application or loading Preferences later never replaces a period you explicitly selected. Enter the base salary and response deadline only when you know them. Base salary, bonus and learning budget can stay blank when unknown; enter `0` only when the amount is confirmed as zero. A deadline asks for a time too, in your account timezone. **More options** holds the offer type (written or verbal), bonus, bonus conditions, equity, learning budget, office days, location, leave and other benefits. Choose **Save offer**. For applications before **Offer**, saving moves them to **Offer** with **Undo**, which keeps the offer and restores the prior stage. The newest terms stay visible in **Messages**, with **Compare**. Manual entry needs no AI connection and sends no terms to an AI provider.
Use full amounts such as `95000` rather than `95k`. Bonus also accepts a percentage of base, such as `10%` or a decimal percentage in your interface locale. It stays a percentage when saved and reopened. With a known base, Offers shows its money equivalent in that base's currency and pay period; with no base, it shows only the percentage. Errors appear after leaving a field or choosing **Save offer**, and your entered terms stay available for correction. A response deadline must be a valid local time in your account timezone; times skipped by daylight saving cannot be saved. On mobile, wait for the account timezone to load, retry a failed load, or clear the optional deadline.
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 3e8b70b40..48bbb9b29 100644
--- a/docs/guides/using-the-assistant.mdx
+++ b/docs/guides/using-the-assistant.mdx
@@ -218,7 +218,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/docs/spec.json b/docs/spec.json
index 434984120..eb9353bf7 100644
--- a/docs/spec.json
+++ b/docs/spec.json
@@ -43200,7 +43200,7 @@
"/applications/{id}/ai/evidence-proposal": {
"post": {
"operationId": "applications.ai.proposeEvidence",
- "summary": "Propose reviewed resume edits from selected application evidence",
+ "summary": "Propose resume edits for review from selected application evidence",
"tags": [
"Applications",
"AI"
diff --git a/packages/api/src/features/applications/ai.ts b/packages/api/src/features/applications/ai.ts
index dd2c20f11..7420627c1 100644
--- a/packages/api/src/features/applications/ai.ts
+++ b/packages/api/src/features/applications/ai.ts
@@ -545,7 +545,7 @@ export const aiRouter = {
method: "POST",
path: "/applications/{id}/ai/evidence-proposal",
...reserved,
- summary: "Propose reviewed resume edits from selected application evidence",
+ summary: "Propose resume edits for review from selected application evidence",
})
.input(z.object({ id: z.string(), factId: z.string() }))
.use(aiRequestRateLimit)
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/packages/utils/src/amount.test.ts b/packages/utils/src/amount.test.ts
index 4550e03ea..ea208153c 100644
--- a/packages/utils/src/amount.test.ts
+++ b/packages/utils/src/amount.test.ts
@@ -1,4 +1,4 @@
-import { expect, it } from "vite-plus/test";
+import { expect, it, vi } from "vite-plus/test";
import { getCurrencyOptions, parseAmount, parseDecimal } from "./amount";
it("labels currency choices with codes and localized symbols without dropping saved codes", () => {
@@ -33,3 +33,18 @@ it("keeps monetary precision and safe bounds while accepting finite percentage d
expect(parseDecimal(`0.${"0".repeat(323)}1`, "en-US")).toBeUndefined();
expect(parseDecimal(`0.${"0".repeat(323)}5`, "en-US")).toBe(Number.MIN_VALUE);
});
+
+it("reuses currency labels when selection changes, formatting only a saved extra code", () => {
+ const formatter = vi.spyOn(Intl, "NumberFormat");
+ try {
+ getCurrencyOptions("fr-CA");
+ const built = formatter.mock.calls.length;
+ expect(built).toBeGreaterThan(100);
+ getCurrencyOptions("fr-CA", "EUR");
+ expect(formatter.mock.calls.length).toBe(built);
+ getCurrencyOptions("fr-CA", "BTC");
+ expect(formatter.mock.calls.length).toBe(built + 1);
+ } finally {
+ formatter.mockRestore();
+ }
+});
diff --git a/packages/utils/src/amount.ts b/packages/utils/src/amount.ts
index 1887ba987..53986e615 100644
--- a/packages/utils/src/amount.ts
+++ b/packages/utils/src/amount.ts
@@ -49,14 +49,23 @@ const currencyCodes = (
"VUV WST XAF XCD XCG XDR XOF XPF XSU YER ZAR ZMW ZWG ZWL"
).split(" ");
+const currencyOptionsByLocale = new Map<string, { value: string; label: string }[]>();
+
+function currencyOption(locale: string, value: string) {
+ const symbol = new Intl.NumberFormat(locale, { style: "currency", currency: value })
+ .formatToParts(0)
+ .find((part) => part.type === "currency")?.value;
+ return { value, label: symbol && symbol !== value ? `${value} · ${symbol}` : value };
+}
+
/** Codes disambiguate shared symbols; a previously saved code remains selectable. */
export function getCurrencyOptions(locale: string, current = "") {
- const codes =
- /^[A-Z]{3}$/.test(current) && !currencyCodes.includes(current) ? [...currencyCodes, current] : currencyCodes;
- return codes.map((value) => {
- const symbol = new Intl.NumberFormat(locale, { style: "currency", currency: value })
- .formatToParts(0)
- .find((part) => part.type === "currency")?.value;
- return { value, label: symbol && symbol !== value ? `${value} · ${symbol}` : value };
- });
+ let options = currencyOptionsByLocale.get(locale);
+ if (!options) {
+ options = currencyCodes.map((value) => currencyOption(locale, value));
+ currencyOptionsByLocale.set(locale, options);
+ }
+ return /^[A-Z]{3}$/.test(current) && !currencyCodes.includes(current)
+ ? [...options, currencyOption(locale, current)]
+ : [...options];
}
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-reviewed-wording.spec.ts b/tests/e2e/specs/assistant-reviewed-wording.spec.ts
index 99d34a66d..238a2e2fc 100644
--- a/tests/e2e/specs/assistant-reviewed-wording.spec.ts
+++ b/tests/e2e/specs/assistant-reviewed-wording.spec.ts
@@ -3,6 +3,8 @@ import { startAiStub } from "../fixtures/ai-stub";
import { createSampleResumeFromDashboard } from "../fixtures/resume";
import { expect, test } from "../fixtures/test";
+test.skip(process.env.FLAG_ALLOW_UNSAFE_AI_BASE_URL !== "true", "Needs the isolated local AI stub URL flag.");
+
let stub: Awaited<ReturnType<typeof startAiStub>>;
test.beforeAll(async () => {
stub = await startAiStub();
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-polish-recovery.spec.ts b/tests/e2e/specs/career-polish-recovery.spec.ts
index 6da11b391..559247dc5 100644
--- a/tests/e2e/specs/career-polish-recovery.spec.ts
+++ b/tests/e2e/specs/career-polish-recovery.spec.ts
@@ -48,6 +48,9 @@ test("Preferences and offer currency choices save code and period without guessi
await expect(form.getByRole("combobox", { name: "Currency", exact: true })).toContainText("JPY");
await expect(form.getByRole("combobox", { name: "Pay period", exact: true })).toHaveValue("month");
await chooseCurrency(page, "EUR", form);
+ await form.getByRole("button", { name: "Clear selection", exact: true }).click();
+ await expect(form.getByRole("combobox", { name: "Currency", exact: true })).toHaveAttribute("aria-invalid", "true");
+ await chooseCurrency(page, "EUR", form);
await form.getByLabel("Base salary", { exact: true }).fill("8000");
await form.screenshot({ path: info.outputPath("offer-currency-choice.png"), animations: "disabled" });
await form.getByRole("button", { name: "Save offer", exact: true }).click();
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");
+});