Sidebar: a green tick on a validated analysis, the count of validated analyses per station

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
maximeandClaude Opus 5.5 committed 2026-11-17 12:25:43 +01:00
1 parent ce0200a97a
commit 071057dff8
1 file changed
+8 -3
+8 -3
View File
@@ -3,7 +3,7 @@ import {
ActionIcon, AppShell, Burger, ColorSwatch, Group, Loader, NavLink, ScrollArea, Text, Tooltip, useComputedColorScheme, useMantineColorScheme, ActionIcon, AppShell, Burger, ColorSwatch, Group, Loader, NavLink, ScrollArea, Text, Tooltip, useComputedColorScheme, useMantineColorScheme,
} from "@mantine/core"; } from "@mantine/core";
import { useDisclosure } from "@mantine/hooks"; import { useDisclosure } from "@mantine/hooks";
import { IconChartLine, IconFolder, IconMoon, IconSatellite, IconSun } from "@tabler/icons-react"; import { IconChartLine, IconCircleCheck, IconCircleDashed, IconFolder, IconMoon, IconSatellite, IconSun } from "@tabler/icons-react";
const Data = lazy(() => import("./pages/Data.jsx")); // Plotly, loaded only here const Data = lazy(() => import("./pages/Data.jsx")); // Plotly, loaded only here
const Stations = lazy(() => import("./pages/Stations.jsx")); const Stations = lazy(() => import("./pages/Stations.jsx"));
@@ -49,7 +49,8 @@ function Header({ mobile, desktop, toggle }) {
} }
// The analyses of the Data page (labeling/auto/analyses/), read again every 3 s: one folder per station, open by default if // The analyses of the Data page (labeling/auto/analyses/), read again every 3 s: one folder per station, open by default if
// it has one running, and inside one analysis per range; a click opens Data on its station and its days, and shows its report there // it has one running, and inside one analysis per range (a green tick: its labels validated); a click opens Data on its
// station and its days, and shows its report there
// The range of an analysis on one line: "01.11 · 10:30–11:40" within the day, otherwise "04.11 21:12 – 07.11 14:12" (UTC) // The range of an analysis on one line: "01.11 · 10:30–11:40" within the day, otherwise "04.11 21:12 – 07.11 14:12" (UTC)
const dayMonth = t => `${t.slice(8, 10)}.${t.slice(5, 7)}`, hour = t => t.slice(11, 16); const dayMonth = t => `${t.slice(8, 10)}.${t.slice(5, 7)}`, hour = t => t.slice(11, 16);
const range = a => (a.start.slice(0, 10) === a.end.slice(0, 10) const range = a => (a.start.slice(0, 10) === a.end.slice(0, 10)
@@ -72,12 +73,16 @@ function Analyses({ open }) {
<Text size="xs" fw={700} tt="uppercase" c="dimmed" px="sm" pt="lg" pb="xs">Analyses (UTC)</Text> <Text size="xs" fw={700} tt="uppercase" c="dimmed" px="sm" pt="lg" pb="xs">Analyses (UTC)</Text>
{stations.map(st => { {stations.map(st => {
const its = list.filter(a => a.station === st), busy = its.some(a => a.state === "running"); const its = list.filter(a => a.station === st), busy = its.some(a => a.state === "running");
const validated = its.filter(a => a.validated).length;
// the chevron of the folder stays Mantine's: a rightSection would take its place, and rotate with it // the chevron of the folder stays Mantine's: a rightSection would take its place, and rotate with it
return ( return (
<NavLink key={st} defaultOpened={busy} childrenOffset={22} leftSection={<IconFolder size={16} />} <NavLink key={st} defaultOpened={busy} childrenOffset={22} leftSection={<IconFolder size={16} />}
label={<Group gap={6} wrap="nowrap">{st}<Text span size="xs" c="dimmed">{its.length}</Text>{busy && <Loader size={10} color="orange" />}</Group>}> label={<Group gap={6} wrap="nowrap">{st}<Tooltip label={`${validated} of ${its.length} validated`}><Text span size="xs" c="dimmed">{validated}/{its.length}</Text></Tooltip>{busy && <Loader size={10} color="orange" />}</Group>}>
{its.map(a => ( {its.map(a => (
<NavLink key={a.name} py={4} onClick={() => open(a)} leftSection={<Dot state={a.state} />} <NavLink key={a.name} py={4} onClick={() => open(a)} leftSection={<Dot state={a.state} />}
rightSection={a.validated ? <Tooltip label={`labels validated ${a.validated}`}>
<IconCircleCheck size={14} color="var(--mantine-color-green-6)" /></Tooltip>
: a.state === "done" && <Tooltip label="labels to validate"><IconCircleDashed size={14} color="var(--mantine-color-dimmed)" /></Tooltip>}
label={<Text size="xs" ff="monospace" style={{ whiteSpace: "nowrap" }}>{range(a)}</Text>} /> label={<Text size="xs" ff="monospace" style={{ whiteSpace: "nowrap" }}>{range(a)}</Text>} />
))} ))}
</NavLink> </NavLink>