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.
TypeScript ai-agentai-resume-analyzerapplication-trackerapplication-tracking-systematscareerjob-applicationjob-automationjob-huntingjob-searchjob-seeker-toolsjob-trackerjob-trackingjobsearchjobseekersmcpollamaresumeresume-reviewself-hosted
feat(timeline): expand prep-list answers inline, tag new questions with the TagInput, and reorder the job-details tabs
Khuram Niaz471c1b5544ef
diff --git a/src/actions/job/queries.ts b/src/actions/job/queries.tsindex 32d2c71..304deb6 100644--- a/src/actions/job/queries.ts+++ b/src/actions/job/queries.ts@@ -93,7 +93,11 @@ const JOB_DETAILS_INCLUDE = {orderBy: { createdAt: "asc" as const },},prepQuestions: {- include: { Question: { select: { id: true, question: true, tags: true } } },+ include: {+ Question: {+ select: { id: true, question: true, answer: true, tags: true },+ },+ },orderBy: { createdAt: "asc" as const },},},diff --git a/src/actions/jobStage/shared.ts b/src/actions/jobStage/shared.tsindex 2ec951c..386e97d 100644--- a/src/actions/jobStage/shared.ts+++ b/src/actions/jobStage/shared.ts@@ -26,7 +26,7 @@ export const STAGE_DETAIL_INCLUDE = {},prepQuestions: {include: {- Question: { select: { id: true, question: true, tags: true } },+ Question: { select: { id: true, question: true, answer: true, tags: true } },},orderBy: { createdAt: "asc" as const },},diff --git a/src/components/myjobs/JobDetails.tsx b/src/components/myjobs/JobDetails.tsxindex 3f32b1a..2ac3673 100644--- a/src/components/myjobs/JobDetails.tsx+++ b/src/components/myjobs/JobDetails.tsx@@ -50,11 +50,11 @@ import type { JobStage, JobStageTypeRef } from "@/models/jobStage.model";const JOB_DETAIL_TABS = ["description",- "match","timeline",+ "match","letter",- "notes","contacts",+ "notes",] as const;type JobDetailsProps = {@@ -238,7 +238,6 @@ function JobDetails({<Tabs value={activeTab} onValueChange={handleTabChange}><TabsList><TabsTrigger value="description">Description</TabsTrigger>- <TabsTrigger value="match">AI Match</TabsTrigger><TabsTrigger value="timeline">Timeline{stages.length > 0 && (@@ -247,15 +246,8 @@ function JobDetails({</Badge>)}</TabsTrigger>+ <TabsTrigger value="match">AI Match</TabsTrigger><TabsTrigger value="letter">Cover Letter</TabsTrigger>- <TabsTrigger value="notes">- Notes- {notesCount > 0 && (- <Badge variant="secondary" className="ml-2">- {notesCount}- </Badge>- )}- </TabsTrigger><TabsTrigger value="contacts">Contacts{(job.contactLinks?.length ?? 0) > 0 && (@@ -264,6 +256,14 @@ function JobDetails({</Badge>)}</TabsTrigger>+ <TabsTrigger value="notes">+ Notes+ {notesCount > 0 && (+ <Badge variant="secondary" className="ml-2">+ {notesCount}+ </Badge>+ )}+ </TabsTrigger></TabsList><TabsContent value="description" className="mt-4"><Card className="p-6">diff --git a/src/components/myjobs/job-details/timeline/AddPrepQuestionsDialog.tsx b/src/components/myjobs/job-details/timeline/AddPrepQuestionsDialog.tsxindex 218a77c..71ae946 100644--- a/src/components/myjobs/job-details/timeline/AddPrepQuestionsDialog.tsx+++ b/src/components/myjobs/job-details/timeline/AddPrepQuestionsDialog.tsx@@ -1,6 +1,5 @@"use client";import { useEffect, useId, useRef, useState, useTransition } from "react";-import { useForm } from "react-hook-form";import { Search, X } from "lucide-react";import { Badge } from "@/components/ui/badge";import { Button } from "@/components/ui/button";@@ -12,9 +11,8 @@ import {DialogHeader,DialogTitle,} from "@/components/ui/dialog";-import { Form, FormField, FormItem } from "@/components/ui/form";import { Input } from "@/components/ui/input";-import { Combobox } from "@/components/ComboBox";+import { TagInput } from "@/components/myjobs/TagInput";import { toastActionResult } from "@/lib/toast";import { addStagePrepQuestions } from "@/actions/jobStage.actions";import { createQuestion, getQuestionsList } from "@/actions/question.actions";@@ -51,16 +49,11 @@ export function AddPrepQuestionsDialog({const [search, setSearch] = useState("");const [selected, setSelected] = useState<string[]>([]);const [newQuestion, setNewQuestion] = useState("");+ const [newTagIds, setNewTagIds] = useState<string[]>([]);const [isPending, startTransition] = useTransition();const loaded = useRef(false);const rowId = useId();- // The category picker is a creatable Combobox, so it needs a form field to- // hang off; nothing else in this dialog is form-driven.- const form = useForm<{ questionCategory: string }>({- defaultValues: { questionCategory: "" },- });-useEffect(() => {if (!open || loaded.current) return;loaded.current = true;@@ -79,8 +72,8 @@ export function AddPrepQuestionsDialog({setSearch("");setSelected([]);setNewQuestion("");- form.reset({ questionCategory: "" });- }, [open, stage, form]);+ setNewTagIds([]);+ }, [open, stage]);if (!stage) return null;@@ -99,11 +92,10 @@ export function AddPrepQuestionsDialog({const addQuestion = () =>startTransition(async () => {- const category = form.getValues("questionCategory");const res = await createQuestion({question: newQuestion.trim(),answer: UNANSWERED,- tagIds: category ? [category] : [],+ tagIds: newTagIds,});toastActionResult(res, {success: "Question has been added to your bank",@@ -112,7 +104,7 @@ export function AddPrepQuestionsDialog({setBank((prev) => [res.data, ...prev]);setSelected((prev) => [...prev, res.data.id]);setNewQuestion("");- form.reset({ questionCategory: "" });+ setNewTagIds([]);},});});@@ -143,9 +135,9 @@ export function AddPrepQuestionsDialog({return (<Dialog open={open} onOpenChange={onOpenChange}>- <DialogContent className="sm:max-w-[540px] max-h-[800px] overflow-hidden">+ <DialogContent className="sm:max-w-[760px] max-h-[800px] overflow-hidden"><DialogHeader>- <DialogTitle>Add to Prep List</DialogTitle>+ <DialogTitle>Add Questions to Prep List</DialogTitle><DialogDescription>{stageHeading(stage)}</DialogDescription></DialogHeader>@@ -201,31 +193,41 @@ export function AddPrepQuestionsDialog({return (<likey={q.id}- className={`flex items-center gap-2.5 px-3.5 py-2.5 ${+ className={`flex items-start gap-2.5 px-3.5 py-2.5 ${index > 0 ? "border-t" : ""}`}><inputid={`${rowId}-${q.id}`}type="checkbox"- className="h-4 w-4 shrink-0"+ className="mt-0.5 h-4 w-4 shrink-0"checked={isLinked || selected.includes(q.id)}disabled={isLinked}onChange={(e) => toggle(q.id, e.target.checked)}/>- <label- htmlFor={`${rowId}-${q.id}`}- className="flex-1 cursor-pointer text-[13px]"- >- {q.question}- </label>- {q.tags?.map((tag) => (- <Badge key={tag.id} variant="secondary" className="text-[11px]">- {tag.label}- </Badge>- ))}+ <div className="flex-1">+ <label+ htmlFor={`${rowId}-${q.id}`}+ className="block cursor-pointer text-[13px]"+ >+ {q.question}+ </label>+ {(q.tags?.length ?? 0) > 0 && (+ <div className="mt-1.5 flex flex-wrap gap-1.5">+ {q.tags?.map((tag) => (+ <Badge+ key={tag.id}+ variant="secondary"+ className="text-[11px]"+ >+ {tag.label}+ </Badge>+ ))}+ </div>+ )}+ </div>{isLinked && (- <span className="text-[11px] text-muted-foreground">+ <span className="shrink-0 text-[11px] text-muted-foreground">On prep list</span>)}@@ -242,23 +244,15 @@ export function AddPrepQuestionsDialog({value={newQuestion}onChange={(e) => setNewQuestion(e.target.value)}/>- <Form {...form}>- <FormField- control={form.control}- name="questionCategory"- render={({ field }) => (- <FormItem className="flex flex-col">- <Combobox- options={tags}- field={field}- creatable- fullWidth- label="category"- />- </FormItem>- )}+ <div className="space-y-1.5">+ <p className="text-[13px] font-medium">Skill Tags</p>+ <TagInput+ availableTags={tags}+ selectedTagIds={newTagIds}+ onChange={setNewTagIds}+ onTagCreated={(tag) => setTags((prev) => [...prev, tag])}/>- </Form>+ </div><Buttonsize="sm"variant="outline"diff --git a/src/components/myjobs/job-details/timeline/StagePrepList.tsx b/src/components/myjobs/job-details/timeline/StagePrepList.tsxindex 9346472..d3f617e 100644--- a/src/components/myjobs/job-details/timeline/StagePrepList.tsx+++ b/src/components/myjobs/job-details/timeline/StagePrepList.tsx@@ -1,9 +1,10 @@"use client";import { useState, useTransition } from "react";-import { Plus, X } from "lucide-react";+import { ChevronDown, Plus, X } from "lucide-react";import { cn } from "@/lib/utils";import { Badge } from "@/components/ui/badge";import { Button } from "@/components/ui/button";+import { TipTapContentViewer } from "@/components/TipTapContentViewer";import { toastActionResult } from "@/lib/toast";import {removeStagePrepQuestion,@@ -18,6 +19,13 @@ type StagePrepListProps = {onChanged: () => void;};+// An untouched answer is still QuestionForm's "TBD" default, which the Tiptap+// editor may have wrapped in markup by the time it is saved.+function hasAnswer(answer: string | null): boolean {+ const text = (answer ?? "").replace(/<[^>]*>/g, "").trim().toLowerCase();+ return text.length > 0 && text !== "tbd";+}+export function StagePrepList({stage,onAddPrepQuestions,@@ -27,8 +35,11 @@ export function StagePrepList({// Optimistic so the checkbox never lags the click; the reload below is what// makes it durable.const [pending, setPending] = useState<Record<string, boolean>>({});+ const [expanded, setExpanded] = useState<Record<string, boolean>>({});+ const [allExpanded, setAllExpanded] = useState(false);const rows = stage.prepQuestions ?? [];const { total } = askedTally(stage);+ const answerable = rows.filter((row) => hasAnswer(row.Question.answer));const toggle = (linkId: string, next: boolean) => {setPending((prev) => ({ ...prev, [linkId]: next }));@@ -51,21 +62,50 @@ export function StagePrepList({});};+ const setOpen = (linkId: string, next: boolean) =>+ setExpanded((prev) => ({ ...prev, [linkId]: next }));++ const toggleAll = () => {+ const next = !allExpanded;+ setAllExpanded(next);+ setExpanded(+ next ? Object.fromEntries(answerable.map((row) => [row.id, true])) : {},+ );+ };+return (<div><div className="flex flex-wrap items-center justify-between gap-2"><p className="text-xs text-muted-foreground">Check off a question once your interviewer actually asks it.</p>- <Button- variant="outline"- size="sm"- className="h-7 cursor-pointer gap-1"- onClick={onAddPrepQuestions}- >- <Plus className="h-3 w-3" />- Add to Prep List- </Button>+ <div className="flex items-center gap-2">+ {answerable.length > 0 && (+ <Button+ variant="ghost"+ size="sm"+ className="h-7 cursor-pointer gap-1 text-xs"+ onClick={toggleAll}+ >+ <ChevronDown+ className={cn(+ "h-3 w-3 transition-transform",+ allExpanded && "rotate-180",+ )}+ />+ {allExpanded ? "Collapse all" : "Expand all"}+ </Button>+ )}+ <Button+ variant="outline"+ size="sm"+ className="h-7 cursor-pointer gap-1"+ onClick={onAddPrepQuestions}+ >+ <Plus className="h-3 w-3" />+ Add Questions+ </Button>+ </div></div>{total === 0 ? (@@ -76,50 +116,104 @@ export function StagePrepList({<ul className="mt-2.5 overflow-hidden rounded-lg border">{rows.map((row, index) => {const isAsked = pending[row.id] ?? row.asked;+ const answered = hasAnswer(row.Question.answer);+ const isOpen = answered && (expanded[row.id] ?? false);+ const text = (+ <>+ <span+ className={cn(+ "block text-[13px]",+ !isAsked && "text-muted-foreground",+ )}+ >+ {row.Question.question}+ </span>+ <span className="mt-1.5 flex flex-wrap items-center gap-1.5">+ {row.Question.tags?.map((tag) => (+ <Badge+ key={tag.id}+ variant="secondary"+ className="text-[11px]"+ >+ {tag.label}+ </Badge>+ ))}+ {!answered && (+ <span className="text-[11px] italic text-muted-foreground">+ No answer yet+ </span>+ )}+ </span>+ </>+ );return (<likey={row.id}className={cn(- "flex items-center gap-2.5 px-3.5 py-2.5",+ "px-3.5 py-2.5",index > 0 && "border-t",isAsked && "bg-emerald-500/10",)}>- <label className="flex flex-1 cursor-pointer items-center gap-2.5">+ <div className="flex items-start gap-2.5"><inputtype="checkbox"- className="h-4 w-4 shrink-0 accent-emerald-600"+ className="mt-0.5 h-4 w-4 shrink-0 cursor-pointer accent-emerald-600"checked={isAsked}+ aria-label={`Mark ${row.Question.question} as asked`}onChange={(e) => toggle(row.id, e.target.checked)}/>- <span- className={cn(- "flex-1 text-[13px]",- !isAsked && "text-muted-foreground",- )}+ {/* The text expands the answer; only the checkbox marks asked. */}+ {answered ? (+ <button+ type="button"+ className="flex-1 cursor-pointer text-left"+ aria-expanded={isOpen}+ onClick={() => setOpen(row.id, !isOpen)}+ >+ {text}+ </button>+ ) : (+ <div className="flex-1">{text}</div>+ )}+ {isAsked && (+ <span className="shrink-0 text-[11px] font-bold text-emerald-700 dark:text-emerald-300">+ Asked+ </span>+ )}+ {answered && (+ <Button+ variant="ghost"+ size="icon"+ className="h-7 w-7 shrink-0 cursor-pointer"+ aria-expanded={isOpen}+ aria-label={`${isOpen ? "Hide" : "Show"} the answer to ${row.Question.question}`}+ onClick={() => setOpen(row.id, !isOpen)}+ >+ <ChevronDown+ className={cn(+ "h-3.5 w-3.5 transition-transform",+ isOpen && "rotate-180",+ )}+ />+ </Button>+ )}+ <Button+ variant="ghost"+ size="icon"+ className="h-7 w-7 shrink-0 cursor-pointer"+ aria-label={`Remove ${row.Question.question} from the prep list`}+ onClick={() => remove(row.id)}>- {row.Question.question}- </span>- </label>- {isAsked && (- <span className="text-[11px] font-bold text-emerald-700 dark:text-emerald-300">- Asked- </span>+ <X className="h-3.5 w-3.5" />+ </Button>+ </div>++ {isOpen && (+ <div className="prose prose-sm dark:prose-invert mt-2.5 ml-6.5 max-w-none border-t pt-2.5 text-[13px] text-muted-foreground">+ <TipTapContentViewer content={row.Question.answer!} />+ </div>)}- {row.Question.tags?.map((tag) => (- <Badge key={tag.id} variant="secondary" className="text-[11px]">- {tag.label}- </Badge>- ))}- <Button- variant="ghost"- size="icon"- className="h-7 w-7 cursor-pointer"- aria-label={`Remove ${row.Question.question} from the prep list`}- onClick={() => remove(row.id)}- >- <X className="h-3.5 w-3.5" />- </Button></li>);})}diff --git a/src/models/jobStage.model.ts b/src/models/jobStage.model.tsindex 78019d2..b9b3b02 100644--- a/src/models/jobStage.model.ts+++ b/src/models/jobStage.model.ts@@ -26,7 +26,7 @@ export interface JobStagePrepQuestionLink {questionId: string;asked: boolean;askedAt: Date | null;- Question: { id: string; question: string; tags: Tag[] };+ Question: { id: string; question: string; answer: string | null; tags: Tag[] };}export interface JobStage {diff --git a/wiki/jobs.md b/wiki/jobs.mdindex 580f5e2..8b9b2c2 100644--- a/wiki/jobs.md+++ b/wiki/jobs.md@@ -43,7 +43,7 @@ All three of those paths also append a stage to the job's [timeline](./timeline.Three parts, top to bottom. A **header row** with the job title, a `Company · Location · Job Type · Workplace` line whose company name opens the company's [details page](./companies.md), and the actions: **Update Status**, AI Match, Cover Letter, Edit, Delete and a **⋮** menu. Below it a **summary card** of eight facts — Status, Job Type, Salary Range, Source, Applied, AI Match, Resume and Added — with the job URL and any skill badges on a divider row underneath. Below that, six **tabs**.-The tabs are **Description**, **AI Match**, **[Timeline](./timeline.md)**, **Cover Letter**, **Notes** and **[Contacts](./contacts.md)**, and all six are always there. AI Match and Cover Letter stay in the bar even when the job has neither, showing a short explanation and a button to run it — so the tab set never shifts between jobs. Timeline, Notes and Contacts each carry a count badge once the job has any. Contacts lists the people linked to this job with the role each played. The tab you are on is kept in the address bar, so a refresh, a bookmark or the browser Back button lands you back on the same one.+The tabs are **Description**, **[Timeline](./timeline.md)**, **AI Match**, **Cover Letter**, **[Contacts](./contacts.md)** and **Notes**, and all six are always there. AI Match and Cover Letter stay in the bar even when the job has neither, showing a short explanation and a button to run it — so the tab set never shifts between jobs. Timeline, Notes and Contacts each carry a count badge once the job has any. Contacts lists the people linked to this job with the role each played. The tab you are on is kept in the address bar, so a refresh, a bookmark or the browser Back button lands you back on the same one.## How do I edit, annotate or delete a job?diff --git a/wiki/timeline.md b/wiki/timeline.mdindex 40220ee..e4cd884 100644--- a/wiki/timeline.md+++ b/wiki/timeline.md@@ -65,9 +65,11 @@ The same person can be linked to several stages of the same job, and a contact y## How do I build a prep list for an interview?-Select the interview stage and use **Add to Prep List**, either the button on its **Prep List** tab or the item in the **Update Status** menu. The dialog lists your question bank with an instant search over it; tick as many questions as you like and add them in one go.+Select the interview stage and use **Add Questions**, either the button on its **Prep List** tab or **Add to Prep List** in the **Update Status** menu. The dialog lists your question bank with an instant search over it; tick as many questions as you like and add them in one go.-To add a question that is not in the bank yet, type it into the box at the bottom, optionally pick a **category**, and add it. It is saved to your question bank as well as to this stage's prep list, so every later job can reach it — the bank is shared, not per-job. A question added this way is banked with the placeholder answer `TBD`; fill in the real answer from the Questions page when you are ready.+To add a question that is not in the bank yet, type it into the box at the bottom, optionally pick any number of **skill tags**, and add it. It is saved to your question bank as well as to this stage's prep list, so every later job can reach it — the bank is shared, not per-job. A question added this way is banked with the placeholder answer `TBD`; fill in the real answer from the Questions page when you are ready.++A question whose answer is filled in shows a chevron; click the question or the chevron to read the answer without leaving the tab, or use **Expand all** to open every answered question at once. A question still holding the `TBD` placeholder reads **No answer yet** instead.A question can be on the prep lists of several stages at once, and **✕** beside one removes it from this stage's list without touching the bank.