From 94e9dffaefc582196dfebc74b53028f7307cf202 Mon Sep 17 00:00:00 2001 From: kovakmedya Date: Fri, 22 May 2026 16:05:07 +0300 Subject: [PATCH] feat(jobs): step-by-step timeline on the detail page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The job_status_history table was already being populated on every transition; the detail page just rendered a flat list with date only. Replaced it with a proper vertical timeline: - Card title moved from 'Aşama Geçmişi' to 'Akış Geçmişi' since we now include side-trips (revision requests), not just forward steps. - Vertical guide line with a coloured node per entry: emerald for a normal step completion, rose for a revision request. Spotting a bounced prova in the history is a glance. - Revision rows get an inline 'Düzeltme talebi' pill; the '[Düzeltme talebi]' prefix is stripped from the visible note so the actual feedback text reads cleanly. - Always rendered (with an empty-state line) so the card position doesn't move around as the case progresses. --- src/app/(dashboard)/jobs/[jobId]/page.tsx | 74 +++++++++++++++-------- 1 file changed, 48 insertions(+), 26 deletions(-) diff --git a/src/app/(dashboard)/jobs/[jobId]/page.tsx b/src/app/(dashboard)/jobs/[jobId]/page.tsx index 252301e..01893fa 100644 --- a/src/app/(dashboard)/jobs/[jobId]/page.tsx +++ b/src/app/(dashboard)/jobs/[jobId]/page.tsx @@ -259,33 +259,55 @@ export default async function JobDetailPage({ - {history.length > 0 && ( - - - Aşama Geçmişi - Tamamlanan aşamaların kaydı. - - -
    - {history.map((h) => ( -
  1. -
    - {JOB_STEP_LABELS[h.step]} - - {dateFormatter.format(new Date(h.completedAt))} - -
    - {h.note && ( -

    - {h.note} -

    - )} -
  2. - ))} + + + Akış Geçmişi + + İşin aşama transition'ları, kim yaptı ve hangi notla. + + + + {history.length === 0 ? ( +

    + Henüz aşama tamamlanmadı. +

    + ) : ( +
      + {history.map((h) => { + const isRevision = h.note?.startsWith("[Düzeltme talebi]"); + return ( +
    1. + +
      + + {JOB_STEP_LABELS[h.step]} + + {isRevision && ( + + Düzeltme talebi + + )} + + {dateFormatter.format(new Date(h.completedAt))} + +
      + {h.note && ( +

      + {h.note.replace(/^\[Düzeltme talebi\]\s*/, "")} +

      + )} +
    2. + ); + })}
    -
    -
    - )} + )} + +