Skip to content

Job application tracker and AI-powered job search assistant. Helps job seekers manage their search journey with AI resume review, job matching, task logging, and application analytics, all while keeping your data private.

feat(dashboard): add Activity and Contact quick-add shortcuts, re-icon the card, and document it in the wiki

Khuram Niaz59879dcc5e4e
diff --git a/__tests__/ActivitiesContainer.spec.tsx b/__tests__/ActivitiesContainer.spec.tsx
index 3d2ee42..fa914dc 100644
--- a/__tests__/ActivitiesContainer.spec.tsx
+++ b/__tests__/ActivitiesContainer.spec.tsx
@@ -39,6 +39,11 @@ vi.mock("next-auth/providers/credentials", () => ({
})),
}));
+vi.mock("next/navigation", () => ({
+ useRouter: vi.fn(() => ({ replace: vi.fn() })),
+ useSearchParams: vi.fn(() => new URLSearchParams()),
+}));
+
vi.mock("@/actions/activity.actions", () => ({
getActivitiesList: vi.fn(),
getCurrentActivity: vi.fn(),
diff --git a/__tests__/AddContactShortcut.spec.tsx b/__tests__/AddContactShortcut.spec.tsx
new file mode 100644
index 0000000..037f806
--- /dev/null
+++ b/__tests__/AddContactShortcut.spec.tsx
@@ -0,0 +1,79 @@
+import AddContactShortcut from "@/components/dashboard/AddContactShortcut";
+import { render, screen, waitFor } from "@testing-library/react";
+import userEvent from "@testing-library/user-event";
+import { getAllCompanies } from "@/actions/company.actions";
+import { getAllJobLocations } from "@/actions/jobLocation.actions";
+import { getAllContactRoles } from "@/actions/contactRole.actions";
+
+vi.mock("@/actions/company.actions", () => ({ getAllCompanies: vi.fn() }));
+vi.mock("@/actions/jobLocation.actions", () => ({
+ getAllJobLocations: vi.fn(),
+}));
+vi.mock("@/actions/contactRole.actions", () => ({
+ getAllContactRoles: vi.fn(),
+}));
+
+vi.mock("@/components/AddContact", () => ({
+ __esModule: true,
+ default: ({ dialogOpen, setDialogOpen, companies, locations, roles }: any) =>
+ dialogOpen ? (
+ <div data-testid="add-contact-dialog">
+ <span data-testid="picker-counts">
+ {companies.length}/{locations.length}/{roles.length}
+ </span>
+ <button type="button" onClick={() => setDialogOpen(false)}>
+ Close
+ </button>
+ </div>
+ ) : null,
+}));
+
+describe("AddContactShortcut", () => {
+ const user = userEvent.setup({ skipHover: true });
+
+ beforeEach(() => {
+ vi.clearAllMocks();
+ (getAllCompanies as any).mockResolvedValue([
+ { id: "co1", label: "Shopify", value: "shopify", createdBy: "u1" },
+ ]);
+ (getAllJobLocations as any).mockResolvedValue([
+ { id: "l1", label: "Toronto, ON", value: "toronto on", createdBy: "u1" },
+ ]);
+ (getAllContactRoles as any).mockResolvedValue([
+ { id: "r1", label: "Recruiter", value: "recruiter", createdBy: "u1" },
+ { id: "r2", label: "Reference", value: "reference", createdBy: "u1" },
+ ]);
+ });
+
+ it("keeps the dialog closed and fetches nothing until the button is clicked", () => {
+ render(<AddContactShortcut />);
+
+ expect(screen.getByRole("button", { name: /add contact/i })).toBeTruthy();
+ expect(screen.queryByTestId("add-contact-dialog")).toBeNull();
+ expect(getAllCompanies).not.toHaveBeenCalled();
+ });
+
+ it("opens the dialog and hands it the fetched picker options", async () => {
+ render(<AddContactShortcut />);
+
+ await user.click(screen.getByRole("button", { name: /add contact/i }));
+
+ expect(screen.getByTestId("add-contact-dialog")).toBeTruthy();
+ await waitFor(() =>
+ expect(screen.getByTestId("picker-counts").textContent).toBe("1/1/2"),
+ );
+ });
+
+ it("fetches the picker options only once across reopens", async () => {
+ render(<AddContactShortcut />);
+
+ await user.click(screen.getByRole("button", { name: /add contact/i }));
+ await waitFor(() => expect(getAllCompanies).toHaveBeenCalledTimes(1));
+ await user.click(screen.getByRole("button", { name: /close/i }));
+ await user.click(screen.getByRole("button", { name: /add contact/i }));
+
+ expect(getAllCompanies).toHaveBeenCalledTimes(1);
+ expect(getAllJobLocations).toHaveBeenCalledTimes(1);
+ expect(getAllContactRoles).toHaveBeenCalledTimes(1);
+ });
+});
diff --git a/__tests__/JobsAppliedCard.spec.tsx b/__tests__/JobsAppliedCard.spec.tsx
index dd48c0b..fe7fc6c 100644
--- a/__tests__/JobsAppliedCard.spec.tsx
+++ b/__tests__/JobsAppliedCard.spec.tsx
@@ -19,7 +19,7 @@ describe("JobsAppliedCard", () => {
const user = userEvent.setup();
render(<JobsAppliedCard />);
- await user.click(screen.getByRole("button", { name: /^job$/i }));
+ await user.click(screen.getByRole("button", { name: /^add job$/i }));
expect(mockPush).toHaveBeenCalledWith("/dashboard/myjobs?add-job=true");
});
@@ -28,8 +28,19 @@ describe("JobsAppliedCard", () => {
const user = userEvent.setup();
render(<JobsAppliedCard />);
- await user.click(screen.getByRole("button", { name: /^task$/i }));
+ await user.click(screen.getByRole("button", { name: /^add task$/i }));
expect(mockPush).toHaveBeenCalledWith("/dashboard/tasks?add-task=true");
});
+
+ it("should navigate to activities page with add-activity=true when Activity button is clicked", async () => {
+ const user = userEvent.setup();
+ render(<JobsAppliedCard />);
+
+ await user.click(screen.getByRole("button", { name: /^add activity$/i }));
+
+ expect(mockPush).toHaveBeenCalledWith(
+ "/dashboard/activities?add-activity=true",
+ );
+ });
});
diff --git a/src/components/activities/ActivitiesContainer.tsx b/src/components/activities/ActivitiesContainer.tsx
index b025d39..2a0e2b0 100644
--- a/src/components/activities/ActivitiesContainer.tsx
+++ b/src/components/activities/ActivitiesContainer.tsx
@@ -6,6 +6,7 @@ import { Button } from "../ui/button";
import { Loader, PlusCircle } from "lucide-react";
import { SearchInput } from "../SearchInput";
import { useCallback, useEffect, useRef, useState } from "react";
+import { useRouter, useSearchParams } from "next/navigation";
import {
Dialog,
DialogContent,
@@ -25,6 +26,9 @@ import { useActivity } from "@/context/ActivityContext";
import { useActivitySwitchConfirm } from "@/hooks/useActivitySwitchConfirm";
function ActivitiesContainer() {
+ const router = useRouter();
+ const searchParams = useSearchParams();
+ const autoOpenHandled = useRef(false);
const [activityFormOpen, setActivityFormOpen] = useState<boolean>(false);
const [activitiesList, setActivitiesList] = useState<Activity[]>([]);
const [page, setPage] = useState<number>(1);
@@ -82,6 +86,20 @@ function ActivitiesContainer() {
});
};
+ useEffect(() => {
+ if (autoOpenHandled.current) return;
+ if (searchParams.get("add-activity") === "true") {
+ autoOpenHandled.current = true;
+ setActivityFormOpen(true);
+ const params = new URLSearchParams(searchParams.toString());
+ params.delete("add-activity");
+ const newPath = params.toString()
+ ? `?${params.toString()}`
+ : window.location.pathname;
+ router.replace(newPath);
+ }
+ }, [router, searchParams]);
+
useEffect(() => {
loadActivities(1, APP_CONSTANTS.RECORDS_PER_PAGE);
}, [loadActivities]);
diff --git a/src/components/dashboard/AddContactShortcut.tsx b/src/components/dashboard/AddContactShortcut.tsx
new file mode 100644
index 0000000..6419a0a
--- /dev/null
+++ b/src/components/dashboard/AddContactShortcut.tsx
@@ -0,0 +1,58 @@
+"use client";
+import { useCallback, useRef, useState } from "react";
+import { Users } from "lucide-react";
+import { Button } from "@/components/ui/button";
+import AddContact from "@/components/AddContact";
+import { getAllCompanies } from "@/actions/company.actions";
+import { getAllJobLocations } from "@/actions/jobLocation.actions";
+import { getAllContactRoles } from "@/actions/contactRole.actions";
+import type { ContactRole } from "@/models/contact.model";
+import type { Company, JobLocation } from "@/models/job.model";
+
+export default function AddContactShortcut() {
+ const [dialogOpen, setDialogOpen] = useState(false);
+ const [companies, setCompanies] = useState<Company[]>([]);
+ const [locations, setLocations] = useState<JobLocation[]>([]);
+ const [roles, setRoles] = useState<ContactRole[]>([]);
+ const [pickersLoading, setPickersLoading] = useState(false);
+ const pickersRequested = useRef(false);
+
+ // Most visits never open the dialog, so its three option lists wait for it
+ const openDialog = useCallback((open: boolean) => {
+ setDialogOpen(open);
+ if (!open || pickersRequested.current) return;
+ pickersRequested.current = true;
+ setPickersLoading(true);
+ Promise.all([getAllCompanies(), getAllJobLocations(), getAllContactRoles()])
+ .then(([companyList, locationList, roleList]) => {
+ if (Array.isArray(companyList)) setCompanies(companyList);
+ if (Array.isArray(locationList)) setLocations(locationList);
+ if (Array.isArray(roleList)) setRoles(roleList);
+ })
+ .finally(() => setPickersLoading(false));
+ }, []);
+
+ return (
+ <>
+ <Button
+ variant="outline"
+ className="justify-start min-w-0"
+ onClick={() => openDialog(true)}
+ >
+ <Users className="h-3.5 w-3.5 mr-1 shrink-0" />
+ <span className="min-w-0 truncate">Add Contact</span>
+ </Button>
+ <AddContact
+ hideTrigger
+ dialogOpen={dialogOpen}
+ setDialogOpen={openDialog}
+ pickersLoading={pickersLoading}
+ companies={companies}
+ locations={locations}
+ roles={roles}
+ reloadContacts={() => {}}
+ resetEditContact={() => {}}
+ />
+ </>
+ );
+}
diff --git a/src/components/dashboard/JobsAppliedCard.tsx b/src/components/dashboard/JobsAppliedCard.tsx
index 04224fd..d75eff4 100644
--- a/src/components/dashboard/JobsAppliedCard.tsx
+++ b/src/components/dashboard/JobsAppliedCard.tsx
@@ -7,8 +7,15 @@ import {
CardHeader,
CardTitle,
} from "@/components/ui/card";
-import { PlusCircle } from "lucide-react";
+import {
+ BookOpen,
+ BriefcaseBusiness,
+ CalendarClock,
+ SquareCheckBig,
+ Zap,
+} from "lucide-react";
import { useRouter } from "next/navigation";
+import AddContactShortcut from "./AddContactShortcut";
export default function JobsAppliedCard() {
const router = useRouter();
@@ -17,7 +24,7 @@ export default function JobsAppliedCard() {
<CardHeader className="pb-3">
<CardTitle className="text-lg text-green-600">Dashboard</CardTitle>
<CardDescription className="max-w-lg text-balance leading-relaxed">
- Create new jobs, tasks, automations, and questions.
+ Create new jobs, automations, tasks, activities, questions, and contacts.
</CardDescription>
</CardHeader>
<CardFooter className="mt-auto grid grid-cols-2 gap-2">
@@ -26,8 +33,8 @@ export default function JobsAppliedCard() {
className="justify-start min-w-0"
onClick={() => router.push("/dashboard/myjobs?add-job=true")}
>
- <PlusCircle className="h-3.5 w-3.5 mr-1 shrink-0" />
- <span className="min-w-0 truncate">Job</span>
+ <BriefcaseBusiness className="h-3.5 w-3.5 mr-1 shrink-0" />
+ <span className="min-w-0 truncate">Add Job</span>
</Button>
<Button
variant="outline"
@@ -36,16 +43,16 @@ export default function JobsAppliedCard() {
router.push("/dashboard/automations?add-automation=true")
}
>
- <PlusCircle className="h-3.5 w-3.5 mr-1 shrink-0" />
- <span className="min-w-0 truncate">Automation</span>
+ <Zap className="h-3.5 w-3.5 mr-1 shrink-0" />
+ <span className="min-w-0 truncate">Add Automation</span>
</Button>
<Button
variant="outline"
className="justify-start min-w-0"
onClick={() => router.push("/dashboard/tasks?add-task=true")}
>
- <PlusCircle className="h-3.5 w-3.5 mr-1 shrink-0" />
- <span className="min-w-0 truncate">Task</span>
+ <SquareCheckBig className="h-3.5 w-3.5 mr-1 shrink-0" />
+ <span className="min-w-0 truncate">Add Task</span>
</Button>
<Button
variant="outline"
@@ -54,9 +61,20 @@ export default function JobsAppliedCard() {
router.push("/dashboard/questions?add-question=true")
}
>
- <PlusCircle className="h-3.5 w-3.5 mr-1 shrink-0" />
- <span className="min-w-0 truncate">Question</span>
+ <BookOpen className="h-3.5 w-3.5 mr-1 shrink-0" />
+ <span className="min-w-0 truncate">Add Question</span>
+ </Button>
+ <Button
+ variant="outline"
+ className="justify-start min-w-0"
+ onClick={() =>
+ router.push("/dashboard/activities?add-activity=true")
+ }
+ >
+ <CalendarClock className="h-3.5 w-3.5 mr-1 shrink-0" />
+ <span className="min-w-0 truncate">Add Activity</span>
</Button>
+ <AddContactShortcut />
</CardFooter>
</Card>
);
diff --git a/wiki/activities.md b/wiki/activities.md
index 7cad39f..baff0b3 100644
--- a/wiki/activities.md
+++ b/wiki/activities.md
@@ -47,7 +47,7 @@ A running activity does not appear in the Activities list at all; it shows up th
## How do I log time I already spent?
-Click **New Activity** in the Activities card header. Fill in **Activity Name** (at least two characters) and **Activity Type** — both are required, and the type combo box creates a new type if you type a name that does not exist. Set **Start Date**, **Start Time**, **End Date** and **End Time**; the End Time label shows the duration as you change them.
+Click **New Activity** in the Activities card header, or **Add Activity** on the Dashboard, which opens the same form. Fill in **Activity Name** (at least two characters) and **Activity Type** — both are required, and the type combo box creates a new type if you type a name that does not exist. Set **Start Date**, **Start Time**, **End Date** and **End Time**; the End Time label shows the duration as you change them.
The start cannot be in the future, the end must be after the start, and the duration must be between 2 minutes and 8 hours. **Description** holds up to 1000 characters. An activity added this way is not linked to a task.
diff --git a/wiki/contacts.md b/wiki/contacts.md
index fb1b756..e01eb07 100644
--- a/wiki/contacts.md
+++ b/wiki/contacts.md
@@ -19,7 +19,7 @@ Contacts live under **Library → Contacts**, and a contact can be linked to any
## How do I add a contact?
-Open **Library** in the sidebar, go to the **Contacts** tab and click **New Contact**. Only **Name** is required — everything else can be filled in later by editing the contact, and a name-and-email row is a perfectly useful record on day one.
+Open **Library** in the sidebar, go to the **Contacts** tab and click **New Contact**. **Add Contact** on the Dashboard opens the same form without leaving the Dashboard. Only **Name** is required — everything else can be filled in later by editing the contact, and a name-and-email row is a perfectly useful record on day one.
Company, Location, Role and *Worked together at* are combo boxes: they pick an existing entry or create a new one from what you type, so you never have to set up a company before adding the person who works there. Company is where the person works now; Role is the role they usually play for you, and it is what the role filter matches when the person is not yet on any job.
diff --git a/wiki/getting-started.md b/wiki/getting-started.md
index 95b3f16..5493e0a 100644
--- a/wiki/getting-started.md
+++ b/wiki/getting-started.md
@@ -3,7 +3,7 @@ type: tutorial
title: Getting Started
description: The first run through JobSync — creating an account, connecting an AI provider, adding a job, and what each sidebar area is for.
feature: setup
-tags: [setup, first run, sign in, account, ai provider, ollama, sidebar, navigation]
+tags: [setup, first run, sign in, account, ai provider, ollama, sidebar, navigation, dashboard, quick add, shortcuts]
aliases: [new user, onboarding, first steps, how do I start, set up jobsync]
status: stable
stale_after: 2027-08-31
@@ -27,9 +27,15 @@ Click **Jobs** in the sidebar, then the **Add Job** button in the top-right of t
There is a faster route once an AI provider is set: click **Chat AI** in the header, paste the full text of a job posting into the chat, and the assistant extracts the details and shows you exactly what it found before anything is saved. Nothing is written until you approve it.
+## How do I add something quickly from the Dashboard?
+
+The card in the top-left of the Dashboard has six buttons — **Add Job**, **Add Automation**, **Add Task**, **Add Question**, **Add Activity** and **Add Contact** — each opening the same form you would reach by navigating to that area yourself.
+
+Five of them take you to the matching page with the form already open, so you land where the new record will appear. **Add Contact** is the exception: it opens the contact form over the Dashboard, and saving leaves you there rather than on **Library → Contacts**.
+
## What is each area of the sidebar for?
-- **Dashboard** — summary cards: application counts, recent jobs and activities, and weekly charts.
+- **Dashboard** — summary cards: application counts, recent jobs and activities, weekly charts, and a quick-add card for the six kinds of record you create most.
- **Jobs** — every job you are tracking, plus jobs discovered by automations.
- **Automations** — scheduled searches that pull new postings in and score them against your resume.
- **Tasks** — to-dos with a due date, priority and percent complete, and a timed activity you can start from each one.