Improve task views mobile responsiveness

This commit updates the task dashboard and assignment views for smaller screens by tightening spacing, improving text wrapping, and making filter/search controls responsive. It also refreshes the assignment detail layout with clearer date spans, team summaries, and switchable grid/list member views, while polishing client and assignment cards for better readability on mobile.
This commit is contained in:
Ichsan Kurniawan
2026-10-06 11:24:30 +07:00
parent d0db9ee429
commit 93a9b489d0
11 changed files with 449 additions and 180 deletions
@@ -74,13 +74,13 @@ export default function AssignmentList({
className="w-full"
key={index}
>
<Card900 className="group overflow-hidden hover:shadow-md transition-all duration-300 border-border/80 hover:border-his/40 rounded-2xl py-1 bg-card">
<CardContent className="p-4 sm:p-5 flex flex-col md:flex-row items-start md:items-center justify-between gap-4">
<Card900 className="group overflow-hidden hover:shadow-md transition-all duration-300 border-border/80 hover:border-his/40 rounded-2xl py-1 bg-card min-w-0">
<CardContent className="p-3.5 sm:p-5 flex flex-col md:flex-row items-start md:items-center justify-between gap-4 min-w-0">
{/* Left: Thumbnail & Visual Indicator */}
<div className="flex items-start gap-4 min-w-0 flex-1">
<div className="flex items-start gap-3 sm:gap-4 min-w-0 flex-1 w-full">
<Link
href={assignmentDetailUrl}
className="relative w-16 h-16 sm:w-20 sm:h-20 shrink-0 rounded-2xl overflow-hidden bg-muted/20 dark:bg-zinc-800/40 border border-border/60 flex items-center justify-center p-1 shadow-2xs group-hover:border-his/40 group-hover:scale-105 transition-all duration-300"
className="relative w-12 h-12 sm:w-16 sm:h-16 md:w-20 md:h-20 shrink-0 rounded-2xl overflow-hidden bg-muted/20 dark:bg-zinc-800/40 border border-border/60 flex items-center justify-center p-1 shadow-2xs group-hover:border-his/40 group-hover:scale-105 transition-all duration-300"
>
<LazyImage
src={illustrationSrc}
@@ -93,10 +93,10 @@ export default function AssignmentList({
{/* Center Details */}
<div className="min-w-0 flex-1 space-y-1.5">
{/* Line 1: Type Badge, Status, Code, and Project Reference */}
<div className="flex flex-wrap items-center gap-2">
<div className="flex flex-wrap items-center gap-1.5">
<Badge
variant="outline"
className={`text-[10px] font-semibold px-2 py-0.5 gap-1 ${isProject
className={`text-[10px] font-semibold px-2 py-0.5 gap-1 shrink-0 ${isProject
? 'bg-amber-500/15 text-amber-700 dark:text-amber-400 border-amber-500/30'
: 'bg-purple-500/15 text-purple-700 dark:text-purple-400 border-purple-500/30'
}`}
@@ -112,65 +112,63 @@ export default function AssignmentList({
# {assignmentCode}
</span>
) : null}
</div>
{/* Line 2: Assignment Title */}
<div>
<div className="min-w-0">
<Link
href={assignmentDetailUrl}
className="font-semibold text-base sm:text-lg leading-snug text-foreground hover:text-his transition-colors block tracking-tight line-clamp-1 py-0.5"
className="font-semibold text-base sm:text-lg leading-snug text-foreground hover:text-his transition-colors block tracking-tight line-clamp-2 sm:line-clamp-1 py-0.5 wrap-break-word"
>
{assignmentName}
</Link>
{assignment.project?.name && (
<div className="flex items-center gap-1 text-xs text-muted-foreground ml-auto sm:ml-0 mt-2">
<div className="flex items-center gap-1 text-xs text-muted-foreground mt-1 min-w-0">
<FolderGit2 className="w-3.5 h-3.5 text-his shrink-0" />
<span className="text-[11px] text-muted-foreground hidden sm:inline">Project:</span>
<span className="text-[11px] text-muted-foreground hidden sm:inline shrink-0">Project:</span>
{projectDetailUrl ? (
<Link
href={projectDetailUrl}
className="font-medium text-foreground hover:text-his truncate hover:underline inline-block"
className="font-medium text-foreground hover:text-his truncate hover:underline inline-block min-w-0"
>
{assignment.project.name}
</Link>
) : (
<span className="font-medium text-foreground truncate">{assignment.project.name}</span>
<span className="font-medium text-foreground truncate min-w-0">{assignment.project.name}</span>
)}
</div>
)}
</div>
{/* Line 3: Metadata, Client, End User, Timeline, Notes */}
<div className="flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-muted-foreground pt-0.5">
<div className="flex flex-wrap items-center gap-x-3 gap-y-1.5 text-xs text-muted-foreground pt-0.5 min-w-0">
{assignment.client?.name && !clientId && (
<Link
href={`/task/client-detail/${assignment.client.id}`}
className="flex items-center gap-1 text-[11px] font-medium text-foreground hover:text-his transition-colors"
className="flex items-center gap-1 text-[11px] font-medium text-foreground hover:text-his transition-colors min-w-0"
>
<BuildingComplex className="w-3 h-3 text-muted-foreground" />
<span className="text-muted-foreground">Client:</span>
<span className="truncate max-w-50">{assignment.client.name}</span>
<BuildingComplex className="w-3 h-3 text-muted-foreground shrink-0" />
<span className="text-muted-foreground shrink-0">Client:</span>
<span className="truncate max-w-32.5 sm:max-w-50">{assignment.client.name}</span>
</Link>
)}
{assignment.end_user?.name && (
<div className="flex items-center gap-1 text-[11px] text-foreground">
<span className="text-muted-foreground">End User:</span>
<span className="font-medium truncate max-w-50">{assignment.end_user.name}</span>
<div className="flex items-center gap-1 text-[11px] text-foreground min-w-0">
<span className="text-muted-foreground shrink-0">End User:</span>
<span className="font-medium truncate max-w-32.5 sm:max-w-50">{assignment.end_user.name}</span>
</div>
)}
<div className="flex items-center gap-1 text-[11px] text-muted-foreground">
<Calendar className="w-3.5 h-3.5 text-muted-foreground/80" />
<div className="flex items-center gap-1 text-[11px] text-muted-foreground shrink-0">
<Calendar className="w-3.5 h-3.5 text-muted-foreground/80 shrink-0" />
<span>
{formatAssignmentDate(assignmentStartDate)} - {formatAssignmentDate(assignmentEndDate)}
</span>
</div>
{assignment.note && (
<span className="text-[11px] italic text-muted-foreground/80 line-clamp-1 max-w-50">
<span className="text-[11px] italic text-muted-foreground/80 line-clamp-1 max-w-35 sm:max-w-xs wrap-break-word">
Note: {assignment.note}
</span>
)}