@tutti-os/workspace-file-manager 0.0.106 → 0.0.108

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.
package/README.md CHANGED
@@ -26,7 +26,13 @@ the shared UI.
26
26
 
27
27
  The optional React surface persists the adjustable locations-sidebar and
28
28
  details-panel widths on the current device. Restored widths are clamped to the
29
- available surface so the central file list keeps its minimum usable width.
29
+ available surface so the central file list keeps its minimum usable width. The
30
+ locations sidebar can use the space normally reserved for file details when a
31
+ host hides the details panel, which keeps long location names readable in
32
+ compact tool-sidebar layouts. In narrow list layouts, the name column keeps a
33
+ usable minimum width. Starting a locations-sidebar resize preserves the name
34
+ column's current width so modified-time and size metadata shrink from the first
35
+ drag movement.
30
36
 
31
37
  Hosts now provide one app-level i18n runtime and scope it into the file-manager
32
38
  namespace, rather than hand-assembling package-local message objects.
package/dist/index.js CHANGED
@@ -1013,7 +1013,7 @@ function resolveWorkspaceFileManagerContextMenuViewState(input) {
1013
1013
  showImportAction: state.capabilities.canImportFromPicker && !isExternalLocation && !isRecentLocation && !isSearchMode,
1014
1014
  showMoveAction: state.capabilities.canMove && !isExternalLocation && !isRecentLocation && !isSearchMode,
1015
1015
  showOpenInAppBrowserAction: state.capabilities.canOpenInAppBrowser && !isExternalLocation,
1016
- showOpenInDefaultBrowserAction: state.capabilities.canOpenInDefaultBrowser && !isExternalLocation,
1016
+ showOpenInDefaultBrowserAction: state.capabilities.canOpenInDefaultBrowser,
1017
1017
  showOpenInFileViewerAction: contextMenuEntry !== null && isContextMenuFile && resolveWorkspaceFileActivationTarget(contextMenuEntry) !== null,
1018
1018
  showOpenWithAction: state.capabilities.canOpenWith && isContextMenuFile,
1019
1019
  showOpenWithOtherAction: state.capabilities.canPickOtherOpenWithApplication && isContextMenuFile,
@@ -2142,6 +2142,7 @@ function IconTileRenameInput({
2142
2142
  var workspaceFileManagerSidebarDefaultWidth = 460;
2143
2143
  var workspaceFileManagerSidebarMinWidth = 180;
2144
2144
  var workspaceFileManagerContentMinWidth = 580;
2145
+ var workspaceFileManagerContentWithoutPreviewMinWidth = 320;
2145
2146
  var workspaceFileManagerPaneResizeStep = 24;
2146
2147
  var workspaceFileManagerPreviewDefaultWidth = 348;
2147
2148
  var workspaceFileManagerSidebarWidthStorageKey = "tutti.workspace-file-manager.sidebar-width";
@@ -2171,25 +2172,32 @@ function writeWorkspaceFileManagerPreviewWidth(width) {
2171
2172
  );
2172
2173
  }
2173
2174
  function clampWorkspaceFileManagerSidebarWidth(input) {
2174
- const containerWidth = Number.isFinite(input.containerWidth) ? input.containerWidth : workspaceFileManagerSidebarMinWidth + workspaceFileManagerContentMinWidth;
2175
+ const contentMinWidth = resolveWorkspaceFileManagerContentMinWidth(
2176
+ input.contentMinWidth
2177
+ );
2178
+ const containerWidth = Number.isFinite(input.containerWidth) ? input.containerWidth : workspaceFileManagerSidebarMinWidth + contentMinWidth;
2175
2179
  const maxWidth = Math.max(
2176
2180
  workspaceFileManagerSidebarMinWidth,
2177
- containerWidth - workspaceFileManagerContentMinWidth
2181
+ containerWidth - contentMinWidth
2178
2182
  );
2179
2183
  const width = Number.isFinite(input.width) ? input.width : workspaceFileManagerSidebarDefaultWidth;
2180
2184
  return Math.round(
2181
2185
  Math.min(maxWidth, Math.max(workspaceFileManagerSidebarMinWidth, width))
2182
2186
  );
2183
2187
  }
2184
- function resolveWorkspaceFileManagerSidebarMaxWidth(containerWidth) {
2185
- const resolvedContainerWidth = Number.isFinite(containerWidth) ? containerWidth : workspaceFileManagerSidebarMinWidth + workspaceFileManagerContentMinWidth;
2188
+ function resolveWorkspaceFileManagerSidebarMaxWidth(containerWidth, contentMinWidth) {
2189
+ const resolvedContentMinWidth = resolveWorkspaceFileManagerContentMinWidth(contentMinWidth);
2190
+ const resolvedContainerWidth = Number.isFinite(containerWidth) ? containerWidth : workspaceFileManagerSidebarMinWidth + resolvedContentMinWidth;
2186
2191
  return Math.round(
2187
2192
  Math.max(
2188
2193
  workspaceFileManagerSidebarMinWidth,
2189
- resolvedContainerWidth - workspaceFileManagerContentMinWidth
2194
+ resolvedContainerWidth - resolvedContentMinWidth
2190
2195
  )
2191
2196
  );
2192
2197
  }
2198
+ function resolveWorkspaceFileManagerContentMinWidth(contentMinWidth) {
2199
+ return typeof contentMinWidth === "number" && Number.isFinite(contentMinWidth) && contentMinWidth > 0 ? contentMinWidth : workspaceFileManagerContentMinWidth;
2200
+ }
2193
2201
  function readWorkspaceFileManagerPaneWidth(storageKey, defaultWidth) {
2194
2202
  if (typeof window === "undefined") {
2195
2203
  return defaultWidth;
@@ -2204,15 +2212,27 @@ function writeWorkspaceFileManagerPaneWidth(storageKey, width) {
2204
2212
  window.localStorage.setItem(storageKey, String(width));
2205
2213
  }
2206
2214
 
2215
+ // src/ui/workspaceFileManagerTableSizing.ts
2216
+ var workspaceFileManagerTableNameMinWidth = 240;
2217
+ var workspaceFileManagerTableNameMinWidthProperty = "--workspace-file-manager-table-name-min-width";
2218
+ var workspaceFileManagerTableNameColumnSelector = "[data-workspace-file-manager-name-column]";
2219
+ var workspaceFileManagerTableNameMinWidthExpression = `var(${workspaceFileManagerTableNameMinWidthProperty}, ${workspaceFileManagerTableNameMinWidth}px)`;
2220
+ var workspaceFileManagerTableGridClassName = "grid-cols-[minmax(240px,_1fr)_minmax(0,_148px)_minmax(0,_96px)]";
2221
+ var workspaceFileManagerTableGridTemplate = `minmax(${workspaceFileManagerTableNameMinWidthExpression}, 1fr) minmax(0, 148px) minmax(0, 96px)`;
2222
+ var workspaceFileManagerCompactTableGridClassName = "grid-cols-[minmax(240px,_1fr)_minmax(0,_96px)_minmax(0,_72px)]";
2223
+ var workspaceFileManagerCompactTableGridTemplate = `minmax(${workspaceFileManagerTableNameMinWidthExpression}, 1fr) minmax(0, 96px) minmax(0, 72px)`;
2224
+ function resolveWorkspaceFileManagerPreservedNameColumnWidth(width) {
2225
+ const resolvedWidth = Number.isFinite(width) ? Math.round(width) : workspaceFileManagerTableNameMinWidth;
2226
+ return Math.max(workspaceFileManagerTableNameMinWidth, resolvedWidth);
2227
+ }
2228
+
2207
2229
  // src/ui/WorkspaceFileManagerPanels.tsx
2208
2230
  import { Fragment as Fragment2, jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
2209
- var workspaceFileManagerTableGridClassName = "grid-cols-[minmax(0,_1fr)_148px_96px]";
2210
2231
  var workspaceFileManagerTableGridStyle = {
2211
- gridTemplateColumns: "minmax(0, 1fr) 148px 96px"
2232
+ gridTemplateColumns: workspaceFileManagerTableGridTemplate
2212
2233
  };
2213
- var workspaceFileManagerCompactTableGridClassName = "grid-cols-[minmax(0,_1fr)_96px_72px]";
2214
2234
  var workspaceFileManagerCompactTableGridStyle = {
2215
- gridTemplateColumns: "minmax(0, 1fr) 96px 72px"
2235
+ gridTemplateColumns: workspaceFileManagerCompactTableGridTemplate
2216
2236
  };
2217
2237
  var workspaceFileManagerPreviewDetailGridStyle = {
2218
2238
  gridTemplateColumns: "minmax(82px, 0.8fr) minmax(0, 1.2fr)"
@@ -2649,18 +2669,28 @@ function WorkspaceFileManagerPanels({
2649
2669
  ),
2650
2670
  style: tableGridStyle,
2651
2671
  children: [
2652
- /* @__PURE__ */ jsx6("span", { className: tableCellPaddingClassName, children: copy.t("nameLabel") }),
2653
2672
  /* @__PURE__ */ jsx6(
2654
2673
  "span",
2655
2674
  {
2656
- className: cn4("whitespace-nowrap", tableCellPaddingClassName),
2675
+ className: cn4(
2676
+ "min-w-0 overflow-hidden",
2677
+ tableCellPaddingClassName
2678
+ ),
2679
+ "data-workspace-file-manager-name-column": "",
2680
+ children: copy.t("nameLabel")
2681
+ }
2682
+ ),
2683
+ /* @__PURE__ */ jsx6(
2684
+ "span",
2685
+ {
2686
+ className: cn4("min-w-0 truncate", tableCellPaddingClassName),
2657
2687
  children: dateColumnLabel
2658
2688
  }
2659
2689
  ),
2660
2690
  /* @__PURE__ */ jsx6(
2661
2691
  "span",
2662
2692
  {
2663
- className: cn4("whitespace-nowrap", tableCellPaddingClassName),
2693
+ className: cn4("min-w-0 truncate", tableCellPaddingClassName),
2664
2694
  children: copy.t("sizeLabel")
2665
2695
  }
2666
2696
  )
@@ -2917,7 +2947,7 @@ function EntryRow({
2917
2947
  onContextMenu(event, entry);
2918
2948
  }
2919
2949
  };
2920
- const nameCell = /* @__PURE__ */ jsx6("span", { className: tableCellPaddingClassName, children: /* @__PURE__ */ jsx6(
2950
+ const nameCell = /* @__PURE__ */ jsx6("span", { className: cn4("min-w-0 overflow-hidden", tableCellPaddingClassName), children: /* @__PURE__ */ jsx6(
2921
2951
  EntryNameCell,
2922
2952
  {
2923
2953
  copy,
@@ -3763,6 +3793,7 @@ function LayoutModeToggle({
3763
3793
  align: "end",
3764
3794
  className: "min-w-[236px] px-1 py-1",
3765
3795
  sideOffset: 7,
3796
+ style: { zIndex: "var(--z-panel-popover)" },
3766
3797
  children: /* @__PURE__ */ jsx7(
3767
3798
  DropdownMenuRadioGroup,
3768
3799
  {
@@ -4379,15 +4410,23 @@ function WorkspaceFileManager({
4379
4410
  const hasLocationSidebar = rootView.locationSections.some(
4380
4411
  (section) => section.locations.length > 0
4381
4412
  );
4382
- const sidebarMaxWidth = containerWidth > 0 ? resolveWorkspaceFileManagerSidebarMaxWidth(containerWidth) : workspaceFileManagerSidebarDefaultWidth;
4383
- const updateSidebarWidth = useCallback6((width) => {
4384
- const nextWidth = clampWorkspaceFileManagerSidebarWidth({
4385
- containerWidth: rootRef.current?.getBoundingClientRect().width ?? 0,
4386
- width
4387
- });
4388
- setSidebarWidth(nextWidth);
4389
- return nextWidth;
4390
- }, []);
4413
+ const sidebarContentMinWidth = showPreviewPanel ? workspaceFileManagerContentMinWidth : workspaceFileManagerContentWithoutPreviewMinWidth;
4414
+ const sidebarMaxWidth = containerWidth > 0 ? resolveWorkspaceFileManagerSidebarMaxWidth(
4415
+ containerWidth,
4416
+ sidebarContentMinWidth
4417
+ ) : workspaceFileManagerSidebarDefaultWidth;
4418
+ const updateSidebarWidth = useCallback6(
4419
+ (width) => {
4420
+ const nextWidth = clampWorkspaceFileManagerSidebarWidth({
4421
+ containerWidth: rootRef.current?.getBoundingClientRect().width ?? 0,
4422
+ contentMinWidth: sidebarContentMinWidth,
4423
+ width
4424
+ });
4425
+ setSidebarWidth(nextWidth);
4426
+ return nextWidth;
4427
+ },
4428
+ [sidebarContentMinWidth]
4429
+ );
4391
4430
  useLayoutEffect4(() => {
4392
4431
  const element = rootRef.current;
4393
4432
  if (!element || !hasLocationSidebar) {
@@ -4401,6 +4440,7 @@ function WorkspaceFileManager({
4401
4440
  setSidebarWidth(
4402
4441
  (currentWidth) => clampWorkspaceFileManagerSidebarWidth({
4403
4442
  containerWidth: nextContainerWidth,
4443
+ contentMinWidth: sidebarContentMinWidth,
4404
4444
  width: currentWidth
4405
4445
  })
4406
4446
  );
@@ -4417,12 +4457,25 @@ function WorkspaceFileManager({
4417
4457
  return () => {
4418
4458
  observer.disconnect();
4419
4459
  };
4420
- }, [hasLocationSidebar]);
4460
+ }, [hasLocationSidebar, sidebarContentMinWidth]);
4421
4461
  const handleSidebarResizePointerDown = useCallback6(
4422
4462
  (event) => {
4423
4463
  if (event.button !== 0) {
4424
4464
  return;
4425
4465
  }
4466
+ const root = rootRef.current;
4467
+ const nameColumn = root?.querySelector(
4468
+ workspaceFileManagerTableNameColumnSelector
4469
+ );
4470
+ if (root && nameColumn) {
4471
+ const preservedWidth = resolveWorkspaceFileManagerPreservedNameColumnWidth(
4472
+ nameColumn.getBoundingClientRect().width
4473
+ );
4474
+ root.style.setProperty(
4475
+ workspaceFileManagerTableNameMinWidthProperty,
4476
+ `${preservedWidth}px`
4477
+ );
4478
+ }
4426
4479
  event.preventDefault();
4427
4480
  event.currentTarget.setPointerCapture(event.pointerId);
4428
4481
  sidebarResizeRef.current = {