Jelajahi Sumber

Sprint view Arbeitstage: 5-dot weekday indicator instead of a number

The per-week Arbeitstage cell on /sprints/{id} now shows five small
circles (Mo → Fr, left to right) — filled green if the day is active
for that week, slate-gray otherwise. Labels are intentionally dropped
from the cell; the tooltip on the container still lists the active day
names ("Mo Di Mi Do" or "—") so the information is reachable for
keyboard / screen-reader users without cluttering the row.

Rationale: a bare number ("4") makes which-day-is-off invisible at a
glance, and in a sprint-planning meeting the visual cue (e.g. "Friday
dark") communicates the exception faster than reading the integer and
hovering for the tooltip.

Only views/sprints/show.php changes — data model, capacity math, and
the settings editor are all untouched. The Σ column still shows the
numeric total across weeks.

phpunit: 88/88.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
achiappa 2 minggu lalu
induk
melakukan
1aca417e5e
1 mengubah file dengan 10 tambahan dan 5 penghapusan
  1. 10 5
      views/sprints/show.php

+ 10 - 5
views/sprints/show.php

@@ -9,6 +9,7 @@
 /** @var list<\App\Domain\Task>        $tasks */
 /** @var array<int, array<int, float>> $taskGrid    task_id => sw_id => days */
 /** @var list<\App\Domain\Worker>      $ownerChoices */
+use App\Domain\SprintWeek;
 use function App\Http\e;
 $tasks        = $tasks        ?? [];
 $taskGrid     = $taskGrid     ?? [];
@@ -96,11 +97,15 @@ if (!function_exists('fmt_days')) {
                             <?php endif; ?>
                         </th>
                         <?php $sumMax = 0.0; foreach ($weeks as $w): $sumMax += $w->maxWorkingDays; ?>
-                            <td class="px-1 py-1 text-center">
-                                <span class="font-mono" data-week-arbeitstage data-week-id="<?= (int) $w->id ?>"
-                                      title="<?= e(implode(' ', $w->activeDays())) ?: '—' ?>">
-                                    <?= e(fmt_days($w->maxWorkingDays)) ?>
-                                </span>
+                            <td class="px-1 py-1">
+                                <div class="flex items-center justify-center gap-1"
+                                     data-week-arbeitstage data-week-id="<?= (int) $w->id ?>"
+                                     title="<?= e(implode(' ', $w->activeDays())) ?: '—' ?>">
+                                    <?php foreach (SprintWeek::DAY_LABELS as $bit => $_label): ?>
+                                        <span class="inline-block h-2.5 w-2.5 rounded-full
+                                            <?= $w->hasDay($_label) ? 'bg-green-500' : 'bg-slate-300' ?>"></span>
+                                    <?php endforeach; ?>
+                                </div>
                             </td>
                         <?php endforeach; ?>
                         <td class="px-2 py-1 text-center font-mono font-semibold" data-sum-max>