fix: align scale info with floating timeline
This commit is contained in:
@@ -32,6 +32,7 @@ import {
|
||||
} from "@/features/map/core";
|
||||
import { env } from "@/shared/config/env";
|
||||
import type { AccessTokenProvider } from "@/shared/auth/keycloak-auth";
|
||||
import { cn } from "@/shared/ui/cn";
|
||||
import { AgentTaskTicker } from "./components/agent-task-ticker";
|
||||
import { MapDevPanel } from "./components/map-dev-panel";
|
||||
import { MobileWorkbenchSheet } from "./components/mobile-workbench-sheet";
|
||||
@@ -40,8 +41,10 @@ import { ScheduledConditionFeed } from "./components/scheduled-condition-feed";
|
||||
import { WorkbenchAgentPanels } from "./components/workbench-agent-panels";
|
||||
import { OperationalTimeline } from "./operational-timeline/operational-timeline";
|
||||
import {
|
||||
canDockMapScaleBesideTimeline,
|
||||
createOperationalEvents,
|
||||
getOperationalEventSummary,
|
||||
OPERATIONAL_TIMELINE_LAYOUT,
|
||||
type OperationalEvent,
|
||||
type OperationalTimelineMode
|
||||
} from "./operational-timeline/operational-timeline-model";
|
||||
@@ -213,6 +216,11 @@ export function MapWorkbenchPage({
|
||||
() => getOperationalEventSummary(operationalEvents),
|
||||
[operationalEvents]
|
||||
);
|
||||
const scaleInfoBesideTimeline = canDockMapScaleBesideTimeline(
|
||||
businessWorkspaceWidth,
|
||||
timelineMode,
|
||||
timelineVisible
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
setTimelineMode((current) => {
|
||||
@@ -919,12 +927,8 @@ export function MapWorkbenchPage({
|
||||
!timelineVisible
|
||||
? 0
|
||||
: !isLargeScreen
|
||||
? 48
|
||||
: timelineMode === "expanded"
|
||||
? 240
|
||||
: timelineMode === "summary"
|
||||
? 52
|
||||
: 72
|
||||
? OPERATIONAL_TIMELINE_LAYOUT.mobileSummaryHeight
|
||||
: OPERATIONAL_TIMELINE_LAYOUT[timelineMode].height
|
||||
}px`
|
||||
} as CSSProperties
|
||||
}
|
||||
@@ -971,6 +975,7 @@ export function MapWorkbenchPage({
|
||||
onCollapseArtifact={artifactWorkspace.collapseArtifact}
|
||||
onDestroyArtifact={artifactWorkspace.destroyArtifact}
|
||||
timelineMode={timelineMode}
|
||||
reserveMapScaleSpace={scaleInfoBesideTimeline}
|
||||
timelineContent={(
|
||||
timelineVisible ? <>
|
||||
<div className="hidden lg:block">
|
||||
@@ -1016,7 +1021,14 @@ export function MapWorkbenchPage({
|
||||
<div className="pointer-events-auto absolute right-16 top-3 hidden lg:block">
|
||||
<ToolbarPanel {...toolbarPanelProps} />
|
||||
</div>
|
||||
<div className="absolute bottom-[calc(var(--workbench-timeline-height)+1rem)] right-0 flex flex-col items-end gap-2">
|
||||
<div
|
||||
className={cn(
|
||||
"absolute right-0 flex flex-col items-end gap-2",
|
||||
scaleInfoBesideTimeline
|
||||
? "bottom-3"
|
||||
: "bottom-[calc(var(--workbench-timeline-height)+1rem)]"
|
||||
)}
|
||||
>
|
||||
<div className="flex items-end gap-2 pr-2">
|
||||
<MapZoom mapRef={mapRef} mapReady={mapReady} onHome={fitNetworkBounds} />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user