Add a raw-data viewer to Review Queue cards, improve chart color palette
A "Raw data" button at the bottom right of each card opens a modal with the full activity/laps/assignment JSON (embedded RawJSON strings parsed back into objects for readability), to make it easier to inspect exactly what data is available when iterating on the charts. Phase band colors (warm-up/effort/recovery/cool-down) previously reused the same blue/red as the pace/HR accent colors, making them hard to tell apart. New palette (amber/pink/teal/violet) avoids both accents entirely.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { useEffect, useMemo, useState } from "react";
|
||||
import { api } from "../api/client";
|
||||
import { ExpectedVsActualChart } from "../components/charts/ExpectedVsActualChart";
|
||||
import { RawDataModal } from "../components/RawDataModal";
|
||||
import type { ReviewQueueItem, ScoredKind, WorkoutKind } from "../types/api";
|
||||
|
||||
const UNSORTED = "__unsorted__";
|
||||
@@ -27,6 +28,7 @@ export function ReviewQueue() {
|
||||
const [filterKindId, setFilterKindId] = useState<string>("");
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
const [resolvingId, setResolvingId] = useState<number | null>(null);
|
||||
const [rawDataItem, setRawDataItem] = useState<ReviewQueueItem | null>(null);
|
||||
|
||||
function reload() {
|
||||
Promise.all([api.reviewQueue(), api.listWorkoutKinds()])
|
||||
@@ -143,11 +145,19 @@ export function ReviewQueue() {
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div className="review-item-footer">
|
||||
<button type="button" className="raw-data-button" onClick={() => setRawDataItem(item)}>
|
||||
Raw data
|
||||
</button>
|
||||
</div>
|
||||
</li>
|
||||
);
|
||||
})}
|
||||
</ul>
|
||||
)}
|
||||
|
||||
{rawDataItem && <RawDataModal data={rawDataItem} onClose={() => setRawDataItem(null)} />}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user