@floless/app 0.124.0 → 0.125.0

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/dist/web/app.css CHANGED
@@ -536,13 +536,17 @@
536
536
  .onb-foot { font-size: 12px; color: var(--text-muted); margin-top: 16px; line-height: 1.5; }
537
537
  /* Quiet secondary first-run action — an inline text button, NOT a second filled
538
538
  button, so "Start the guided tour" stays the dominant primary. Existing tokens only. */
539
- .onb-build-btn {
539
+ /* .ws-empty-tour-btn (the Workspaces first-run tour link, #598) rides on this selector rather than
540
+ copying its declarations: it is the same tier — a quiet inline text action that must stay
541
+ subordinate to a nearby primary — and one rule is what stops the two drifting apart. */
542
+ .onb-build-btn, .ws-empty-tour-btn {
540
543
  background: none; border: none; padding: 0; cursor: pointer;
541
544
  font-family: var(--ui); font-size: 12px; font-weight: 600; color: var(--accent);
542
545
  letter-spacing: 0.01em;
543
546
  }
544
- .onb-build-btn:hover { color: var(--accent-bright); text-decoration: underline; }
545
- .onb-build-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
547
+ .onb-build-btn:hover, .ws-empty-tour-btn:hover { color: var(--accent-bright); text-decoration: underline; }
548
+ .onb-build-btn:focus-visible, .ws-empty-tour-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
549
+ .onb-build-btn:disabled, .ws-empty-tour-btn:disabled { cursor: default; text-decoration: none; }
546
550
  /* "Start the guided tour" — the primary first-run action (copies the onboarding launch prompt).
547
551
  Accent-soft region + filled-accent button mirror the .agent-card.selected / #run-btn primary
548
552
  tier; all tokens existing (locked baseline — no new fonts/colors). */
@@ -550,7 +554,27 @@
550
554
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
551
555
  margin-top: 14px; padding: 11px 14px;
552
556
  background: var(--accent-soft); border: 1px solid var(--accent-dim); border-radius: 6px;
553
- }
557
+ /* Lets .onb-tour-manual take its own row when the clipboard was refused. It also lets the hint and
558
+ button stack once the row is too narrow for both, which the old nowrap squeezed instead. */
559
+ flex-wrap: wrap;
560
+ }
561
+ /* The clipboard-refused fallback: the prompt itself, on screen and selectable, because the message
562
+ tells the user to copy it manually and nothing else on either surface holds it. Themed like the
563
+ app's other read-only technical values (mono on surface-2) — never a native white control, and
564
+ with its own scrollbar themed because a textarea is a scroll container too. */
565
+ .onb-tour-manual {
566
+ display: block; width: 100%; flex-basis: 100%; margin-top: 10px; box-sizing: border-box;
567
+ background: var(--surface-2); border: 1px solid var(--border-strong); border-radius: 4px;
568
+ color: var(--text); font-family: var(--mono); font-size: 11px; line-height: 1.5; padding: 7px 9px;
569
+ /* resize:vertical, not none: two rows fits the prompt with very little margin, and a font
570
+ fallback or a user minimum-font-size pushes it to a third — which would otherwise scroll behind
571
+ a scrollbar with no way to open the box up. */
572
+ resize: vertical; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
573
+ }
574
+ .onb-tour-manual::-webkit-scrollbar { width: 9px; }
575
+ .onb-tour-manual::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 9px; }
576
+ .onb-tour-manual::-webkit-scrollbar-track { background: transparent; }
577
+ .onb-tour-manual:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
554
578
  .onb-tour-hint { flex: 1; font-size: 11px; color: var(--text-dim); font-style: italic; line-height: 1.45; }
555
579
  .onb-tour-btn {
556
580
  flex: none; background: var(--accent); color: #ffffff; border: 1px solid var(--accent);
@@ -1760,8 +1784,40 @@
1760
1784
  #tooltip[hidden] { display: none; }
1761
1785
 
1762
1786
  /* ========== REQUESTS WINDOW ========== */
1763
- .modal.requests { width: 580px; max-width: 92vw; }
1764
- .requests-list { display: flex; flex-direction: column; gap: 8px; max-height: 52vh; overflow-y: auto; margin: 4px 0 2px; }
1787
+ /* Column layout with a viewport cap, mirroring #form-modal (#125): .modal declares no
1788
+ max-height and .modal-backdrop centres without overflow, so an over-tall modal is clipped at
1789
+ the TOP and its title becomes unreachable. The scope row + search box added ~90px of FIXED
1790
+ chrome above the list, which moves that threshold up by exactly that much — the list has to
1791
+ flex against the cap instead of carrying its own 52vh. */
1792
+ .modal.requests { width: 580px; max-width: 92vw; max-height: 86vh; display: flex; flex-direction: column; }
1793
+ /* Scope filter — the shared .tabs underline language, minus the uppercasing: this tab is
1794
+ labelled with a REAL name (an app id like `steel-model`, a project like "Cedar Mill
1795
+ Warehouse"), and uppercasing those misreads them. Long names ellipsize; the full name
1796
+ is on the tab's data-tip. */
1797
+ .req-scope { margin: 2px 0 12px; }
1798
+ /* `hidden` is a no-op without this. The UA's [hidden]{display:none} loses to .tabs{display:flex}
1799
+ on specificity, so `$scope.hidden = true` left the row on screen showing its UNRENDERED
1800
+ markup — a blank first tab and the literal "All" placeholder from index.html — whenever there
1801
+ was no scope to name (the Workspaces landing, or no workflow open). */
1802
+ .req-scope[hidden] { display: none; }
1803
+ /* The tab is a flex row, NOT one ellipsizing line, because the count is the trailing child:
1804
+ `text-overflow: ellipsis` clips the END, so a long project name would truncate away the very
1805
+ number that tells you how many requests the filter is hiding. The NAME ellipsizes; the count
1806
+ never shrinks. */
1807
+ .req-scope button { text-transform: none; letter-spacing: 0; font-size: 12px; padding: 8px 10px;
1808
+ min-width: 0; display: flex; align-items: baseline; justify-content: center; gap: 5px; }
1809
+ .req-scope button[data-reqscope="all"] { flex: 0 0 auto; }
1810
+ .req-scope .req-scope-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
1811
+ .req-scope .req-scope-n { color: var(--text-muted); font-variant-numeric: tabular-nums; flex: 0 0 auto; }
1812
+ .req-scope button.active .req-scope-n { color: var(--accent-dim); }
1813
+ .req-search { margin-bottom: 10px; flex: 0 0 auto; }
1814
+ /* Flexes against .modal.requests' 86vh cap rather than declaring its own 52vh — see the note
1815
+ there. min-height:0 is what lets a flex child actually shrink and scroll. */
1816
+ .requests-list { display: flex; flex-direction: column; gap: 8px; flex: 1 1 auto; min-height: 0; overflow-y: auto; margin: 4px 0 2px;
1817
+ scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
1818
+ .requests-list::-webkit-scrollbar { width: 7px; }
1819
+ .requests-list::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 7px; }
1820
+ .requests-list::-webkit-scrollbar-track { background: transparent; }
1765
1821
  .req-item {
1766
1822
  display: flex; gap: 10px; align-items: flex-start;
1767
1823
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface-2);
@@ -1769,6 +1825,12 @@
1769
1825
  .req-info { flex: 1; min-width: 0; }
1770
1826
  .req-head { font-size: 12px; color: var(--text-dim); display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
1771
1827
  .req-head code { font-family: var(--mono); color: var(--text-muted); }
1828
+ /* WHICH project or workflow this request is about — the row's subject, so it reads as a name
1829
+ rather than the muted mono identifier the app id used to be rendered as. One treatment for
1830
+ both: "Cedar Mill Warehouse" and `steel-model` answer the same question here, and setting
1831
+ names in prose and ids in mono would split one column into two visual languages.
1832
+ Truncates rather than pushing the timestamp off the row. */
1833
+ .req-owner { color: var(--text-muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
1772
1834
  .req-time { font-family: var(--mono); font-size: 9.5px; color: var(--text-muted); letter-spacing: 0; flex-shrink: 0; margin-left: auto; }
1773
1835
  .req-type {
1774
1836
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
@@ -1778,10 +1840,31 @@
1778
1840
  .req-type-tweak { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
1779
1841
  .req-instruction {
1780
1842
  font-size: 12px; color: var(--text); line-height: 1.45; word-break: break-word;
1781
- /* Clamp long instructions so one verbose request can't dominate the list — the
1782
- full text is always one click away via the copy button. */
1783
- display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
1784
- }
1843
+ /* Readable in full, in place. This used to be a 3-line -webkit-line-clamp, which cut every
1844
+ instruction mid-sentence ("…KEEP its ETag — the…") with no way to read the rest without
1845
+ copying it out. A max-height + own scroller caps how much of the list one verbose request
1846
+ can eat while still letting you read all of it here.
1847
+ Nested-scroll note: overscroll-behavior is deliberately left at `auto` so reaching the end
1848
+ of an instruction CHAINS the wheel back to .requests-list — `contain` would trap the wheel
1849
+ inside a row. Rows short enough to fit never become scrollers at all. */
1850
+ max-height: 90px; overflow-y: auto;
1851
+ scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
1852
+ }
1853
+ .req-instruction::-webkit-scrollbar { width: 7px; }
1854
+ .req-instruction::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 6px; }
1855
+ .req-instruction::-webkit-scrollbar-track { background: transparent; }
1856
+ /* The search hit, highlighted where it sits — in the instruction AND in the name, since a query
1857
+ often matches the project rather than the wording. With several near-identical queued tweaks,
1858
+ "which one matched?" is otherwise guesswork. Tinted text, not a block highlight: a filled
1859
+ swatch would out-shout the accent language of the rest of the modal. */
1860
+ .req-item mark { background: color-mix(in srgb, var(--accent) 22%, transparent);
1861
+ color: var(--text); border-radius: 2px; padding: 0 1px; }
1862
+ /* "Show all" inside the scoped-empty state — a link, not a button: it's an aside inside a
1863
+ sentence, and a second bordered control here would compete with the scope tabs it defers to.
1864
+ Accent (not --err) on hover: switching scope is the opposite of destructive. */
1865
+ .req-showall { background: none; border: none; padding: 0; font: inherit; font-style: inherit;
1866
+ color: var(--text-dim); text-decoration: underline; cursor: pointer; }
1867
+ .req-showall:hover { color: var(--accent); }
1785
1868
  .req-actions { display: flex; gap: 4px; flex-shrink: 0; }
1786
1869
  .req-copy, .req-del {
1787
1870
  /* flex-center the glyph; padding:0 overrides the global button padding (7px 12px)
@@ -4055,7 +4138,11 @@ body.mode-workspaces #menu .menu-item[data-action="bake"] { display:none; }
4055
4138
  max-width:22ch; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
4056
4139
  font-family:var(--mono); font-size:10px; color:var(--text-dim);
4057
4140
  }
4058
- .ws-empty-note { color:var(--text-dim); font-size:12px; margin-top:10px; }
4141
+ .ws-empty-note { color:var(--text-dim); font-size:12px; margin-top:10px; line-height:1.55; max-width:640px; }
4142
+ /* First-run tour link (#598) — its own line so the prose above stays prose, but no box, no fill and
4143
+ no accent region: the create cards above are the primary action and this must not compete with
4144
+ them. Styling comes from .onb-build-btn's rule (see the .onb-* block); only the spacing is here. */
4145
+ .ws-empty-tour { margin-top:8px; }
4059
4146
  /* A FAILED load, not an empty workspace. Same inline-banner recipe as .hist-empty / .hd-warn below
4060
4147
  (surface-2 + a left rail) so it reads as a sibling of the app's other status banners, railed in
4061
4148
  --warn: a list that wouldn't load is "needs attention", not the definite operation failure --err
package/dist/web/app.js CHANGED
@@ -135,33 +135,107 @@ function onboardingHtml() {
135
135
  `</div>`
136
136
  );
137
137
  }
138
- function wireOnboardingCopy() {
139
- // The primary first-run action: copy the natural-language onboarding prompt so the user can paste it
140
- // into their terminal AI to launch the guided tour (the floless-app-onboarding skill).
141
- const tour = $topology.querySelector('.onb-tour-btn');
142
- if (tour) {
143
- const live = $topology.querySelector('.onb-tour-live');
144
- const label = tour.querySelector('.onb-tour-label');
145
- const ico = tour.querySelector('.onb-tour-ico');
146
- tour.onclick = async () => {
147
- try {
148
- await navigator.clipboard.writeText(ONB_TOUR_PROMPT);
149
- tour.disabled = true;
150
- if (label) label.textContent = 'Copied';
151
- if (ico) ico.textContent = '✓';
152
- if (live) live.textContent = 'Copied to clipboard';
153
- showToast('Copied — paste it into your terminal AI', 'ok');
154
- setTimeout(() => {
155
- if (label) label.textContent = 'Start the guided tour';
156
- if (ico) ico.textContent = '⎘';
157
- tour.disabled = false;
158
- if (live) live.textContent = '';
159
- }, 1600);
160
- } catch {
161
- showToast('Could not copy — select and paste the prompt manually.', 'warn');
138
+ // Wire a "Start the guided tour" button: copy the natural-language onboarding prompt so the user can
139
+ // paste it into their terminal AI to launch the tour (the floless-app-onboarding skill), and confirm
140
+ // in place. SHARED — the Workflows first-run card below and the Workspaces zero-projects empty state
141
+ // (workspaces.js, #598) are two entry points to the SAME tour, so they must not drift in prompt text,
142
+ // confirmation wording, or reset timing; one function is what guarantees that.
143
+ // Markup contract: a button may be bare text (it is then its own label), or split into
144
+ // `.onb-tour-label` + `.onb-tour-ico` — never an icon span with no label span, which would have the
145
+ // label swap wipe the icon out. Its `[aria-live]` region is found as a sibling rather than passed in,
146
+ // so a call site cannot quietly wire a button with no way to announce the result.
147
+ function wireTourCopy(btn) {
148
+ if (!btn) return;
149
+ const ico = btn.querySelector('.onb-tour-ico');
150
+ const label = btn.querySelector('.onb-tour-label') || btn;
151
+ // Loud, because that mistake is otherwise invisible AND permanent: with no label span the swap below
152
+ // writes over the whole button, destroying the icon element, and the reset restores flat text. The
153
+ // button keeps "working", so nothing else would ever report it.
154
+ if (ico && label === btn) console.error('[onboarding] a tour button with .onb-tour-ico must also have .onb-tour-label — the label swap will destroy the icon', btn);
155
+ const live = btn.parentElement ? btn.parentElement.querySelector('[aria-live]') : null;
156
+ // Equally loud. Finding the region by structure keeps the two call sites from passing mismatched
157
+ // selectors, but it also means an extra wrapper around the button silently costs every screen-reader
158
+ // announcement — and the four `if (live)` guards below would hide that forever. Say so instead.
159
+ if (!live) console.error('[onboarding] no [aria-live] sibling for this tour button — the copy result will not be announced', btn);
160
+ // Read the idle text off the DOM rather than hardcoding it — the two call sites label the action
161
+ // differently ("Start the guided tour" vs "Start the guided tour →") and only the markup knows which.
162
+ const idleLabel = label.textContent;
163
+ const idleIco = ico ? ico.textContent : '';
164
+ btn.onclick = async () => {
165
+ // ONLY the copy goes inside the try. Wrapping the confirmation too meant a throw anywhere in it
166
+ // (showToast dereferences #toast-container unguarded) landed in the catch with the button already
167
+ // disabled and the reset never scheduled — a permanently stuck "Copied ✓" under a toast saying the
168
+ // copy failed. That was the one path where this button could actively misinform.
169
+ try {
170
+ await navigator.clipboard.writeText(ONB_TOUR_PROMPT);
171
+ } catch (err) {
172
+ // Bind and log it: "navigator.clipboard is undefined" (insecure context / blocked by policy —
173
+ // permanent) and "writeText rejected" (denied, or the document wasn't focused — often retryable)
174
+ // reach the user as one message, and with nothing logged a bug report can't separate them either.
175
+ console.error('[onboarding] could not copy the tour prompt', err);
176
+ revealTourPrompt(btn, live);
177
+ return;
178
+ }
179
+ // Disabling a focused control blurs it, and re-enabling does NOT bring focus back — so a keyboard
180
+ // user would be dropped to <body> for the whole confirmation and have to tab in from the top
181
+ // again. Restore it: the same discipline retryProjects() applies on this very surface.
182
+ // MUST be read before disabling, which blurs it — after, this is always false.
183
+ const hadFocus = document.activeElement === btn;
184
+ btn.disabled = true;
185
+ label.textContent = 'Copied';
186
+ if (ico) ico.textContent = '✓';
187
+ if (live) live.textContent = 'Copied to clipboard';
188
+ // A successful copy retires any prompt a previous refusal put on screen — otherwise a stale
189
+ // "copy this manually" field sits under a button reading "Copied ✓", contradicting it.
190
+ const stale = btn.parentElement ? btn.parentElement.querySelector('.onb-tour-manual') : null;
191
+ if (stale) stale.remove();
192
+ setTimeout(() => {
193
+ label.textContent = idleLabel;
194
+ if (ico) ico.textContent = idleIco;
195
+ btn.disabled = false;
196
+ if (live) live.textContent = '';
197
+ // Only take focus back if it is still nowhere. 1600 ms is long enough for the user to click or
198
+ // tab onto something else — and a mouse click focuses the button too, so `hadFocus` alone would
199
+ // yank focus out of whatever they moved to. isConnected because a repaint may have replaced this
200
+ // node, and focusing a detached button drops them to <body>: the very thing this prevents.
201
+ const parked = document.activeElement;
202
+ if (hadFocus && btn.isConnected && (!parked || parked === document.body)) {
203
+ btn.focus({ focusVisible: true, preventScroll: true });
162
204
  }
163
- };
205
+ }, 1600);
206
+ showToast('Copied — paste it into your terminal AI', 'ok');
207
+ };
208
+ }
209
+ // The clipboard is this button's ONLY route into onboarding, and the prompt is rendered nowhere — so
210
+ // "copy it manually" asks for something the user cannot do: there is nothing on screen to copy. Put
211
+ // the prompt on screen, selected, and the message becomes true. Both entry points inherit this.
212
+ function revealTourPrompt(btn, live) {
213
+ const host = btn.parentElement;
214
+ let box = host ? host.querySelector('.onb-tour-manual') : null;
215
+ if (host && !box) {
216
+ // A textarea, not an input: the prompt is wider than the Workflows card, and a single-line input
217
+ // clips it mid-sentence. Selecting still copies the whole thing, but "copy it manually" is only
218
+ // honest if the user can also READ what they are copying.
219
+ box = document.createElement('textarea');
220
+ box.className = 'onb-tour-manual';
221
+ box.rows = 2;
222
+ box.readOnly = true;
223
+ box.value = ONB_TOUR_PROMPT;
224
+ box.setAttribute('aria-label', 'The onboarding prompt — copy this and paste it into your terminal AI');
225
+ host.appendChild(box);
164
226
  }
227
+ // focus+setSelectionRange, not select(): select() scrolls the element into view with no way to
228
+ // opt out, and on the Workflows card that means scrolling inside .canvas (overflow:hidden) whose
229
+ // .topology child is the pan/zoom transformed world — a scrollTop nothing can put back.
230
+ if (box) { box.focus({ preventScroll: true }); box.setSelectionRange(0, box.value.length); }
231
+ if (live) live.textContent = 'Could not copy. The prompt is now shown — copy it manually.';
232
+ showToast(box
233
+ ? 'Couldn’t reach the clipboard — the prompt is shown below; copy it manually.'
234
+ : 'Could not copy — this browser is blocking the clipboard.', 'warn');
235
+ }
236
+ function wireOnboardingCopy() {
237
+ // The primary first-run action on the empty canvas.
238
+ wireTourCopy($topology.querySelector('.onb-tour-btn'));
165
239
  // Secondary first-run action: "Build your first workflow" — the empty canvas is the
166
240
  // highest-intent moment to create one, so surface the same relay the ≡ menu's "New
167
241
  // workflow…" fires (handleMenuAction is reassigned in aware.js → requestNewWorkflow).