showing previous version schedule as faded

This commit is contained in:
2026-07-20 14:16:56 -04:00
parent a49772aece
commit 5eebee70d8
8 changed files with 293 additions and 91 deletions
+2
View File
@@ -57,6 +57,7 @@ export default function Calendar({
dualDeviceWeekendWeekEnabled = false,
onDualDeviceWeekendWeekEnabledChange,
windowLookup = new Map(),
snapshotShiftKeys = new Set(),
onWindowSelect,
}) {
const DEFAULT_SHIFT_MIN_ROWS = 3
@@ -226,6 +227,7 @@ export default function Calendar({
slotHeights={slotHeights}
showShift2={isWeekend || (daytimeDateKey !== null && key === daytimeDateKey)}
windowLookup={windowLookup}
snapshotShiftKeys={snapshotShiftKeys}
onWindowSelect={onWindowSelect}
/>
)
+7
View File
@@ -13,6 +13,7 @@ export default function DayColumn({
shiftMinRows = { shift2: 1, shift3: 1, nextDayShift1: 1 },
slotHeights = { shift2: 0, shift3: 0, nextDayShift1: 0 },
windowLookup = new Map(),
snapshotShiftKeys = new Set(),
onWindowSelect,
}) {
const dayName = DAY_NAMES[date.getDay()]
@@ -20,11 +21,17 @@ export default function DayColumn({
const dateKey = date.toISOString().slice(0, 10)
const nextDateKey = new Date(date.getTime() + (24 * 60 * 60 * 1000)).toISOString().slice(0, 10)
function isSnapshotShift(snapshotDateKey, shiftIndex) {
return snapshotShiftKeys.has(`${snapshotDateKey}::shift${shiftIndex}`)
}
function getWindowForShift(shiftIndex) {
if (isSnapshotShift(dateKey, shiftIndex)) return null
return windowLookup.get(`${dateKey}::shift${shiftIndex}`) ?? null
}
function getNextDayShift1Window() {
if (isSnapshotShift(nextDateKey, 1)) return null
return windowLookup.get(`${nextDateKey}::shift1`) ?? null
}
+2 -1
View File
@@ -50,6 +50,7 @@ export default function TestCard({ test }) {
const normalizedStatus = String(test?.status ?? 'pending').trim().toLowerCase()
const style = STATUS_STYLES[normalizedStatus] ?? STATUS_STYLES.pending
const deviceAccentClass = getDeviceAccentClass(test.device)
const isPreviousVersionSnapshot = Boolean(test?.isPreviousVersionSnapshot)
const cardRef = useRef(null)
const [tooltipPos, setTooltipPos] = useState({ top: '0px', left: '0px' })
const [isHovered, setIsHovered] = useState(false)
@@ -92,7 +93,7 @@ export default function TestCard({ test }) {
<div ref={cardRef} className="relative">
<div
className={`relative px-1.5 py-0.5 pl-3 rounded border text-xs font-mono truncate cursor-default select-none ${style}`}
style={{ maxWidth: '100%' }}
style={{ maxWidth: '100%', opacity: isPreviousVersionSnapshot ? 0.45 : 1 }}
>
<span className={`absolute inset-y-0 left-0 w-1 rounded-l ${deviceAccentClass}`} aria-hidden="true" />
{test.test_id}