bbovenzi commented on code in PR #53151:
URL: https://github.com/apache/airflow/pull/53151#discussion_r2210859558
##########
airflow-core/src/airflow/ui/src/layouts/Details/DetailsLayout.tsx:
##########
@@ -53,20 +56,29 @@ type Props = {
export const DetailsLayout = ({ children, error, isLoading, tabs }: Props) => {
const { t: translate } = useTranslation();
const { dagId = "" } = useParams();
-
const { data: dag } = useDagServiceGetDag({ dagId });
const [defaultDagView] = useLocalStorage<"graph" |
"grid">("default_dag_view", "grid");
- const panelGroupRef = useRef(null);
const [dagView, setDagView] = useLocalStorage<"graph" |
"grid">(`dag_view-${dagId}`, defaultDagView);
const [limit, setLimit] = useLocalStorage<number>(`dag_runs_limit-${dagId}`,
10);
-
const { fitView, getZoom } = useReactFlow();
-
- const { data: warningData } = useDagWarningServiceListDagWarnings({
- dagId,
- });
+ const { data: warningData } = useDagWarningServiceListDagWarnings({ dagId });
const { onClose, onOpen, open } = useDisclosure();
const [isRightPanelCollapsed, setIsRightPanelCollapsed] = useState(false);
+ const { i18n } = useTranslation();
+ const direction = i18n.dir();
+
+ const storageKey = `panel-${dagId}-${dagView}`;
+ let initialSizes: readonly [number, number] =
+ dagView === "graph" ? DEFAULT_GRAPH_SIZES : DEFAULT_GRID_SIZES;
+ const savedSizes = sessionStorage.getItem(storageKey);
+
+ if (savedSizes !== null) {
+ const parsed: unknown = JSON.parse(savedSizes);
+
+ if (Array.isArray(parsed) && parsed.length === 2) {
+ initialSizes = parsed as [number, number];
+ }
+ }
Review Comment:
Don't think we need this anymore?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]