A one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!
TypeScript agent-skillsaidsh-pluginhacktoberfestjavascriptmcp-serverreactresume-builderself-hostedtypescript
fix: show document tags and consume selected suggestions
Amruth Pillaia952d89cfb5d
diff --git a/apps/mobile/scripts/experience.test.mjs b/apps/mobile/scripts/experience.test.mjsindex fe459f115..3c3b3f402 100644--- a/apps/mobile/scripts/experience.test.mjs+++ b/apps/mobile/scripts/experience.test.mjs@@ -4412,6 +4412,25 @@ control(menuView(), "Back").onPress();assert.equal(tagsAction().disabled, true);console.log("PASS native builder tags use draft flush, retain body, and respect tag limits and locks");+hooks = [];+let suggestedTags = ["chosen"];+const suggestedCommit = { current: null };+const suggestedView = () =>+ render(NativeTagInput, {+ label: "Tags",+ values: suggestedTags,+ onChange: (next) => {+ suggestedTags = next;+ },+ suggestions: ["remote"],+ commitRef: suggestedCommit,+ });+control(suggestedView(), "Tags").onChangeText("rem");+control(suggestedView(), "remote").onPress();+suggestedView();+assert.deepEqual(suggestedCommit.current(), ["chosen", "remote"], "suggestion consumes its typed filter before Save");+console.log("PASS native filtered tag suggestion never saves the filter as another tag");+control(menuView(), "Document options").onPress();nodes(menuView()).find((node) => node.type === "ListRow" && node.props.title === "Translate into…")diff --git a/apps/mobile/src/ui/fields.tsx b/apps/mobile/src/ui/fields.tsxindex 0c2dbe32a..bf23cd73c 100644--- a/apps/mobile/src/ui/fields.tsx+++ b/apps/mobile/src/ui/fields.tsx@@ -598,7 +598,14 @@ export function ChipInput({) : null}<View style={{ flexDirection: "row", flexWrap: "wrap", gap: space.s1 + space.s0 }}>{offered.map((suggestion) => (- <Chip key={suggestion} label={suggestion} onPress={() => add([suggestion])} />+ <Chip+ key={suggestion}+ label={suggestion}+ onPress={() => {+ add([suggestion]);+ setDraft("");+ }}+ />))}</View></View>diff --git a/apps/web/src/components/input/chip-input.test.tsx b/apps/web/src/components/input/chip-input.test.tsxindex 9bfb6d4ad..b667d81e8 100644--- a/apps/web/src/components/input/chip-input.test.tsx+++ b/apps/web/src/components/input/chip-input.test.tsx@@ -150,3 +150,22 @@ it("explicit Save commits an edited tag and preserves duplicate and Escape behavfireEvent.click(screen.getByRole("button", { name: "Save tags" }));expect(saved).toHaveBeenLastCalledWith(["Revised", "Beta"]);});++it.each([false, true])("selecting a filtered suggestion consumes its draft before Save (editing=%s)", (editing) => {+ const commitRef = createRef<() => string[]>();+ const saved = vi.fn();+ render(+ <I18nProvider i18n={i18n}>+ <ChipInput defaultValue={["Design"]} suggestions={["Remote"]} commitRef={commitRef} />+ <button onClick={() => saved(commitRef.current?.())}>Save tags</button>+ </I18nProvider>,+ );+ if (editing) fireEvent.click(screen.getByRole("button", { name: "Edit Design" }));+ const input = screen.getByRole("textbox");+ fireEvent.change(input, { target: { value: "rem" } });+ fireEvent.click(screen.getByRole("button", { name: "Add Remote" }));+ expect(input).toHaveValue("");+ expect(document.activeElement).toBe(input);+ fireEvent.click(screen.getByRole("button", { name: "Save tags" }));+ expect(saved).toHaveBeenLastCalledWith(editing ? ["Remote"] : ["Design", "Remote"]);+});diff --git a/apps/web/src/components/input/chip-input.tsx b/apps/web/src/components/input/chip-input.tsxindex eb3a7a06e..25a4116d1 100644--- a/apps/web/src/components/input/chip-input.tsx+++ b/apps/web/src/components/input/chip-input.tsx@@ -427,7 +427,13 @@ export function ChipInput({message: `Add ${suggestion}`,})}className="inline-flex min-h-7 max-w-full items-center gap-1 rounded-sm border border-line-2 px-2.5 text-[13px] text-ink-2 transition-colors duration-quick hover:bg-hover focus-visible:ring-2 focus-visible:ring-accent/50 focus-visible:outline-none pointer-coarse:min-h-11"- onClick={() => addChips([suggestion])}+ onClick={() => {+ if (editingIndex === null) addChips([suggestion]);+ else updateChip(editingIndex, suggestion);+ setInput("");+ setEditingIndex(null);+ inputRef.current?.focus();+ }}><Icon name="plus" size={12} className="shrink-0 text-ink-3" /><span className="truncate">{suggestion}</span>diff --git a/apps/web/src/features/documents/document-card.test.tsx b/apps/web/src/features/documents/document-card.test.tsxindex 478a921f8..49a5e7bc9 100644--- a/apps/web/src/features/documents/document-card.test.tsx+++ b/apps/web/src/features/documents/document-card.test.tsx@@ -1,6 +1,6 @@import type { DocumentSummary } from "./filter";// @vitest-environment happy-dom-import { render, screen, waitFor } from "@testing-library/react";+import { render, screen, waitFor, within } from "@testing-library/react";import { expect, it, vi } from "vite-plus/test";import { i18n } from "@lingui/core";import { I18nProvider } from "@lingui/react";@@ -135,3 +135,18 @@ it("fetches a new preview after the letter's content edit", async () => {expect(await screen.findByText("Second version.")).toBeTruthy();await waitFor(() => expect(letters.load).toHaveBeenCalledTimes(2));});++it("shows saved tags without changing the document link name and removes empty tag metadata", () => {+ const document = { ...letter(new Date("2026-10-19T00:00:00.000Z")), tags: ["remote", "مرحبا", "x".repeat(50)] };+ const view = renderCard(document, { inView: false });+ const tags = screen.getByRole("list", { name: "Tags" });+ expect(+ within(tags)+ .getAllByRole("listitem")+ .map((item) => item.textContent),+ ).toEqual(document.tags.map((tag) => `#${tag}`));+ expect(within(tags).getByText("#مرحبا").getAttribute("dir")).toBe("auto");+ expect(screen.getByRole("link", { name: document.name })).toBeTruthy();+ view.update({ ...document, tags: [] });+ expect(screen.queryByRole("list", { name: "Tags" })).toBeNull();+});diff --git a/apps/web/src/features/documents/document-card.tsx b/apps/web/src/features/documents/document-card.tsxindex 5aba26219..440bd4a73 100644--- a/apps/web/src/features/documents/document-card.tsx+++ b/apps/web/src/features/documents/document-card.tsx@@ -46,6 +46,21 @@ function useDocumentMeta(document: DocumentSummary) {return t`${type} · Edited ${formatRelativeTime(document.editedAt, i18n.locale, "short")}`;}+type DocumentTagsProps = { tags: readonly string[] };++function DocumentTags({ tags }: DocumentTagsProps) {+ if (tags.length === 0) return null;+ return (+ <ul aria-label={t`Tags`} className="flex min-w-0 flex-wrap gap-x-2 gap-y-0.5 text-xs text-ink-3">+ {tags.map((tag) => (+ <li key={tag} dir="auto" className="max-w-full [overflow-wrap:anywhere]">+ #{tag}+ </li>+ ))}+ </ul>+ );+}+/** Opens the document in its editor: resumes and letters share the editor shell. */function OpenLink({document,@@ -284,6 +299,7 @@ export function DocumentCard({</h2>)}<span className="truncate text-xs text-ink-3">{meta}</span>+ <DocumentTags tags={document.tags} />{document.application ? (<span className="flex min-w-0 items-center gap-1 text-xs text-ink-2"><Icon name="briefcase" size={14} />@@ -418,6 +434,11 @@ export function DocumentRow({</span>)}</span>+ {document.tags.length > 0 && (+ <div className="mt-1 ps-6">+ <DocumentTags tags={document.tags} />+ </div>+ )}</td><td className="px-2 text-sm text-ink-2 max-sm:hidden">{document.type === "resume" ? <Trans>Resume</Trans> : <Trans>Letter</Trans>}diff --git a/docs/guides/organizing-with-tags.mdx b/docs/guides/organizing-with-tags.mdxindex 989e594c6..0f1a665e5 100644--- a/docs/guides/organizing-with-tags.mdx+++ b/docs/guides/organizing-with-tags.mdx@@ -59,3 +59,16 @@ Tag filters work together with the **All**, **Resumes** and **Letters** tabs and- [Managing your documents](/guides/managing-documents): search, sort, rename and duplicate.- [Tracking job applications](/guides/tracking-job-applications): follow each application from saved to closed.++## See tags while browsing++Document tags appear below the name in both **Grid** and **List** views, for resumes and letters. The native library+also shows each document's tags. Use the tag buttons above the web library to filter documents; to edit tags, open+**Options** → **Tags…**.++<Frame caption="Tags stay visible beneath the document name">+ <img+ src="/images/guides/organizing-with-tags/document-tags.webp"+ alt="Fictional sample resume card with remote and Arabic tags below its name"+ />+</Frame>diff --git a/docs/images/guides/organizing-with-tags/document-tags.webp b/docs/images/guides/organizing-with-tags/document-tags.webpnew file mode 100644index 000000000..22ade7544Binary files /dev/null and b/docs/images/guides/organizing-with-tags/document-tags.webp differdiff --git a/tests/e2e/specs/document-tags.spec.ts b/tests/e2e/specs/document-tags.spec.tsnew file mode 100644index 000000000..05b735838--- /dev/null+++ b/tests/e2e/specs/document-tags.spec.ts@@ -0,0 +1,31 @@+import { test, expect } from "../fixtures/test";+for (const width of [1440, 390])+ for (const type of ["resume", "letter"])+ for (const view of ["grid", "list"])+ test(`document tags visible for ${type} ${view} ${width}`, async ({ authPage: page }, info) => {+ await page.setViewportSize({ width, height: 1000 });+ const r = await page.request.post(type === "resume" ? "/api/openapi/resumes" : "/api/openapi/cover-letters", {+ data: { name: "Fictional tagged document", tags: [], ...(type === "resume" ? { withSampleData: true } : {}) },+ });+ expect(r.ok()).toBe(true);+ const result = await r.json();+ const id = type === "resume" ? result : result.id;+ await expect(+ await page.request.post("/api/rpc/documents/setTags", {+ data: { json: { type, id, tags: ["remote", "مرحبا"] } },+ }),+ ).toBeOK();++ await page.goto(`/dashboard?view=${view}`);+ const item = page.locator(`[data-document-key="${type}:${id}"]`);+ await expect(item).toBeVisible();+ await expect(item.getByText("#remote", { exact: true })).toBeVisible();+ await expect(item.getByText("#مرحبا", { exact: true })).toBeVisible();+ expect(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth)).toBe(true);+ if (width === 1440 && type === "resume" && view === "grid") {+ await expect(item.locator('[style*="background-image"]')).toBeVisible({ timeout: 20000 });+ await page+ .getByRole("main")+ .screenshot({ path: info.outputPath("document-tags.png"), animations: "disabled" });+ }+ });