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: align library header actions and remove tag count noise

Amruth Pillai87c37d004c13
diff --git a/apps/mobile/src/features/settings/application-profile.tsx b/apps/mobile/src/features/settings/application-profile.tsx
index deea0a160..7282cd214 100644
--- a/apps/mobile/src/features/settings/application-profile.tsx
+++ b/apps/mobile/src/features/settings/application-profile.tsx
@@ -30,7 +30,6 @@ export function ApplicationProfileSection() {
if (!scope) return null;
return (
<View style={{ gap: space.s6 }}>
- <Text color="ink2">{t`Details for your job application forms.`}</Text>
{query.isPending ? (
<Text>{t`Loading…`}</Text>
) : query.isError && query.data === undefined ? (
diff --git a/apps/web/src/components/input/chip-input.test.tsx b/apps/web/src/components/input/chip-input.test.tsx
index b667d81e8..8ea4245c2 100644
--- a/apps/web/src/components/input/chip-input.test.tsx
+++ b/apps/web/src/components/input/chip-input.test.tsx
@@ -23,6 +23,7 @@ it("keeps commas in new and edited keywords and saves on Enter", () => {
<ChipInput allowCommas defaultValue={["Existing"]} onChange={onChange} />
</I18nProvider>,
);
+ expect(screen.queryByText("1", { exact: true })).toBeNull();
const input = screen.getByRole("textbox", { name: "Add keyword" });
fireEvent.change(input, { target: { value: "Systems, distributed" } });
expect(onChange).not.toHaveBeenCalled();
diff --git a/apps/web/src/components/input/chip-input.tsx b/apps/web/src/components/input/chip-input.tsx
index 25a4116d1..38eb1d969 100644
--- a/apps/web/src/components/input/chip-input.tsx
+++ b/apps/web/src/components/input/chip-input.tsx
@@ -17,7 +17,6 @@ import {
useSortable,
} from "@dnd-kit/sortable";
import { CSS } from "@dnd-kit/utilities";
-import { i18n } from "@lingui/core";
import { t } from "@lingui/core/macro";
import { Trans } from "@lingui/react/macro";
import { useReducedMotion } from "motion/react";
@@ -384,16 +383,9 @@ export function ChipInput({
onChange={handleInputChange}
className="h-9 flex-1 border-none p-0 focus-visible:border-none focus-visible:ring-0 dark:bg-transparent"
/>
- {chips.length > 0 && (
- <span
- className={cn(
- "flex h-6 min-w-6 shrink-0 items-center justify-center rounded-md border px-1.5 text-[0.7rem] font-medium tabular-nums",
- isEditingKeyword
- ? "border-accent/30 bg-accent/10 text-accent-text"
- : "border-line bg-sunken/50 text-ink/80 opacity-80",
- )}
- >
- {isEditingKeyword ? <Trans>Edit</Trans> : i18n.number(chips.length)}
+ {isEditingKeyword && (
+ <span className="flex h-6 shrink-0 items-center rounded-md border border-accent/30 bg-accent/10 px-1.5 text-xs font-medium text-accent-text">
+ <Trans>Edit</Trans>
</span>
)}
</div>
diff --git a/apps/web/src/components/layout/page-header.tsx b/apps/web/src/components/layout/page-header.tsx
index f42471b2e..db47bf36d 100644
--- a/apps/web/src/components/layout/page-header.tsx
+++ b/apps/web/src/components/layout/page-header.tsx
@@ -2,7 +2,7 @@ import type { ReactNode } from "react";
type PageHeaderProps = {
title: ReactNode;
- /** One line under the title. */
+ /** Context for subpages such as Trash. Top-level titles stand alone. */
description?: ReactNode;
/** A small back link above the title. */
back?: ReactNode;
@@ -22,7 +22,7 @@ export function PageHeader({ title, description, back, actions, children }: Page
<h1 className="font-display text-[30px] leading-9">{title}</h1>
{description && <p className="text-sm text-ink-2">{description}</p>}
</div>
- {actions && <div className="flex items-center gap-2">{actions}</div>}
+ {actions && <div className="flex max-w-full flex-wrap items-center gap-2">{actions}</div>}
</header>
{children && <div className="flex flex-wrap items-center gap-3">{children}</div>}
</>
diff --git a/apps/web/src/features/documents/documents-page.tsx b/apps/web/src/features/documents/documents-page.tsx
index 76aefa09d..f2ac82815 100644
--- a/apps/web/src/features/documents/documents-page.tsx
+++ b/apps/web/src/features/documents/documents-page.tsx
@@ -323,26 +323,10 @@ export function DocumentsPage({ search, onSearchChange }: DocumentsPageProps) {
className="mx-auto grid w-full max-w-[1180px] content-start gap-5 px-8 py-8 max-sm:px-4 max-sm:py-5"
style={{ paddingBottom: selecting ? selectionBarSpace : undefined }}
>
- <PageHeader title={<Trans>Documents</Trans>}>
- {!firstRun && (
- <>
- <Tabs value={search.type} onValueChange={(type) => onSearchChange({ type: type as DocumentTypeFilter })}>
- <TabsList variant="line" aria-label={t`Document type`}>
- <TabsTrigger value="all">
- <Trans>All</Trans>
- <TabsCount>{i18n.number(counts.all)}</TabsCount>
- </TabsTrigger>
- <TabsTrigger value="resume">
- <Trans>Resumes</Trans>
- <TabsCount>{i18n.number(counts.resume)}</TabsCount>
- </TabsTrigger>
- <TabsTrigger value="letter">
- <Trans>Letters</Trans>
- <TabsCount>{i18n.number(counts.letter)}</TabsCount>
- </TabsTrigger>
- </TabsList>
- </Tabs>
-
+ <PageHeader
+ title={<Trans>Documents</Trans>}
+ actions={
+ !firstRun && (
<div className="ms-auto flex flex-wrap items-center gap-2 max-sm:ms-0 max-sm:w-full">
<InputGroup className="w-60 max-sm:w-full">
<InputGroupAddon>
@@ -408,6 +392,27 @@ export function DocumentsPage({ search, onSearchChange }: DocumentsPageProps) {
</SegmentedControlItem>
</SegmentedControl>
</div>
+ )
+ }
+ >
+ {!firstRun && (
+ <>
+ <Tabs value={search.type} onValueChange={(type) => onSearchChange({ type: type as DocumentTypeFilter })}>
+ <TabsList variant="line" aria-label={t`Document type`}>
+ <TabsTrigger value="all">
+ <Trans>All</Trans>
+ <TabsCount>{i18n.number(counts.all)}</TabsCount>
+ </TabsTrigger>
+ <TabsTrigger value="resume">
+ <Trans>Resumes</Trans>
+ <TabsCount>{i18n.number(counts.resume)}</TabsCount>
+ </TabsTrigger>
+ <TabsTrigger value="letter">
+ <Trans>Letters</Trans>
+ <TabsCount>{i18n.number(counts.letter)}</TabsCount>
+ </TabsTrigger>
+ </TabsList>
+ </Tabs>
</>
)}
</PageHeader>
diff --git a/apps/web/src/features/settings/ai/page.tsx b/apps/web/src/features/settings/ai/page.tsx
index dc42a93c1..c26793ca6 100644
--- a/apps/web/src/features/settings/ai/page.tsx
+++ b/apps/web/src/features/settings/ai/page.tsx
@@ -13,10 +13,7 @@ export function AiDeveloperSettings() {
const { newKey } = useSearch({ from: "/dashboard/settings/ai" });
return (
<>
- <PageHeader
- title={<Trans>AI &amp; developer</Trans>}
- description={<Trans>Connect the tools you use for writing, job search and working with your resumes.</Trans>}
- />
+ <PageHeader title={<Trans>AI &amp; developer</Trans>} />
<ProvidersSection />
<AiUsageSection />
<WebAccessSection />
diff --git a/apps/web/src/features/settings/profile.tsx b/apps/web/src/features/settings/profile.tsx
index a95d831b3..d7a8f90e3 100644
--- a/apps/web/src/features/settings/profile.tsx
+++ b/apps/web/src/features/settings/profile.tsx
@@ -34,7 +34,7 @@ export function ProfileSettings() {
const query = useQuery(orpc.applicationProfile.get.queryOptions());
return (
<>
- <PageHeader title={<Trans>Profile</Trans>} description={<Trans>Details for your job application forms.</Trans>} />
+ <PageHeader title={<Trans>Profile</Trans>} />
{query.isPending ? (
<p role="status">
<Trans>Loading…</Trans>
diff --git a/apps/web/src/routes/dashboard/career/route.tsx b/apps/web/src/routes/dashboard/career/route.tsx
index d54a07112..402efc65a 100644
--- a/apps/web/src/routes/dashboard/career/route.tsx
+++ b/apps/web/src/routes/dashboard/career/route.tsx
@@ -4,7 +4,6 @@ import { Trans } from "@lingui/react/macro";
import { createFileRoute, Link, Outlet, useMatchRoute } from "@tanstack/react-router";
import { Icon } from "@reactive-resume/ui/components/icon";
import { Tabs, TabsList, TabsTrigger } from "@reactive-resume/ui/components/tabs";
-import { useBreakpoint } from "@reactive-resume/ui/hooks/use-breakpoint";
import { cn } from "@reactive-resume/utils/style";
import { PageHeader } from "@/components/layout/page-header";
import { getPageTitle } from "@/libs/seo";
@@ -46,7 +45,6 @@ function CareerLayout() {
];
const current = places.find((place) => matchRoute({ to: place.match, fuzzy: place.match !== "/dashboard/career/" }));
const coach = current?.match === "/dashboard/career/coach";
- const phone = useBreakpoint() === "mobile";
return (
<div
@@ -58,14 +56,7 @@ function CareerLayout() {
"max-sm:h-[calc(100dvh-53px-env(safe-area-inset-bottom))] max-sm:min-h-0 max-sm:gap-3 max-sm:overflow-hidden max-sm:pt-3 max-sm:pb-3",
)}
>
- <PageHeader
- title={<Trans>Career</Trans>}
- {...(coach && phone
- ? {}
- : {
- description: <Trans>Plan your search, keep your evidence in one place, and decide between offers.</Trans>,
- })}
- >
+ <PageHeader title={<Trans>Career</Trans>}>
<Tabs
value={current?.to ?? null}
className="-mx-4 max-w-[100vw] [scrollbar-width:none] overflow-x-auto px-4 max-sm:[mask-image:linear-gradient(to_right,black_calc(100%-24px),transparent)] max-sm:pe-7 sm:mx-0 sm:px-0 max-sm:rtl:[mask-image:linear-gradient(to_left,black_calc(100%-24px),transparent)]"
diff --git a/docs/guides/managing-documents.mdx b/docs/guides/managing-documents.mdx
index a59da0464..384092562 100644
--- a/docs/guides/managing-documents.mdx
+++ b/docs/guides/managing-documents.mdx
@@ -32,6 +32,15 @@ Use the controls above your documents:
</Frame>
- **All**, **Resumes** and **Letters** show one type at a time. Tab counts cover every result matching your search, tags and Public filter, across all pages. A job's resume and letter stay together under the job's heading.
+ On wide screens, search, sort and view controls sit beside the Documents title. On smaller screens, they wrap so each control stays reachable.
+
+<Frame caption="Documents controls beside the title">
+ <img
+ src="/images/guides/managing-documents/documents-header.webp"
+ alt="Documents title with Search, Last edited sort, Grid and List controls"
+ />
+</Frame>
+
- **Search** matches document names, tags, and the company or role of a linked application. It accepts up to 500 characters. Press <kbd>/</kbd> anywhere on the page to jump to it. In the search box, <kbd>Enter</kbd> opens the first result, even if you press it before the results update; <kbd>↓</kbd> moves to the results; <kbd>Esc</kbd> clears the search, and a second <kbd>Esc</kbd> leaves the box.
- The sort menu orders documents by **Last edited** (the default), **Name** or **Created**. **Last edited** follows content edits only.
- Tag chips appear once any document has a tag. See [Organizing documents with tags](/guides/organizing-with-tags).
diff --git a/docs/images/guides/managing-documents/documents-header.webp b/docs/images/guides/managing-documents/documents-header.webp
new file mode 100644
index 000000000..573fba129
Binary files /dev/null and b/docs/images/guides/managing-documents/documents-header.webp differ
diff --git a/tests/e2e/specs/library-header-polish.spec.ts b/tests/e2e/specs/library-header-polish.spec.ts
new file mode 100644
index 000000000..615fc17fd
--- /dev/null
+++ b/tests/e2e/specs/library-header-polish.spec.ts
@@ -0,0 +1,35 @@
+import type { Page } from "@playwright/test";
+import { expect, test } from "../fixtures/test";
+async function seed(page: Page) {
+ const r = await page.request.post("/api/openapi/resumes", {
+ data: { name: "Fictional header audit", tags: ["Remote", "Design"] },
+ });
+ await expect(r).toBeOK();
+ return r.json();
+}
+for (const width of [1440, 1024, 390])
+ test(`D2-08 document tools occupy the shared header actions at ${width}`, async ({ authPage: page }, info) => {
+ await seed(page);
+ await page.setViewportSize({ width, height: 900 });
+ await page.goto("/dashboard");
+ const header = page
+ .locator("header")
+ .filter({ has: page.getByRole("heading", { name: "Documents", exact: true }) });
+ await expect(header.getByRole("searchbox", { name: "Search documents", exact: true })).toBeVisible();
+ await expect(header.getByRole("combobox", { name: "Sort", exact: true })).toBeVisible();
+ await expect(header.getByRole("radio", { name: "Grid", exact: true })).toBeVisible();
+ expect(await page.evaluate(() => document.documentElement.scrollWidth <= innerWidth)).toBe(true);
+ if (width === 1440)
+ await header.screenshot({ path: info.outputPath("documents-header.png"), animations: "disabled" });
+ });
+test("L2-23 tags show entries without unexplained numeric count", async ({ authPage: page }) => {
+ const id = await seed(page);
+ await page.goto(`/builder/${id}`);
+ await page.getByRole("button", { name: "Document menu: Fictional header audit", exact: true }).click();
+ await page.getByRole("menuitem", { name: /^Tags/ }).click();
+ const dialog = page.getByRole("dialog", { name: "Tags", exact: true });
+ await expect(dialog.getByPlaceholder("Add a tag…", { exact: true })).toBeVisible();
+ await expect(dialog.getByText("2", { exact: true })).toHaveCount(0);
+ await expect(dialog.getByText("Remote", { exact: true })).toBeVisible();
+ await expect(dialog.getByText("Design", { exact: true })).toBeVisible();
+});