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: add resizable panel functionality and improve UI components

Khuram Niazbf314ea33c13
diff --git a/src/components/ComboBox.tsx b/src/components/ComboBox.tsx
index a4efccd..723cffc 100644
--- a/src/components/ComboBox.tsx
+++ b/src/components/ComboBox.tsx
@@ -113,7 +113,7 @@ export function Combobox({ options, field, creatable }: ComboboxProps) {
</Button>
</FormControl>
</PopoverTrigger>
- <PopoverContent className="md:w-[240px] lg:w-[280px] p-0">
+ <PopoverContent className="md:w-[240px] lg:w-[280px] p-0 max-h-[var(--radix-popover-content-available-height)] overflow-hidden">
<Command
filter={(value, search) =>
value.toLowerCase().includes(search.toLowerCase()) ? 1 : 0
@@ -146,9 +146,9 @@ export function Combobox({ options, field, creatable }: ComboboxProps) {
<p className="font-semibold text-primary">No source found!</p>
)}
</CommandEmpty>
- <ScrollArea>
+ <ScrollArea className="max-h-[calc(var(--radix-popover-content-available-height)-2.75rem)]">
<CommandGroup>
- <CommandList className="capitalize">
+ <CommandList className="capitalize max-h-none overflow-visible">
{options.map((option) => (
<CommandItem
value={option.value}
diff --git a/src/components/profile/AiJobMatchSection.tsx b/src/components/profile/AiJobMatchSection.tsx
index 1b14512..d8580a3 100644
--- a/src/components/profile/AiJobMatchSection.tsx
+++ b/src/components/profile/AiJobMatchSection.tsx
@@ -11,6 +11,7 @@ import {
} from "../ui/sheet";
import { useCallback, useEffect, useRef, useState } from "react";
import { useSheetAutoScroll } from "@/hooks/useSheetAutoScroll";
+import { useResizablePanel } from "@/hooks/useResizablePanel";
import { Resume } from "@/models/profile.model";
import { toast } from "../ui/use-toast";
import {
@@ -58,6 +59,7 @@ export const AiJobMatchSection = ({
const resumesRef = useRef<Resume[]>([]);
const abortRef = useRef<AbortController | null>(null);
const { scrollAnchorRef, handleSheetScroll, resetScroll } = useSheetAutoScroll(isLoading, result);
+ const { width, handleMouseDown } = useResizablePanel("ai-panel-width");
useEffect(() => {
const fetchSettings = async () => {
@@ -241,7 +243,17 @@ export const AiJobMatchSection = ({
return (
<Sheet open={aISectionOpen} onOpenChange={onOpenChange}>
<SheetPortal>
- <SheetContent className="flex flex-col p-0 overflow-hidden [&>button:last-child]:hidden">
+ <SheetContent
+ className="flex flex-col p-0 overflow-hidden [&>button:last-child]:hidden"
+ style={{ width: `${width}px`, maxWidth: "none" }}
+ >
+ {/* VS Code-style drag handle on left edge */}
+ <div
+ className="absolute left-0 top-0 h-full w-1 cursor-col-resize z-10 group"
+ onMouseDown={handleMouseDown}
+ >
+ <div className="h-full w-px bg-transparent group-hover:bg-primary/50 transition-colors" />
+ </div>
{/* Terminal-style tab bar — always visible */}
<div className="flex items-center gap-3 px-4 py-2.5 border-b bg-muted/20 shrink-0">
<SheetTitle className="text-[11px] font-bold tracking-[0.15em] uppercase text-foreground leading-none shrink-0 m-0">
@@ -270,7 +282,7 @@ export const AiJobMatchSection = ({
{/* Scrollable content */}
<div className="flex-1 overflow-y-auto px-6 pt-4 pb-6" onScroll={handleSheetScroll}>
{!isLoading && !selectedResumeId && (
- <div className={`flex flex-col items-center justify-center gap-2${!hasContent ? " min-h-[calc(100dvh-9rem)]" : " py-2"}`}>
+ <div className={`flex flex-col items-center gap-2${!hasContent ? " pt-12" : " py-2"}`}>
<Select
value={selectedResumeId}
onValueChange={onSelectResume}
diff --git a/src/components/profile/AiResumeReviewSection.tsx b/src/components/profile/AiResumeReviewSection.tsx
index 5f6fb31..7902b73 100644
--- a/src/components/profile/AiResumeReviewSection.tsx
+++ b/src/components/profile/AiResumeReviewSection.tsx
@@ -13,6 +13,7 @@ import {
import Loading from "../Loading";
import { useState, useEffect, useCallback, useRef } from "react";
import { useSheetAutoScroll } from "@/hooks/useSheetAutoScroll";
+import { useResizablePanel } from "@/hooks/useResizablePanel";
import { toast } from "../ui/use-toast";
import { Resume } from "@/models/profile.model";
import { AiModel, AiProvider, defaultModel } from "@/models/ai.model";
@@ -79,6 +80,7 @@ const AiResumeReviewSection = ({ resume }: AiSectionProps) => {
const [isLoading, setIsLoading] = useState(false);
const abortRef = useRef<AbortController | null>(null);
const { scrollAnchorRef, handleSheetScroll, resetScroll } = useSheetAutoScroll(isLoading, result);
+ const { width, handleMouseDown } = useResizablePanel("ai-panel-width");
const stop = useCallback(() => {
abortRef.current?.abort();
@@ -174,7 +176,17 @@ const AiResumeReviewSection = ({ resume }: AiSectionProps) => {
</SheetTrigger>
</div>
<SheetPortal>
- <SheetContent className="flex flex-col p-0 overflow-hidden [&>button:last-child]:hidden">
+ <SheetContent
+ className="flex flex-col p-0 overflow-hidden [&>button:last-child]:hidden"
+ style={{ width: `${width}px`, maxWidth: "none" }}
+ >
+ {/* VS Code-style drag handle on left edge */}
+ <div
+ className="absolute left-0 top-0 h-full w-1 cursor-col-resize z-10 group"
+ onMouseDown={handleMouseDown}
+ >
+ <div className="h-full w-px bg-transparent group-hover:bg-primary/50 transition-colors" />
+ </div>
{/* Terminal-style tab bar — always visible */}
<div className="flex items-center gap-3 px-4 py-2.5 border-b bg-muted/20 shrink-0">
<SheetTitle className="text-[11px] font-bold tracking-[0.15em] uppercase text-foreground leading-none shrink-0 m-0">
diff --git a/src/components/ui/select.tsx b/src/components/ui/select.tsx
index cbe5a36..4addc72 100644
--- a/src/components/ui/select.tsx
+++ b/src/components/ui/select.tsx
@@ -75,7 +75,7 @@ const SelectContent = React.forwardRef<
<SelectPrimitive.Content
ref={ref}
className={cn(
- "relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
+ "relative z-50 max-h-[var(--radix-select-content-available-height)] min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
position === "popper" &&
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
className
@@ -88,7 +88,7 @@ const SelectContent = React.forwardRef<
className={cn(
"p-1",
position === "popper" &&
- "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
+ "w-full min-w-[var(--radix-select-trigger-width)]"
)}
>
{children}
diff --git a/src/hooks/useResizablePanel.ts b/src/hooks/useResizablePanel.ts
new file mode 100644
index 0000000..f275202
--- /dev/null
+++ b/src/hooks/useResizablePanel.ts
@@ -0,0 +1,57 @@
+import { useState, useEffect, useRef, useCallback } from "react";
+import { getFromLocalStorage, saveToLocalStorage } from "@/utils/localstorage.utils";
+
+const DEFAULT_WIDTH = 450;
+const MIN_WIDTH = 320;
+const MAX_WIDTH_RATIO = 0.9;
+
+export function useResizablePanel(storageKey: string) {
+ const [width, setWidth] = useState<number>(() =>
+ getFromLocalStorage(storageKey, DEFAULT_WIDTH)
+ );
+ const isDragging = useRef(false);
+ const startX = useRef(0);
+ const startWidth = useRef(0);
+ const widthRef = useRef(width);
+
+ useEffect(() => {
+ widthRef.current = width;
+ }, [width]);
+
+ const handleMouseDown = useCallback((e: React.MouseEvent) => {
+ isDragging.current = true;
+ startX.current = e.clientX;
+ startWidth.current = widthRef.current;
+ document.body.style.userSelect = "none";
+ document.body.style.cursor = "col-resize";
+ e.preventDefault();
+ }, []);
+
+ useEffect(() => {
+ const onMouseMove = (e: MouseEvent) => {
+ if (!isDragging.current) return;
+ const maxWidth = window.innerWidth * MAX_WIDTH_RATIO;
+ const delta = startX.current - e.clientX;
+ const newWidth = Math.min(Math.max(startWidth.current + delta, MIN_WIDTH), maxWidth);
+ widthRef.current = newWidth;
+ setWidth(newWidth);
+ };
+
+ const onMouseUp = () => {
+ if (!isDragging.current) return;
+ isDragging.current = false;
+ document.body.style.userSelect = "";
+ document.body.style.cursor = "";
+ saveToLocalStorage(storageKey, widthRef.current);
+ };
+
+ document.addEventListener("mousemove", onMouseMove);
+ document.addEventListener("mouseup", onMouseUp);
+ return () => {
+ document.removeEventListener("mousemove", onMouseMove);
+ document.removeEventListener("mouseup", onMouseUp);
+ };
+ }, [storageKey]);
+
+ return { width, handleMouseDown };
+}