fix(board): improve widget scaling and edit layering
This commit is contained in:
1 parent
ea250d418d
commit
dc600fc5c8
7 files changed
+110
-100
No files matched your search
@@ -101,12 +101,12 @@ interface BeszelChartPanelProps {
|
||||
|
||||
export const BeszelChartPanel = memo(({ title, subtitle, chartProps }: BeszelChartPanelProps) => (
|
||||
<Stack gap={4} style={panelStyle}>
|
||||
<Group gap="xs">
|
||||
<Text size="sm" fw={600}>
|
||||
<Group gap="xs" wrap="nowrap">
|
||||
<Text size="sm" fw={600} style={{ flexShrink: 0 }}>
|
||||
{title}
|
||||
</Text>
|
||||
{subtitle && (
|
||||
<Text size="xs" c="dimmed">
|
||||
<Text size="xs" c="dimmed" truncate style={{ minWidth: 0 }}>
|
||||
{subtitle}
|
||||
</Text>
|
||||
)}
|
||||
|
||||
@@ -35,13 +35,13 @@ const tooltips = {
|
||||
bytesTotal: makeTooltipProps(formatStorageBytes, true),
|
||||
};
|
||||
|
||||
const ChartSkeleton = () => (
|
||||
const ChartSkeleton = ({ height }: { height: number }) => (
|
||||
<Stack gap={4} style={{ minWidth: 0 }}>
|
||||
<Group gap="xs">
|
||||
<Skeleton h={14} w={72} radius="sm" />
|
||||
<Skeleton h={10} w={110} radius="sm" />
|
||||
</Group>
|
||||
<Skeleton h={CHART_HEIGHT} radius="sm" />
|
||||
<Skeleton h={height} radius="sm" />
|
||||
</Stack>
|
||||
);
|
||||
|
||||
@@ -67,7 +67,7 @@ interface BeszelStatsViewProps {
|
||||
}
|
||||
|
||||
const MIN_CHART_HEIGHT = 100;
|
||||
const PANEL_ROW_OVERHEAD = 28;
|
||||
const PANEL_ROW_OVERHEAD = 25;
|
||||
const GRID_ROW_GAP = 16;
|
||||
|
||||
const computeChartHeight = (availableHeight: number | undefined, rowCount: number) => {
|
||||
@@ -238,10 +238,13 @@ export function BeszelStatsView({
|
||||
|
||||
if (!activeStats) {
|
||||
const visibleChartCount = Object.values(visibility).filter(Boolean).length;
|
||||
const effectiveColumns = Math.min(columns, Math.max(1, visibleChartCount)) as 1 | 2;
|
||||
const rowCount = Math.ceil(visibleChartCount / effectiveColumns);
|
||||
const chartHeight = computeChartHeight(availableHeight, rowCount);
|
||||
return (
|
||||
<SimpleGrid cols={columns} spacing="md" aria-label={t("name")}>
|
||||
<SimpleGrid cols={effectiveColumns} spacing="md" aria-label={t("name")}>
|
||||
{Array.from({ length: visibleChartCount }, (_, index) => (
|
||||
<ChartSkeleton key={index} />
|
||||
<ChartSkeleton key={index} height={chartHeight} />
|
||||
))}
|
||||
</SimpleGrid>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user