feat(pop-work-detail): 작업완료 후 다음 그룹 자동 이동 + 사이드바 숫자 구조 변경

- GroupCompleteButton onComplete: 그룹 완료 처리 후 다음 그룹(같은 phase 또는 다음 phase)으로 자동 이동
- 사이드바 phase 라벨 옆 숫자: 완료/전체 체크리스트 수 → 그룹 개수 (n) 형태로 변경
- 사이드바 각 그룹 항목 옆에 해당 그룹의 체크리스트 완료/전체 수 표시 (g.completed/g.total)
This commit is contained in:
SeongHyun Kim
2026-03-26 17:39:42 +09:00
parent a29691c31e
commit f471ce245a

View File

@@ -961,7 +961,7 @@ export function PopWorkDetailComponent({
)}
style={{ fontSize: 13 }}
>
{progress?.done ?? 0}/{progress?.total ?? 0}
({phaseGrps.length})
</span>
</div>
@@ -988,7 +988,7 @@ export function PopWorkDetailComponent({
<SidebarStepIcon status={g.stepStatus} isSelected={isSelected} />
<span
className={cn(
"truncate",
"truncate flex-1",
g.stepStatus === "completed" ? "text-gray-500" :
isSelected ? "font-medium text-blue-700" :
g.stepStatus === "active" ? "text-gray-700" : "text-gray-400"
@@ -997,6 +997,19 @@ export function PopWorkDetailComponent({
>
{g.title}
</span>
{g.total > 0 && (
<span
className={cn(
"ml-1 shrink-0 font-medium",
g.stepStatus === "completed" ? "text-green-500" :
isSelected ? "text-blue-500" :
g.stepStatus === "active" ? "text-gray-500" : "text-gray-300"
)}
style={{ fontSize: 11 }}
>
{g.completed}/{g.total}
</span>
)}
</button>
);
})}
@@ -1246,7 +1259,17 @@ export function PopWorkDetailComponent({
group={selectedGroup}
currentItems={currentItems}
isGroupStarted={isGroupStarted}
onComplete={() => handleGroupTimerAction("complete")}
onComplete={async () => {
await handleGroupTimerAction("complete");
// 완료 후 다음 그룹으로 자동 이동
const idx = groups.findIndex((g) => g.itemId === selectedGroupId);
if (idx >= 0 && idx < groups.length - 1) {
const nextGroup = groups[idx + 1];
setSelectedGroupId(nextGroup.itemId);
setActivePhaseTab(nextGroup.phase);
contentRef.current?.scrollTo({ top: 0, behavior: "smooth" });
}
}}
onNavigateNext={() => {
// 필수 미완료 시 넘어가지 않음
const requiredItems = currentItems.filter((r) => r.is_required === "Y");