@1agh/maude 1.6.6 → 1.6.8

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.
@@ -2823,6 +2823,42 @@ function sectionMetaFor(g) {
2823
2823
  return { title: g.label.toUpperCase(), pillFromCount: true };
2824
2824
  }
2825
2825
 
2826
+ // The file tree before its first index arrives. A large project — above all a
2827
+ // cloud one on a cold workspace — can take several seconds to list, and a blank
2828
+ // panel reading "0 / 0" looks like an empty or broken project. Skeleton rows
2829
+ // say "coming"; after a few seconds a line says why, and a failed attempt says
2830
+ // it is being retried (the index loader retries on its own).
2831
+ function TreeLoading({ failures, cloud }) {
2832
+ const [slow, setSlow] = useState(false);
2833
+ useEffect(() => {
2834
+ const t = setTimeout(() => setSlow(true), 3000);
2835
+ return () => clearTimeout(t);
2836
+ }, []);
2837
+ const hint =
2838
+ failures > 0
2839
+ ? 'The project is taking a while to answer — trying again…'
2840
+ : cloud
2841
+ ? 'Still loading — a large cloud project can take a few seconds to list.'
2842
+ : 'Still loading — a large project can take a few seconds to list.';
2843
+ return (
2844
+ <div className="st-tree-loading" role="status" aria-live="polite" data-testid="tree-loading">
2845
+ <div className="st-tree-loading-head">
2846
+ <span className="st-canvas-loading-spinner" aria-hidden="true" />
2847
+ <span>Loading files…</span>
2848
+ </div>
2849
+ {[64, 48, 72, 40, 56, 68, 44].map((w, i) => (
2850
+ <span
2851
+ key={i}
2852
+ className="skel st-tree-loading-row"
2853
+ style={{ width: `${w}%`, marginLeft: i % 3 ? 22 : 8 }}
2854
+ aria-hidden="true"
2855
+ />
2856
+ ))}
2857
+ {(slow || failures > 0) && <div className="st-tree-loading-hint">{hint}</div>}
2858
+ </div>
2859
+ );
2860
+ }
2861
+
2826
2862
  function Sidebar({
2827
2863
  // Cloud Phase 25 C2 — viewer role: create / delete / move / rename
2828
2864
  // affordances are absent (buttons, composer, row menus, drag & drop).
@@ -2880,6 +2916,7 @@ function Sidebar({
2880
2916
  onLocalProject,
2881
2917
  onOpenLinkedFile,
2882
2918
  filesReady,
2919
+ treeLoadFailures = 0,
2883
2920
  onShare,
2884
2921
  // feature-cloud-managed-git-posture — the widened DDR-218 gate, resolved once
2885
2922
  // in App and handed down. Withdraws the drafts switcher: a local branch
@@ -3233,6 +3270,7 @@ function Sidebar({
3233
3270
  </div>
3234
3271
  </div>
3235
3272
 
3273
+ {!filesReady && <TreeLoading failures={treeLoadFailures} cloud={cloud} />}
3236
3274
  <FileTree aria-label="Project file tree" data-testid="canvas-list">
3237
3275
  {filteredGroups.map((g) => {
3238
3276
  // Hide gitignored runtime / orphan-only project sections by default.
@@ -9947,6 +9985,9 @@ function InspectorPanel({
9947
9985
  function App() {
9948
9986
  const [groups, setGroups] = useState([]);
9949
9987
  const [treeLoaded, setTreeLoaded] = useState(false);
9988
+ // Failed /_index-data attempts since the last success — the tree's loading
9989
+ // state says "still trying" instead of sitting blank (the loader retries).
9990
+ const [treeLoadFailures, setTreeLoadFailures] = useState(0);
9950
9991
  const addressMode = useRef('push');
9951
9992
  const previousAddressPath = useRef(null);
9952
9993
  const [project, setProject] = useState('Design');
@@ -11984,6 +12025,7 @@ function App() {
11984
12025
  setProject(data.project || 'Design');
11985
12026
  setGroups(built);
11986
12027
  setTreeLoaded(true);
12028
+ setTreeLoadFailures(0);
11987
12029
  // DDR-093 — fold the server-resolved per-canvas DS map into cfg so
11988
12030
  // canvasUrl() injects each UI canvas's OWN design-system tokens instead of
11989
12031
  // always designSystems[0]. Functional merge to coexist with the /_config
@@ -11999,7 +12041,10 @@ function App() {
11999
12041
  canvasKinds: data.canvasKinds ?? {},
12000
12042
  }));
12001
12043
  },
12002
- onError: (error) => console.error('failed to load tree', error),
12044
+ onError: (error) => {
12045
+ console.error('failed to load tree', error);
12046
+ setTreeLoadFailures((n) => n + 1);
12047
+ },
12003
12048
  });
12004
12049
  treeLoaderRef.current = loader;
12005
12050
  loadTree();
@@ -15825,6 +15870,7 @@ function App() {
15825
15870
  onPreview={onPreview}
15826
15871
  onOpenLinkedFile={openLinkedFile}
15827
15872
  filesReady={treeLoaded}
15873
+ treeLoadFailures={treeLoadFailures}
15828
15874
  onShare={showShare}
15829
15875
  onOpenSystem={openSystem}
15830
15876
  wsConnected={wsConnected}
@@ -1569,6 +1569,22 @@ body.st-scrubbing, body.st-scrubbing * { cursor: ew-resize !important; user-sele
1569
1569
  .st-body.is-resizing iframe { pointer-events: none; }
1570
1570
  .st-sidebar.is-resizing, .st-rpanel.is-resizing { transition: none; }
1571
1571
 
1572
+ /* ─── File tree before its first index (TreeLoading) ───────────────────────── */
1573
+ .st-tree-loading {
1574
+ display: flex; flex-direction: column; gap: var(--space-2);
1575
+ padding: var(--space-3) var(--space-3) var(--space-4);
1576
+ }
1577
+ .st-tree-loading-head {
1578
+ display: flex; align-items: center; gap: var(--space-2);
1579
+ font-size: var(--type-sm); color: var(--fg-2);
1580
+ margin-bottom: var(--space-1);
1581
+ }
1582
+ .st-tree-loading-row { height: 10px; }
1583
+ .st-tree-loading-hint {
1584
+ margin-top: var(--space-2);
1585
+ font-size: var(--type-xs); line-height: 1.45; color: var(--fg-2);
1586
+ }
1587
+
1572
1588
  /* ─── Canvas-compile skeleton — DS skeletons recipe (.skel pulse) ──────────── */
1573
1589
  .st-canvas-loading {
1574
1590
  position: absolute; inset: 0;