@gen3/workspaces 0.12.51 → 0.12.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,10 +3,10 @@ import React, { useCallback, useMemo, useState, useRef, useEffect, createContext
3
3
  import { mergeDefaultTailwindClassnames, ACTIVITY_CHANNEL, convertSecondsToMilliseconds, InfoRolloverButton, OverflowTooltippedLabel, PanelErrorBoundary, ProtectedContent, FixedNavPageLayout, ContentSource, getNavPageLayoutPropsFromConfig } from '@gen3/frontend';
4
4
  import { Card, Stack, Badge, Text, List, Group, Tooltip, Button, LoadingOverlay, Alert, Loader, Divider, Select, ActionIcon, TextInput, Textarea, Table, Scroller, Tabs, Center } from '@mantine/core';
5
5
  import { Icon } from '@iconify-icon/react';
6
+ import { useInterval, useElementSize, useDisclosure, useResizeObserver } from '@mantine/hooks';
6
7
  import { GEN3_API, GEN3_WORKSPACE_API, gen3Api, useCoreSelector, selectJEGActiveWorkspaceStatus, useCoreDispatch, setJEGActiveWorkspaceStatus, WorkspaceStatus, setJEGRequestedWorkspaceStatus, RequestedWorkspaceStatus, setJEGActiveWorkspaceId, isFetchBaseQueryError, selectJEGRequestedWorkspaceStatus, selectJEGRequestedWorkspaceStatusTimestamp, isTimeGreaterThan, formatUptimeInMinutes, selectJEGKernelIds, removeManyJEGActiveKernels, upsertManyJEGActiveKernels, normalizeRtkError, selectAllJEGKernels, addJEGActiveKernel, selectWorkspaceTier, setWorkspaceTier, selectWorkspaceFullscreen, setWorkspaceFullscreen, useGetDictionaryFromUrlQuery, useUserAuth, GEN3_COMMONS_NAME } from '@gen3/core';
7
8
  import { useDeepCompareEffect } from 'use-deep-compare';
8
9
  import { notifications } from '@mantine/notifications';
9
- import { useElementSize, useDisclosure, useResizeObserver } from '@mantine/hooks';
10
10
  import { IoSettingsSharp } from 'react-icons/io5';
11
11
  import { BsFillInfoCircleFill } from 'react-icons/bs';
12
12
  import { MdKeyboardArrowDown, MdKeyboardArrowRight } from 'react-icons/md';
@@ -936,19 +936,21 @@ const MicroContainerReduxPanel = ({ compact = false })=>{
936
936
  coreDispatch
937
937
  ]);
938
938
  /* ── Elapsed timer for launching state ── */ const [elapsedSec, setElapsedSec] = useState(0);
939
+ const interval = useInterval(()=>{
940
+ const elapsed = Math.floor((Date.now() - requestedStatusTimestamp) / 1000);
941
+ setElapsedSec(elapsed);
942
+ }, 1000);
939
943
  useEffect(()=>{
940
- if (status !== WorkspaceStatus.Launching) {
944
+ if (status === WorkspaceStatus.Launching) {
945
+ interval.start();
946
+ } else {
941
947
  setElapsedSec(0);
942
- return;
948
+ interval.stop();
943
949
  }
944
- const interval = Math.floor((Date.now() - requestedStatusTimestamp) / 1000);
945
- const t = setInterval(()=>{
946
- setElapsedSec(interval);
947
- }, 1000);
948
- return ()=>clearInterval(t);
950
+ return interval.stop;
949
951
  }, [
950
- requestedStatusTimestamp,
951
- status
952
+ status,
953
+ interval
952
954
  ]);
953
955
  /* ── Auto-reset after 15 s in launch-error state ── */ useEffect(()=>{
954
956
  if (status !== WorkspaceStatus.LaunchError) return;
@@ -1002,9 +1004,6 @@ const MicroContainerReduxPanel = ({ compact = false })=>{
1002
1004
  });
1003
1005
  }
1004
1006
  /* ── launching ── */ if (status === WorkspaceStatus.Launching) {
1005
- const mins = Math.floor(elapsedSec / 60);
1006
- const secs = elapsedSec % 60;
1007
- const elapsed = mins > 0 ? `${mins}m ${secs}s` : `${secs}s`;
1008
1007
  return /*#__PURE__*/ jsxs("div", {
1009
1008
  role: "status",
1010
1009
  className: PanelStyle$2,
@@ -1027,7 +1026,9 @@ const MicroContainerReduxPanel = ({ compact = false })=>{
1027
1026
  className: "mt-1 text-sm text-base-darker",
1028
1027
  children: [
1029
1028
  "Elapsed: ",
1030
- elapsed
1029
+ elapsedSec,
1030
+ " ",
1031
+ elapsedSec === 1 ? 'second' : 'seconds'
1031
1032
  ]
1032
1033
  }),
1033
1034
  /*#__PURE__*/ jsx("p", {
@@ -2239,7 +2240,7 @@ function HorizontalAccordion({ label, expanded, setExpanded, children, expandedW
2239
2240
  });
2240
2241
  const mergedClassNames = mergeDefaultTailwindClassnames(STYLING_DEFAULTS, classNames);
2241
2242
  return /*#__PURE__*/ jsx("div", {
2242
- className: `overflow-hidden shrink-0 ${mergedClassNames.root}`,
2243
+ className: `${mergedClassNames.root}`,
2243
2244
  style: {
2244
2245
  width: expanded ? expandedWidth : collapsedWidth,
2245
2246
  transition: `width ${TRANSITION_MS}ms ease`
@@ -2274,7 +2275,7 @@ function HorizontalAccordion({ label, expanded, setExpanded, children, expandedW
2274
2275
  ]
2275
2276
  }),
2276
2277
  /*#__PURE__*/ jsx("div", {
2277
- className: "overflow-hidden h-full shrink-0 px-2",
2278
+ className: "overflow-hidden px-2",
2278
2279
  style: {
2279
2280
  opacity: expanded ? 1 : 0,
2280
2281
  pointerEvents: expanded ? 'auto' : 'none',
@@ -2302,9 +2303,8 @@ const SettingsPanel = ({ showKernels, expanded, setExpanded, width = 380 })=>{
2302
2303
  setExpanded: setExpanded,
2303
2304
  rightSide: true,
2304
2305
  expandedWidth: width,
2305
- children: /*#__PURE__*/ jsxs(Stack, {
2306
- gap: "sm",
2307
- className: PanelStyle,
2306
+ children: /*#__PURE__*/ jsxs("div", {
2307
+ className: `${PanelStyle} overflow-y-scroll`,
2308
2308
  children: [
2309
2309
  showKernels && /*#__PURE__*/ jsx(KernelLifecyclePanel, {}),
2310
2310
  /*#__PURE__*/ jsx(UpgradeActionsPanel, {