This commit is contained in:
null 2026-05-26 17:08:59 -05:00
parent b92726df66
commit 8af11125cc
2 changed files with 9 additions and 2 deletions

View File

@ -1482,6 +1482,7 @@ export default function DashboardPage() {
hasLineStats={forgejoHeatmapQuery.data?.has_line_stats ?? false} hasLineStats={forgejoHeatmapQuery.data?.has_line_stats ?? false}
lastPush={forgejoLastPushQuery.data ?? null} lastPush={forgejoLastPushQuery.data ?? null}
isLoading={forgejoHeatmapQuery.isLoading} isLoading={forgejoHeatmapQuery.isLoading}
selectedRepositoryName={selectedForgejoRepository?.display_name ?? null}
/> />
</div> </div>

View File

@ -18,6 +18,7 @@ interface ForgejoHeatmapProps {
hasLineStats?: boolean; hasLineStats?: boolean;
lastPush?: ForgejoLastPush | null; lastPush?: ForgejoLastPush | null;
isLoading?: boolean; isLoading?: boolean;
selectedRepositoryName?: string | null;
} }
// ── Line chart layout ────────────────────────────────────────────────────── // ── Line chart layout ──────────────────────────────────────────────────────
@ -496,10 +497,12 @@ function HeatmapGrid({
days, days,
range, range,
onRangeChange, onRangeChange,
repositoryName,
}: { }: {
days: ForgejoHeatmapDay[]; days: ForgejoHeatmapDay[];
range: RangeKey; range: RangeKey;
onRangeChange: (r: RangeKey) => void; onRangeChange: (r: RangeKey) => void;
repositoryName?: string | null;
}) { }) {
const [hoveredDay, setHoveredDay] = useState<ActivityDatum | null>(null); const [hoveredDay, setHoveredDay] = useState<ActivityDatum | null>(null);
const heatmap = useMemo(() => { const heatmap = useMemo(() => {
@ -807,8 +810,9 @@ function HeatmapGrid({
{heatmap.totalEvents.toLocaleString()} {heatmap.totalEvents.toLocaleString()}
</span> </span>
<span className="ml-1.5 text-sm" style={{ color: W70 }}> <span className="ml-1.5 text-sm" style={{ color: W70 }}>
commits across all tracked repositories in the last{" "} {repositoryName
{RANGE_SUMMARY[range]} ? `commits across the ${repositoryName} repository in the last ${RANGE_SUMMARY[range]}`
: `commits across all tracked repositories in the last ${RANGE_SUMMARY[range]}`}
</span> </span>
</p> </p>
</div> </div>
@ -823,6 +827,7 @@ export function ForgejoHeatmap({
hasLineStats = false, hasLineStats = false,
lastPush = null, lastPush = null,
isLoading = false, isLoading = false,
selectedRepositoryName = null,
}: ForgejoHeatmapProps) { }: ForgejoHeatmapProps) {
const [lineRange, setLineRange] = useState<RangeKey>("14d"); const [lineRange, setLineRange] = useState<RangeKey>("14d");
const [heatRange, setHeatRange] = useState<RangeKey>("14d"); const [heatRange, setHeatRange] = useState<RangeKey>("14d");
@ -872,6 +877,7 @@ export function ForgejoHeatmap({
days={days} days={days}
range={heatRange} range={heatRange}
onRangeChange={setHeatRange} onRangeChange={setHeatRange}
repositoryName={selectedRepositoryName}
/> />
</section> </section>
</div> </div>