@1agh/maude 2.0.3 → 2.0.4

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.
Files changed (143) hide show
  1. package/README.md +6 -5
  2. package/apps/studio/access/request.ts +0 -1
  3. package/apps/studio/acp/adapter-stderr.ts +43 -13
  4. package/apps/studio/acp/background-tasks.ts +155 -0
  5. package/apps/studio/acp/bridge.ts +44 -5
  6. package/apps/studio/acp/connected-fact.ts +15 -4
  7. package/apps/studio/acp/index.ts +14 -5
  8. package/apps/studio/actions/agents.ts +5 -0
  9. package/apps/studio/actions/defs/view.ts +12 -0
  10. package/apps/studio/actions.manifest.json +13 -1
  11. package/apps/studio/actions.parity.json +7 -1
  12. package/apps/studio/api.ts +31 -24
  13. package/apps/studio/bin/_png-playwright.mjs +10 -1
  14. package/apps/studio/bin/_pw-launch.mjs +14 -0
  15. package/apps/studio/bin/_thumbs-playwright.mjs +4 -1
  16. package/apps/studio/boot-progress.ts +31 -0
  17. package/apps/studio/canvas-build-sandbox.ts +275 -42
  18. package/apps/studio/canvas-build-worker.ts +10 -0
  19. package/apps/studio/canvas-create.ts +24 -0
  20. package/apps/studio/canvas-module-cache.ts +93 -0
  21. package/apps/studio/canvas-source/errors.ts +39 -0
  22. package/apps/studio/canvas-source/waiting.ts +290 -0
  23. package/apps/studio/client/actions/shell-key-handlers.js +5 -0
  24. package/apps/studio/client/app.jsx +19 -9
  25. package/apps/studio/client/github.js +23 -3
  26. package/apps/studio/client/home/home-api.js +30 -19
  27. package/apps/studio/client/hooks/use-git-actions.jsx +2 -1
  28. package/apps/studio/client/hooks/use-shell-core.jsx +3 -0
  29. package/apps/studio/client/hooks/use-tabs.jsx +64 -35
  30. package/apps/studio/client/index-loader.ts +23 -3
  31. package/apps/studio/client/panels/ChatPanel.jsx +22 -37
  32. package/apps/studio/client/panels/DiffView.jsx +314 -248
  33. package/apps/studio/client/panels/TeamProjects.jsx +119 -69
  34. package/apps/studio/client/panels/acp-runtime.js +25 -0
  35. package/apps/studio/client/panels/chat-finish.js +66 -0
  36. package/apps/studio/client/shell/frame-cap.js +53 -0
  37. package/apps/studio/client/shell/viewport.jsx +9 -0
  38. package/apps/studio/client/styles/_index.css +2 -0
  39. package/apps/studio/client/tree/tree.jsx +48 -21
  40. package/apps/studio/client/v2/ai/BackgroundStrip.jsx +120 -0
  41. package/apps/studio/client/v2/ai/StoppedDivider.jsx +2 -1
  42. package/apps/studio/client/v2/ai/ai-run.css +87 -3
  43. package/apps/studio/client/v2/ai/background-model.js +113 -0
  44. package/apps/studio/client/v2/ai/needs-you-store.js +2 -1
  45. package/apps/studio/client/v2/ai/run-api.js +7 -3
  46. package/apps/studio/client/v2/ai/runs-store.js +2 -1
  47. package/apps/studio/client/v2/annotations/vote-store.js +11 -5
  48. package/apps/studio/client/v2/assets/asset-state-lane.js +6 -3
  49. package/apps/studio/client/v2/assets/assets-bus.js +10 -8
  50. package/apps/studio/client/v2/assets/browse-view.jsx +2 -0
  51. package/apps/studio/client/v2/assets/ds-library-view.jsx +47 -0
  52. package/apps/studio/client/v2/assets/spotlight-model.js +75 -0
  53. package/apps/studio/client/v2/assets/spotlight.css +153 -0
  54. package/apps/studio/client/v2/assets/spotlight.jsx +199 -0
  55. package/apps/studio/client/v2/assets/tile-menu.jsx +3 -1
  56. package/apps/studio/client/v2/assets/tile.jsx +3 -0
  57. package/apps/studio/client/v2/assets/use-assets.js +2 -1
  58. package/apps/studio/client/v2/canvases/canvases-panel.jsx +13 -2
  59. package/apps/studio/client/v2/canvases/covers.js +11 -5
  60. package/apps/studio/client/v2/canvases/folder-ask.js +139 -0
  61. package/apps/studio/client/v2/canvases/folder-dialogs.jsx +150 -0
  62. package/apps/studio/client/v2/canvases/trash-canvas.js +10 -2
  63. package/apps/studio/client/v2/canvases/trash-queue.js +152 -0
  64. package/apps/studio/client/v2/canvases/use-canvas-index.js +42 -18
  65. package/apps/studio/client/v2/canvases/use-pins.js +2 -1
  66. package/apps/studio/client/v2/code/canvas-error-card.jsx +70 -5
  67. package/apps/studio/client/v2/code/canvas-waiting-card.jsx +128 -0
  68. package/apps/studio/client/v2/code/canvas-waiting.js +164 -0
  69. package/apps/studio/client/v2/code/code.css +67 -0
  70. package/apps/studio/client/v2/code/use-canvas-source.js +19 -4
  71. package/apps/studio/client/v2/create/NameDialog.jsx +4 -2
  72. package/apps/studio/client/v2/create/name-dialog.css +10 -0
  73. package/apps/studio/client/v2/ds/advanced-host.jsx +5 -2
  74. package/apps/studio/client/v2/ds/make-host.jsx +5 -2
  75. package/apps/studio/client/v2/ds/off-system-host.jsx +5 -2
  76. package/apps/studio/client/v2/ds/truth-host.jsx +5 -2
  77. package/apps/studio/client/v2/empty/arriving.jsx +29 -12
  78. package/apps/studio/client/v2/empty/empty-host.jsx +8 -2
  79. package/apps/studio/client/v2/empty/not-local.jsx +31 -1
  80. package/apps/studio/client/v2/empty/use-empty-canvas.js +10 -1
  81. package/apps/studio/client/v2/export/last-finished.js +2 -1
  82. package/apps/studio/client/v2/history/git-model.js +18 -4
  83. package/apps/studio/client/v2/history/git-parts.jsx +60 -42
  84. package/apps/studio/client/v2/history/history.css +6 -0
  85. package/apps/studio/client/v2/left-panel/assets-panel.jsx +87 -10
  86. package/apps/studio/client/v2/left-panel/use-trash.js +2 -1
  87. package/apps/studio/client/v2/onboarding/AdvancedSheets.jsx +100 -33
  88. package/apps/studio/client/v2/onboarding/HubSheet.jsx +51 -83
  89. package/apps/studio/client/v2/onboarding/onboarding-model.js +10 -6
  90. package/apps/studio/client/v2/present/order-notes-artboards.js +2 -1
  91. package/apps/studio/client/v2/search/search-recent.js +3 -1
  92. package/apps/studio/client/v2/search/search-remote.js +6 -4
  93. package/apps/studio/client/v2/settings/connections-model.js +1 -1
  94. package/apps/studio/client/v2/shell/menu-runner.js +1 -0
  95. package/apps/studio/client/v2/shell/occlusion-insets.js +14 -2
  96. package/apps/studio/client/v2/shell/recovery-store.js +2 -1
  97. package/apps/studio/client/v2/shell/served-routes.js +120 -0
  98. package/apps/studio/client/v2/shell/share-cluster-host.jsx +2 -1
  99. package/apps/studio/client/v2/shell/shell-activity.js +19 -0
  100. package/apps/studio/client/v2/shell/use-occluded-insets.js +3 -0
  101. package/apps/studio/client/v2/sync-states/conflict-card.jsx +7 -2
  102. package/apps/studio/client/v2/undo/use-undo-projection.jsx +3 -1
  103. package/apps/studio/cloud/endpoints.ts +23 -1
  104. package/apps/studio/dist/client.bundle.js +977 -981
  105. package/apps/studio/dist/styles.css +1 -1
  106. package/apps/studio/editing/minimap-context.tsx +3 -3
  107. package/apps/studio/editing/page-activity.ts +251 -0
  108. package/apps/studio/editing/rotate-handle.tsx +9 -5
  109. package/apps/studio/editing/sticky-name.tsx +4 -4
  110. package/apps/studio/history/restore-artboard-action.ts +40 -0
  111. package/apps/studio/home/hub.ts +77 -175
  112. package/apps/studio/home/routes.ts +47 -8
  113. package/apps/studio/http.ts +117 -66
  114. package/apps/studio/index-flight.ts +40 -0
  115. package/apps/studio/managed-projects.ts +52 -24
  116. package/apps/studio/migrate/hub.ts +7 -1
  117. package/apps/studio/routes/canvas-source.ts +44 -2
  118. package/apps/studio/routes/history.ts +28 -5
  119. package/apps/studio/routes/hub-signin.ts +115 -0
  120. package/apps/studio/routes/index.ts +4 -0
  121. package/apps/studio/routes/table.ts +7 -0
  122. package/apps/studio/routes/trash.ts +3 -0
  123. package/apps/studio/server.ts +11 -0
  124. package/apps/studio/sync/accepted-cold-start.ts +26 -3
  125. package/apps/studio/sync/accepted-link.ts +9 -4
  126. package/apps/studio/sync/code-module-consent.ts +74 -0
  127. package/apps/studio/sync/file-ledger.ts +35 -0
  128. package/apps/studio/sync/file-plane.ts +443 -77
  129. package/apps/studio/sync/hub-browser-signin.ts +377 -0
  130. package/apps/studio/sync/hub-text-undo.ts +30 -10
  131. package/apps/studio/sync/index.ts +73 -11
  132. package/apps/studio/sync/projection.ts +44 -2
  133. package/apps/studio/sync/pull-pacer.ts +160 -0
  134. package/apps/studio/sync/pull-priority.ts +119 -0
  135. package/apps/studio/sync/seed-progress.ts +47 -3
  136. package/apps/studio/sync/transaction-client.ts +71 -6
  137. package/apps/studio/sync/workspace-signin.ts +6 -256
  138. package/apps/studio/sync/writer-registry.ts +5 -1
  139. package/apps/studio/video-links-overlay.tsx +3 -2
  140. package/apps/studio/whats-new.json +54 -0
  141. package/cli/lib/design-help.gen.mjs +1 -1
  142. package/cli/lib/workspace-plan.mjs +14 -0
  143. package/package.json +8 -8
@@ -0,0 +1,75 @@
1
+ // client/v2/assets/spotlight-model.js — the pure half of the asset spotlight (2.0.4, issue #191).
2
+ //
3
+ // A double-click on an Assets tile opens its picture, clip or sound large. Which tiles ← → walks, what the window says
4
+ // about the file and which rows it offers are decided here; the window itself is spotlight.jsx.
5
+
6
+ import { GROUP_CAP } from './library-foot.js';
7
+ import { sizeWords } from './tile.jsx';
8
+
9
+ /** The words the window uses (CONTRACT §3/§4: what happened · what is safe · one verb). */
10
+ export const SPOTLIGHT_WORDS = {
11
+ close: 'Close',
12
+ previous: 'Previous',
13
+ next: 'Next',
14
+ /** why an arrow is off at the ends (dead-controls: a disabled control says why) */
15
+ atFirst: 'This is the first file.',
16
+ atLast: 'This is the last file.',
17
+ noPreview: 'This file has no preview.',
18
+ failed: 'This picture could not be shown.',
19
+ /** "3 of 12" — a screen reader hears it as the position. */
20
+ position: (i, n) => `${i + 1} of ${n}`,
21
+ /** the dialog's name for a screen reader when the file has none */
22
+ fallbackName: 'Asset',
23
+ };
24
+
25
+ /** @returns {'image' | 'video' | 'audio' | 'file'} how the window draws it */
26
+ export function previewKind(asset) {
27
+ const k = asset?.kind;
28
+ return k === 'image' || k === 'video' || k === 'audio' ? k : 'file';
29
+ }
30
+
31
+ /** Step `delta` along a list of `n`: stops at the ends (the arrows disable there), never wraps. */
32
+ export function stepIndex(index, delta, n) {
33
+ if (!(n > 0)) return -1;
34
+ const to = index + delta;
35
+ return to < 0 || to >= n ? index : to;
36
+ }
37
+
38
+ /** The file's own folder + name, with no leading slash ("assets/9f2a.jpg"; a design-system file is "…/system/club/…"). */
39
+ export function pathWords(asset) {
40
+ return String(asset?.rel || asset?.path || '').replace(/^\/+/, '');
41
+ }
42
+
43
+ /** One line under the picture: its size ("2.3 MB"), or nothing when the studio did not say. */
44
+ export function sizeLine(asset) {
45
+ return Number(asset?.size) > 0 ? sizeWords(asset.size) : '';
46
+ }
47
+
48
+ /**
49
+ * The rows the tile already offers (tile-menu.jsx `tileMenuItems`) that fit a window over the picture. Move to trash is
50
+ * left in the menu: a bigger look is not the place to remove a file.
51
+ */
52
+ export function spotlightRows(menuItems) {
53
+ return (menuItems || []).filter((it) => !it.separator && it.id !== 'trash');
54
+ }
55
+
56
+ /**
57
+ * Which tiles of a group the narrow tab draws: all of them for Just added, Generated and a search, the first `GROUP_CAP`
58
+ * for a plain Photos / Video / Sound group — unless the Not used view lists everything to tidy.
59
+ */
60
+ export function groupShown(group, { uncapped = false } = {}) {
61
+ if (group.kind === 'added' || group.kind === 'generated' || group.kind === 'found' || uncapped)
62
+ return group.items;
63
+ return group.items.slice(0, GROUP_CAP);
64
+ }
65
+
66
+ /** The paths ← → walks in the narrow tab, in the order the tab draws them (the "Seen in the picture" group first). */
67
+ export function narrowOrder(groups, seen, { uncapped = false } = {}) {
68
+ const out = [];
69
+ const take = (p) => {
70
+ if (!out.includes(p)) out.push(p);
71
+ };
72
+ for (const s of seen || []) take(s.asset.path);
73
+ for (const g of groups || []) for (const a of groupShown(g, { uncapped })) take(a.path);
74
+ return out;
75
+ }
@@ -0,0 +1,153 @@
1
+ /* client/v2/assets/spotlight.css — 2.0.4 (issue #191): an Assets tile, large (spotlight.jsx). Tokens only.
2
+ * Sits above the app like the shared dialogs (.gi-modal, z 9600): a scrim, then one window with the picture fitted to it. */
3
+
4
+ @layer shell {
5
+ .v2-spot {
6
+ position: fixed;
7
+ inset: 0;
8
+ z-index: 9600;
9
+ display: grid;
10
+ place-items: center;
11
+ padding: var(--space-5);
12
+ }
13
+ .v2-spot-scrim {
14
+ position: fixed;
15
+ inset: 0;
16
+ background: color-mix(in oklab, var(--bg-0) 78%, transparent);
17
+ }
18
+ .v2-spot-dialog {
19
+ position: relative;
20
+ display: flex;
21
+ flex-direction: column;
22
+ width: min(1100px, 100%);
23
+ height: min(820px, 100%);
24
+ min-height: 0;
25
+ overflow: hidden;
26
+ background: var(--bg-2);
27
+ border-radius: var(--radius-xl);
28
+ box-shadow:
29
+ var(--shadow-lg),
30
+ inset 0 0 0 0.5px var(--island-edge);
31
+ animation: v2-spot-in var(--dur-route) var(--ease-out);
32
+ }
33
+ .v2-spot-dialog:focus {
34
+ outline: none;
35
+ }
36
+ @keyframes v2-spot-in {
37
+ from {
38
+ opacity: 0;
39
+ scale: 0.98;
40
+ }
41
+ }
42
+ .v2-spot-head {
43
+ flex: none;
44
+ display: flex;
45
+ align-items: center;
46
+ gap: var(--space-2);
47
+ padding: var(--space-2) var(--space-3);
48
+ }
49
+ .v2-spot-title {
50
+ flex: 1;
51
+ min-width: 0;
52
+ margin: 0;
53
+ overflow: hidden;
54
+ text-overflow: ellipsis;
55
+ white-space: nowrap;
56
+ font-size: var(--type-md);
57
+ font-weight: var(--w-medium);
58
+ color: var(--fg-0);
59
+ }
60
+ .v2-spot-pos {
61
+ flex: none;
62
+ font-size: var(--type-xs);
63
+ color: var(--fg-2);
64
+ }
65
+ .v2-spot-stage {
66
+ flex: 1;
67
+ min-height: 0;
68
+ display: flex;
69
+ align-items: center;
70
+ justify-content: center;
71
+ gap: var(--space-2);
72
+ padding: 0 var(--space-3);
73
+ background: var(--bg-1);
74
+ }
75
+ .v2-spot-img,
76
+ .v2-spot-video {
77
+ flex: 0 1 auto;
78
+ min-width: 0;
79
+ min-height: 0;
80
+ max-width: 100%;
81
+ max-height: 100%;
82
+ object-fit: contain;
83
+ border-radius: var(--radius-sm);
84
+ }
85
+ .v2-spot-sound,
86
+ .v2-spot-file {
87
+ display: flex;
88
+ flex-direction: column;
89
+ align-items: center;
90
+ gap: var(--space-2);
91
+ max-width: 100%;
92
+ color: var(--fg-1);
93
+ text-align: center;
94
+ }
95
+ .v2-spot-file-n {
96
+ margin: 0;
97
+ max-width: 100%;
98
+ overflow-wrap: anywhere;
99
+ font-size: var(--type-md);
100
+ font-weight: var(--w-medium);
101
+ color: var(--fg-0);
102
+ }
103
+ .v2-spot-file-s {
104
+ margin: 0;
105
+ font-size: var(--type-sm);
106
+ color: var(--fg-2);
107
+ }
108
+ .v2-spot-nav {
109
+ flex: none;
110
+ }
111
+ .v2-spot-nav--prev svg {
112
+ rotate: 180deg;
113
+ }
114
+ .v2-spot-nav:disabled {
115
+ opacity: 0.35;
116
+ }
117
+ .v2-spot-foot {
118
+ flex: none;
119
+ display: flex;
120
+ align-items: center;
121
+ flex-wrap: wrap;
122
+ gap: var(--space-2) var(--space-3);
123
+ padding: var(--space-2) var(--space-3);
124
+ }
125
+ .v2-spot-meta {
126
+ flex: 1;
127
+ min-width: 0;
128
+ margin: 0;
129
+ display: flex;
130
+ gap: var(--space-2);
131
+ font-size: var(--type-xs);
132
+ color: var(--fg-2);
133
+ }
134
+ .v2-spot-path {
135
+ min-width: 0;
136
+ overflow: hidden;
137
+ text-overflow: ellipsis;
138
+ white-space: nowrap;
139
+ }
140
+ .v2-spot-size {
141
+ flex: none;
142
+ }
143
+ .v2-spot-rows {
144
+ display: inline-flex;
145
+ gap: var(--space-2);
146
+ }
147
+ }
148
+
149
+ @media (prefers-reduced-motion: reduce) {
150
+ .v2-spot-dialog {
151
+ animation-duration: 1ms;
152
+ }
153
+ }
@@ -0,0 +1,199 @@
1
+ // client/v2/assets/spotlight.jsx — an Assets tile, large (2.0.4, issue #191; decision v2-204-asset-spotlight).
2
+ //
3
+ // A double-click on a tile (or Space on the picked one — the registry action `assets.spotlight`) opens its picture, clip or
4
+ // sound over the app. A picture fits the window, a clip plays with its controls, a sound plays too; anything else says its
5
+ // name and size. Under it: the file's name, path and size, and the rows the tile already offers. ← → walk the tiles the tab
6
+ // shows, esc or a click outside closes, and focus goes back to the tile. The window is modal: Tab stays inside it.
7
+ //
8
+ // `AssetSpotlight` is the pure render over the panel's state (spotlight-model.js holds the words and the order).
9
+
10
+ import { useId, useState } from 'react';
11
+ import { Kbd, StIcon } from '../../shell/icons.jsx';
12
+ import { portalToBody } from '../portal-scope.jsx';
13
+ import { useModalFocus } from '../shell/modal-focus.js';
14
+ import {
15
+ pathWords,
16
+ previewKind,
17
+ SPOTLIGHT_WORDS as W,
18
+ sizeLine,
19
+ stepIndex,
20
+ } from './spotlight-model.js';
21
+
22
+ /** The media for one asset. Keyed by path by the caller, so a step remounts it (a clip starts from its first frame). */
23
+ function Stage({ asset, url }) {
24
+ const kind = previewKind(asset);
25
+ const [broken, setBroken] = useState(false);
26
+ if (kind === 'image' && !broken)
27
+ return (
28
+ <img
29
+ className="v2-spot-img"
30
+ data-testid="spotlight-image"
31
+ src={url}
32
+ alt={asset.name}
33
+ draggable={false}
34
+ onError={() => setBroken(true)}
35
+ />
36
+ );
37
+ if (kind === 'video' && !broken)
38
+ return (
39
+ // biome-ignore lint/a11y/useMediaCaption: the person's own footage; captions are a sidecar of the clip, not of the library
40
+ <video
41
+ className="v2-spot-video"
42
+ data-testid="spotlight-video"
43
+ src={url}
44
+ controls
45
+ playsInline
46
+ preload="metadata"
47
+ onError={() => setBroken(true)}
48
+ />
49
+ );
50
+ if (kind === 'audio' && !broken)
51
+ return (
52
+ <div className="v2-spot-sound" data-testid="spotlight-sound">
53
+ <StIcon name="resolve" size={28} />
54
+ {/* biome-ignore lint/a11y/useMediaCaption: a sound has no captions to show */}
55
+ <audio src={url} controls preload="metadata" onError={() => setBroken(true)} />
56
+ </div>
57
+ );
58
+ // a font, or any file the window cannot draw: what it is, so the person knows it is the right one
59
+ return (
60
+ <div className="v2-spot-file" data-testid="spotlight-file">
61
+ <StIcon name="image" size={28} />
62
+ <p className="v2-spot-file-n">{asset.name}</p>
63
+ {sizeLine(asset) ? <p className="v2-spot-file-s">{sizeLine(asset)}</p> : null}
64
+ <p className="v2-spot-file-s">{broken ? W.failed : W.noPreview}</p>
65
+ </div>
66
+ );
67
+ }
68
+
69
+ /**
70
+ * @param {object} p
71
+ * @param {Array<{ path: string, name: string, kind: string, size?: number }>} p.items the tiles ← → walks, in the tab's order
72
+ * @param {number} p.index which one is showing
73
+ * @param {(path: string) => string} p.urlOf the SAME address the tile draws (main origin, read-only)
74
+ * @param {Array<{ id: string, label: string, keys?: string }>} [p.rows] the tile's own actions
75
+ * @param {(index: number) => void} p.onIndex
76
+ * @param {() => void} p.onClose esc, the close button and a click outside
77
+ * @param {(id: string) => void} [p.onRow]
78
+ */
79
+ export function AssetSpotlight({ items, index, urlOf, rows = [], onIndex, onClose, onRow }) {
80
+ const titleId = useId();
81
+ const ref = useModalFocus({ onClose });
82
+ const asset = items[index];
83
+ if (!asset) return null;
84
+ const n = items.length;
85
+ const step = (delta) => {
86
+ const to = stepIndex(index, delta, n);
87
+ if (to !== index) onIndex(to);
88
+ };
89
+ const onKeyDown = (e) => {
90
+ if (e.defaultPrevented || e.metaKey || e.ctrlKey || e.altKey) return;
91
+ // a focused clip or sound keeps its own arrows (seek); everything else steps
92
+ if (e.target?.closest?.('video, audio, input, select, textarea')) return;
93
+ if (e.key === 'ArrowRight' || e.key === 'ArrowLeft') {
94
+ e.preventDefault();
95
+ e.stopPropagation();
96
+ step(e.key === 'ArrowRight' ? 1 : -1);
97
+ }
98
+ };
99
+ const path = pathWords(asset);
100
+ const size = sizeLine(asset);
101
+ return portalToBody(
102
+ <div className="v2-spot" data-testid="asset-spotlight" data-asset={asset.path}>
103
+ <div
104
+ className="v2-spot-scrim"
105
+ data-testid="spotlight-scrim"
106
+ aria-hidden="true"
107
+ onClick={onClose}
108
+ />
109
+ <div
110
+ ref={ref}
111
+ className="v2-spot-dialog"
112
+ role="dialog"
113
+ aria-modal="true"
114
+ aria-labelledby={titleId}
115
+ tabIndex={-1}
116
+ onKeyDown={onKeyDown}
117
+ >
118
+ <header className="v2-spot-head">
119
+ <h2 id={titleId} className="v2-spot-title" data-testid="spotlight-title">
120
+ {asset.name || W.fallbackName}
121
+ </h2>
122
+ <span className="v2-spot-pos" role="status" data-testid="spotlight-position">
123
+ {n > 1 ? W.position(index, n) : ''}
124
+ </span>
125
+ <button
126
+ type="button"
127
+ className="sh-iconbtn"
128
+ data-testid="spotlight-close"
129
+ aria-label={W.close}
130
+ onClick={onClose}
131
+ >
132
+ <StIcon name="x" size={14} />
133
+ </button>
134
+ </header>
135
+ {/* biome-ignore lint/a11y/noStaticElementInteractions lint/a11y/useKeyWithClickEvents: a click on the empty space is a pointer door; esc and the close button are the keyboard's */}
136
+ <div
137
+ className="v2-spot-stage"
138
+ data-testid="spotlight-stage"
139
+ onClick={(e) => {
140
+ // the empty space around the picture is "outside" too
141
+ if (e.target === e.currentTarget) onClose();
142
+ }}
143
+ >
144
+ <button
145
+ type="button"
146
+ className="sh-iconbtn v2-spot-nav v2-spot-nav--prev"
147
+ data-testid="spotlight-prev"
148
+ aria-label={W.previous}
149
+ disabled={index <= 0}
150
+ title={index <= 0 ? W.atFirst : undefined}
151
+ onClick={() => step(-1)}
152
+ >
153
+ <StIcon name="chevron-right" size={16} />
154
+ </button>
155
+ <Stage key={asset.path} asset={asset} url={urlOf(asset.path)} />
156
+ <button
157
+ type="button"
158
+ className="sh-iconbtn v2-spot-nav"
159
+ data-testid="spotlight-next"
160
+ aria-label={W.next}
161
+ disabled={index >= n - 1}
162
+ title={index >= n - 1 ? W.atLast : undefined}
163
+ onClick={() => step(1)}
164
+ >
165
+ <StIcon name="chevron-right" size={16} />
166
+ </button>
167
+ </div>
168
+ <footer className="v2-spot-foot">
169
+ <p className="v2-spot-meta" data-testid="spotlight-meta">
170
+ <span className="v2-spot-path" data-testid="spotlight-path">
171
+ {path}
172
+ </span>
173
+ {size ? (
174
+ <span className="v2-spot-size" data-testid="spotlight-size">
175
+ {size}
176
+ </span>
177
+ ) : null}
178
+ </p>
179
+ {rows.length ? (
180
+ <span className="v2-spot-rows">
181
+ {rows.map((r) => (
182
+ <button
183
+ key={r.id}
184
+ type="button"
185
+ className="btn btn--sm"
186
+ data-testid={`spotlight-row-${r.id}`}
187
+ onClick={() => onRow?.(r.id)}
188
+ >
189
+ {r.label}
190
+ {r.keys ? <Kbd>{r.keys}</Kbd> : null}
191
+ </button>
192
+ ))}
193
+ </span>
194
+ ) : null}
195
+ </footer>
196
+ </div>
197
+ </div>
198
+ );
199
+ }
@@ -1,6 +1,6 @@
1
1
  // client/v2/assets/tile-menu.jsx — the menu a right-click on a tile opens (S8.12; 12 · ia-assets-keys).
2
2
  //
3
- // "Place in MVP zápasu ↵", "Show details ⌘I", "Copy ⌘C" and Move to trash — the same actions the keys run (`assets.place`, `assets.details`,
3
+ // "Place in MVP zápasu ↵", "View larger Space", "Show details ⌘I", "Copy ⌘C" and Move to trash — the same actions the keys run (`assets.place`, `assets.details`,
4
4
  // through assets-bus.js), so the menu, ↵ and ⌘I are one code path. A viewer is offered Show details only; sound and video
5
5
  // are not placed from here (a clip goes on a video artboard's timeline). Reached by the right-click, the keyboard
6
6
  // (↑ ↓ walk, esc closes). Move to trash (S8.13) is an editor's: the studio takes the picture and its sidecars together.
@@ -23,6 +23,8 @@ export function tileMenuItems(asset, { readOnly = false, placeLabel = null, coun
23
23
  label: placeLabel ? `Place in ${placeLabel}` : 'Place',
24
24
  keys: '↵',
25
25
  });
26
+ // 2.0.4 (#191) — View larger (`assets.spotlight`): the same window a double-click opens; a read, so every role has it
27
+ items.push({ id: 'spotlight', label: 'View larger', keys: 'Space' });
26
28
  items.push({ id: 'details', label: 'Show details', keys: '⌘I' });
27
29
  // P8 round 7 (12 · ia-assets-keys) — Rename… (`assets.rename`): an editor's, one picture at a time
28
30
  if (!readOnly && count <= 1) items.push({ id: 'rename', label: 'Rename…' });
@@ -40,6 +40,8 @@ export function AssetTile({
40
40
  canDrag,
41
41
  onPick,
42
42
  onMenu,
43
+ // 2.0.4 (#191) — a double-click opens the tile large (spotlight.jsx); a tile with no `onOpen` ignores it
44
+ onOpen = undefined,
43
45
  caption = false,
44
46
  uploading = null,
45
47
  // 12 · ia-assets-find — the name (or tag) a search matched, on a gradient foot
@@ -62,6 +64,7 @@ export function AssetTile({
62
64
  uploading ? `${tileLabel(asset)}. ${uploadWords(asset.name, uploading)}` : tileLabel(asset)
63
65
  }
64
66
  onClick={(e) => onPick(asset.path, e)}
67
+ onDoubleClick={onOpen ? (e) => onOpen(asset.path, e) : undefined}
65
68
  onContextMenu={(e) => {
66
69
  onPick(asset.path, e, true);
67
70
  onMenu(e, asset);
@@ -7,6 +7,7 @@
7
7
 
8
8
  import { useCallback, useEffect, useRef, useState } from 'react';
9
9
  import { INDEX_CHANGED_EVENT } from '../canvases/use-canvas-index.js';
10
+ import { fetchIfServed } from '../shell/served-routes.js';
10
11
 
11
12
  const KINDS = new Set(['image', 'video', 'audio']);
12
13
 
@@ -70,7 +71,7 @@ export function usageWords(row) {
70
71
 
71
72
  async function readRows(get) {
72
73
  try {
73
- const r = await get('/_api/index?part=assets', { cache: 'no-store' });
74
+ const r = await fetchIfServed('/_api/index?part=assets', { cache: 'no-store' }, get);
74
75
  if (r.ok) {
75
76
  const j = await r.json();
76
77
  if (Array.isArray(j?.assets))
@@ -58,6 +58,7 @@ import { askForCovers } from './covers.js';
58
58
  import { siblingNames } from './rename-model.js';
59
59
  import { useRowSlots } from './row-slots.js';
60
60
  import { supportIcon, supportIndex } from './support-model.js';
61
+ import { useTrashGone, withoutGone } from './trash-queue.js';
61
62
  import { canvasMenuItems, CanvasRowMenu } from './row-menu.jsx';
62
63
  import { leftOutOf } from '../ds/update-model.js';
63
64
  import { SORT_BYS, SORT_LABELS, KIND_NOTE, sortControl } from './sort.js';
@@ -148,9 +149,19 @@ export function CanvasesPanel({
148
149
  }, []);
149
150
  // S11.9 — Canvases › Advanced › Show file names: each canvas row grows a second mono line
150
151
  const [showFileNames] = useViewPref(VIEW_PREF_KEYS.fileNames);
152
+ // #194 — a canvas the server has moved to the trash leaves the list at once, before the index re-reads
153
+ const trashGone = useTrashGone();
154
+ const listedGroups = useMemo(() => withoutGone(groups, trashGone), [groups, trashGone]);
151
155
  const tree = useMemo(
152
- () => buildTree({ groups, meta, designRel, opened: pins.opened, ghosts: slots.ghosts }),
153
- [groups, meta, designRel, pins.opened, slots.ghosts]
156
+ () =>
157
+ buildTree({
158
+ groups: listedGroups,
159
+ meta,
160
+ designRel,
161
+ opened: pins.opened,
162
+ ghosts: slots.ghosts,
163
+ }),
164
+ [listedGroups, meta, designRel, pins.opened, slots.ghosts]
154
165
  );
155
166
  const isOpen = expansion?.isOpen;
156
167
  // S7.24 — the kind filter chips (one filter for Canvases and Layers, kind-filter-store.js). Counts are over
@@ -4,6 +4,8 @@
4
4
  // the service queues every canvas's cover at background priority (never in front of a visible request) and
5
5
  // each finished one reaches the rows through the index (`index-changed`), so the pictures arrive one by one.
6
6
 
7
+ import { fetchIfServed } from '../shell/served-routes.js';
8
+
7
9
  let asked = false;
8
10
 
9
11
  /** POST /_api/thumbs/want { keys: [], background: true } — at most once per page load; a refusal is silent. */
@@ -14,11 +16,15 @@ export function askForCovers(fetchImpl) {
14
16
  if (typeof f !== 'function') return false;
15
17
  try {
16
18
  Promise.resolve(
17
- f('/_api/thumbs/want', {
18
- method: 'POST',
19
- headers: { 'content-type': 'application/json' },
20
- body: JSON.stringify({ keys: [], background: true }),
21
- })
19
+ fetchIfServed(
20
+ '/_api/thumbs/want',
21
+ {
22
+ method: 'POST',
23
+ headers: { 'content-type': 'application/json' },
24
+ body: JSON.stringify({ keys: [], background: true }),
25
+ },
26
+ f
27
+ )
22
28
  ).catch(() => {});
23
29
  } catch {
24
30
  /* no network, no pictures — the rows keep their small page */
@@ -0,0 +1,139 @@
1
+ // client/v2/canvases/folder-ask.js — #195 (2.0.4): what the tree's folder and file rows ask, and the words a
2
+ // refusal says.
3
+ //
4
+ // The report: "I can't add or rename folder" (desktop). The folder row's menu asked with `window.prompt`, and
5
+ // Tauri's WKWebView does not implement it — it returns null at once, so "New folder here" and "Rename folder"
6
+ // did nothing at all (and "Delete folder"'s `window.confirm` answered "no" the same way). Every one of them now
7
+ // asks in the shell's own centered dialog (`NameDialog`, the one "New canvas" uses), and a refusal is said
8
+ // under the field in plain words instead of failing silently.
9
+ //
10
+ // Pure: the dialog's words per ask, the client-side name check (the same rule as the server's — rename-model),
11
+ // and the line a failed request shows.
12
+
13
+ import { checkRename } from './rename-model.js';
14
+
15
+ /** CONTRACT §4: a dialog's title asks with the verb its primary button uses; the other button is Cancel. */
16
+ export const FOLDER_ASK_WORDS = Object.freeze({
17
+ /** a Can view / Can comment session, or a request the server refused for its role (403) */
18
+ role: 'Folders need Can edit. Ask a project owner for edit access.',
19
+ filesRole: 'Changing files needs Can edit. Ask a project owner for edit access.',
20
+ failed: {
21
+ 'new-folder': 'Could not make the folder. Nothing was changed. Try again.',
22
+ 'rename-folder': 'Could not rename the folder. Nothing was changed. Try again.',
23
+ 'trash-folder': 'Could not move the folder to the trash. Nothing was changed. Try again.',
24
+ 'rename-canvas': 'Could not rename. Nothing was changed. Try again.',
25
+ 'rename-file': 'Could not rename. Nothing was changed. Try again.',
26
+ 'trash-file': 'Could not move it to the trash. Nothing was changed. Try again.',
27
+ },
28
+ noGroup: 'There is no canvas folder to put a new folder in yet. Make a canvas first.',
29
+ });
30
+
31
+ const folderName = (p) =>
32
+ String(p || '')
33
+ .replace(/\/+$/, '')
34
+ .split('/')
35
+ .pop() || '';
36
+
37
+ /**
38
+ * The words of one ask. `ask` = { kind, path, name? }:
39
+ * new-folder path = the parent folder → Create folder in “<parent>”
40
+ * rename-folder path = the folder → Rename folder “<name>”
41
+ * rename-canvas path = the canvas, name = its name → Rename canvas
42
+ * rename-file path = the file, name = file name → Rename “<file>” (the extension stays)
43
+ * trash-folder path = the folder → Move “<name>” to the trash?
44
+ * trash-file path = the file, name = file name → Move “<file>” to the trash?
45
+ */
46
+ export function folderAskWords(ask) {
47
+ const name = ask?.name ?? folderName(ask?.path);
48
+ switch (ask?.kind) {
49
+ case 'new-folder':
50
+ return {
51
+ title: `Create folder in “${folderName(ask.path)}”`,
52
+ label: 'Folder name',
53
+ initial: 'Untitled folder',
54
+ confirm: 'Create',
55
+ busy: 'Creating…',
56
+ };
57
+ case 'rename-folder':
58
+ return {
59
+ title: `Rename folder “${name}”`,
60
+ label: 'Folder name',
61
+ initial: name,
62
+ confirm: 'Rename',
63
+ busy: 'Renaming…',
64
+ };
65
+ case 'rename-canvas':
66
+ return {
67
+ title: `Rename canvas “${name}”`,
68
+ label: 'Canvas name',
69
+ initial: name,
70
+ confirm: 'Rename',
71
+ busy: 'Renaming…',
72
+ };
73
+ case 'rename-file': {
74
+ const ext = name.includes('.') ? name.slice(name.lastIndexOf('.')) : '';
75
+ return {
76
+ title: `Rename “${name}”`,
77
+ label: ext ? `Name (stays ${ext})` : 'Name',
78
+ initial: ext ? name.slice(0, -ext.length) : name,
79
+ confirm: 'Rename',
80
+ busy: 'Renaming…',
81
+ };
82
+ }
83
+ case 'trash-folder':
84
+ return {
85
+ title: `Move “${name}” to the trash?`,
86
+ body: 'Every canvas inside moves to the trash, where you can bring it back. Empty folders inside are removed.',
87
+ confirm: 'Move to trash',
88
+ busy: 'Moving…',
89
+ };
90
+ case 'trash-file':
91
+ return {
92
+ title: `Move “${name}” to the trash?`,
93
+ body: 'You can bring it back from the Trash.',
94
+ confirm: 'Move to trash',
95
+ busy: 'Moving…',
96
+ };
97
+ default:
98
+ return null;
99
+ }
100
+ }
101
+
102
+ /** True for the asks that take a name (a NameDialog), false for the yes/no ones. */
103
+ export const asksForName = (ask) =>
104
+ ask?.kind === 'new-folder' ||
105
+ ask?.kind === 'rename-folder' ||
106
+ ask?.kind === 'rename-canvas' ||
107
+ ask?.kind === 'rename-file';
108
+
109
+ /**
110
+ * The typed name before anything is sent: the same rule the server holds (letters, numbers, spaces, - and _;
111
+ * not starting with _; 60 characters), so a refused name is said at once, with the suggestion.
112
+ * @returns {{ kind: 'keep' } | { kind: 'error', error: string } | { kind: 'send', name: string }}
113
+ */
114
+ export function checkAskName(ask, draft) {
115
+ const words = folderAskWords(ask);
116
+ const current = ask?.kind === 'new-folder' ? '' : (words?.initial ?? '');
117
+ const v = checkRename({ draft, current });
118
+ if (v.kind === 'rename') return { kind: 'send', name: v.name };
119
+ return v.kind === 'error' ? { kind: 'error', error: v.error } : { kind: 'keep' };
120
+ }
121
+
122
+ /**
123
+ * The line a failed folder/file request shows under the field (or in the yes/no dialog).
124
+ * `res` = { ok: false, status?, error?, network? } from the shell's request functions (use-tabs.jsx).
125
+ * The server's own words come back as they are (they are plain since #195 — canvas-create.ts FOLDER_WORDS,
126
+ * NAME_RULE); a role refusal, a lost connection or a bare status gets one plain sentence instead.
127
+ */
128
+ export function askFailure(kind, res) {
129
+ const fallback = FOLDER_ASK_WORDS.failed[kind] ?? FOLDER_ASK_WORDS.failed['new-folder'];
130
+ if (res?.status === 403)
131
+ return kind.endsWith('-file') || kind === 'rename-canvas'
132
+ ? FOLDER_ASK_WORDS.filesRole
133
+ : FOLDER_ASK_WORDS.role;
134
+ if (res?.network) return fallback;
135
+ const error = typeof res?.error === 'string' ? res.error.trim() : '';
136
+ // a bare status ("error 500"), or a lower-case developer string from an older server, is not for people
137
+ if (!error || /^error \d+$/.test(error) || /^[a-z"]/.test(error)) return fallback;
138
+ return error;
139
+ }