Skip to content

Commit b3fcda4

Browse files
Lucien950RealBabyPotato
authored andcommitted
css changes
1 parent f386109 commit b3fcda4

File tree

3 files changed

+18
-22
lines changed

3 files changed

+18
-22
lines changed

software/tracksight/frontend/app/live/page.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ export default function LiveDataPage() {
2424
<DisplayControlProvider> {/* not so sure actually (OLD) */}
2525
<SignalProvider> {/* provides signal data (OLD) */}
2626
<SyncedGraphContainer>
27-
<div className="h-48"></div>
2827
{/** TODO(evan): Add pause / play button here */}
2928
{/** TODO(evan): Add the universal timeline here */}
3029
{/* TODO rework alerts */}
@@ -42,7 +41,6 @@ export default function LiveDataPage() {
4241
key={widgetData.id} />
4342
)}
4443
<WidgetAdder onAddWidget={appendWidget} />
45-
<div className="h-48"></div>
4644
{/* <DynamicRowManager /> */}
4745
</SyncedGraphContainer>
4846
</SignalProvider >

software/tracksight/frontend/components/SyncedGraphContainer.tsx

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function useZoomManager(containerRef: RefObject<HTMLDivElement | null>) {
4545
useEffect(() => {
4646
const container = containerRef.current;
4747
if (!container) return;
48-
48+
4949
window.addEventListener("wheel", handleWheelZoom, { passive: false });
5050
return () => {
5151
window.removeEventListener("wheel", handleWheelZoom);
@@ -61,11 +61,11 @@ export default function SyncedGraphContainer({ children }: { children: ReactNode
6161
const contentRef = useRef<HTMLDivElement | null>(null); // Renamed from containerRef, this one grows
6262
const scrollLeftRef = useRef<number>(0);
6363
const timeRangeRef = useRef<TimeRange | null>(null);
64-
64+
6565
// zoom management (attach wheel listener to the scroll container)
6666
const scalePxPerSec = useZoomManager(scrollContainerRef);
6767
const scalePxPerSecRef = useRef<number>(scalePxPerSec);
68-
68+
6969
const updateGraphWidth = useCallback(() => {
7070
const tr = timeRangeRef.current;
7171
if (contentRef.current && tr) {
@@ -133,16 +133,12 @@ export default function SyncedGraphContainer({ children }: { children: ReactNode
133133
return (
134134
<SyncedGraphContext.Provider value={CTXVAL}>
135135
{/* outer wrapper handles overflow/scrolling; this the viewport */}
136-
<div
137-
ref={scrollContainerRef}
138-
className="w-full overflow-x-auto overflow-y-hidden"
136+
<div
137+
ref={scrollContainerRef}
138+
className="w-full overflow-x-auto overflow-y-hidden min-h-screen pt-14"
139139
>
140140
{/* inner content grows in width */}
141-
<div
142-
ref={contentRef}
143-
className="min-w-full min-h-60 relative"
144-
style={{ width: 4000 }}
145-
>
141+
<div ref={contentRef} className="min-w-full min-h-60 relative">
146142
<div className="sticky left-0 top-0 w-screen">
147143
{children}
148144
</div>

software/tracksight/frontend/components/widgets/MockWidget.tsx

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,14 @@ const generateRandomValue = (
3131
}
3232
};
3333

34-
const MockWidget = memo(({ widgetData, updateMockConfig, onDelete }:
35-
{ widgetData: WidgetDataMock, updateMockConfig:
36-
(widgetId: string,
37-
updater: (prevConfigs: MockGraphConfig[]) => MockGraphConfig[]) => void,
38-
onDelete: () => void }
39-
) => {
34+
const MockWidget = memo(({ widgetData, updateMockConfig, onDelete }:
35+
{
36+
widgetData: WidgetDataMock, updateMockConfig:
37+
(widgetId: string,
38+
updater: (prevConfigs: MockGraphConfig[]) => MockGraphConfig[]) => void,
39+
onDelete: () => void
40+
}
41+
) => {
4042
const { isPaused } = usePausePlay();
4143
const configs = widgetData.configs;
4244

@@ -130,8 +132,8 @@ const MockWidget = memo(({ widgetData, updateMockConfig, onDelete }:
130132
timestamps,
131133
series: seriesArrays,
132134
}
133-
}, [configs, isPaused]);
134-
135+
}, [configs, isPaused]);
136+
135137
const handleAddSignal = useCallback((e: FormEvent) => {
136138
e.preventDefault();
137139
const name = newSignalName.trim() || `Signal ${configs.length + 1}`;
@@ -170,7 +172,7 @@ const MockWidget = memo(({ widgetData, updateMockConfig, onDelete }:
170172
const totalDataPoints = dataRef.current.timestamps.length;
171173

172174
return (
173-
<div className="mb-6 p-4 block w-full relative">
175+
<div className="mb-6 p-4 block w-full relative border border-red-500">
174176
<div className="sticky left-0 block w-[50vw] animate-none overscroll-contain z-40">
175177
<div className="flex items-center gap-2 mb-4">
176178
<h3 className="font-semibold">Mock Graph Container (Widget)</h3>

0 commit comments

Comments
 (0)