diff --git a/frontend-modern/src/components/Dashboard/StackedMemoryBar.tsx b/frontend-modern/src/components/Dashboard/StackedMemoryBar.tsx index 6640084..d6e86f4 100644 --- a/frontend-modern/src/components/Dashboard/StackedMemoryBar.tsx +++ b/frontend-modern/src/components/Dashboard/StackedMemoryBar.tsx @@ -119,21 +119,31 @@ export function StackedMemoryBar(props: StackedMemoryBarProps) { onMouseEnter={handleMouseEnter} onMouseLeave={handleMouseLeave} > - {/* Stacked segments */} -
- - {(segment, idx) => ( + {/* Stacked segments - use absolute positioning like MetricBar for correct width scaling */} + + {(segment, idx) => { + // Calculate left offset as sum of previous segments + const leftOffset = () => { + let offset = 0; + const segs = segments(); + for (let i = 0; i < idx(); i++) { + offset += segs[i].percent; + } + return offset; + }; + return (
- )} - -
+ ); + }} +
{/* Swap Indicator (Thin line at bottom if swap is used) */} {/* Swap Indicator (Thin line at bottom if swap is used) */}