@floless/app 0.101.0 → 0.101.2

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.
@@ -2496,9 +2496,9 @@
2496
2496
  el.addEventListener('animationend', () => el.classList.remove('is-new'), { once: true });
2497
2497
  }
2498
2498
 
2499
- // Shared rename/duplicate/archive — used by both the kebab menu (one project, from the
2500
- // landing grid) and the header project-picker's inline row actions below (any project,
2501
- // from anywhere). Never switches projects itself — the caller decides navigation.
2499
+ // rename/duplicate/archive on ONE project — driven by the landing-grid card ⋯ menu (the header
2500
+ // project-picker is now a pure switcher with no inline actions). Never switches projects itself
2501
+ // except where a rename of the OPEN project must re-src its iframes — the caller decides navigation.
2502
2502
  // Each branch updates the local `projects` array from the endpoint's result (unshift a duplicate,
2503
2503
  // move a rename to the front, filter out an archive — the unshift mirrors createSeeded/
2504
2504
  // createFromDrawing) and repaints the grid IMMEDIATELY, so the change is on screen WITH the toast
@@ -2515,16 +2515,20 @@
2515
2515
  if (action === 'rename') {
2516
2516
  const name = await promptName('Rename project', 'New name', proj ? proj.name : '');
2517
2517
  if (!name) return;
2518
+ const wasCurrent = !!(current && current.id === id);
2518
2519
  const { project } = await api(`/api/projects/${encodeURIComponent(id)}`, { method: 'PATCH', body: JSON.stringify({ name }) });
2519
- if (current && current.id === id) { current = project; $projName.textContent = project.name; $crumbName.textContent = project.name; }
2520
- // Rename bumps updatedAt server-side and the grid is newest-activity-first, so the reconcile
2521
- // will move this card to the front regardless. Do that move now (not an in-place swap) so it
2522
- // happens once, with the flash, rather than as a jump a second later when loadProjects() lands.
2520
+ // Rename now also changes the on-disk id (the folder tracks the display name), so update the grid
2521
+ // BY THE OLD id and re-front the card — once, with the flash, rather than as a jump a second later
2522
+ // when loadProjects() reconciles. The unshift must land before any openProject(newId) below so it
2523
+ // can find the project in `projects`.
2523
2524
  const i = projects.findIndex((p) => p.id === id);
2524
2525
  if (i >= 0) projects.splice(i, 1);
2525
2526
  projects.unshift(project);
2526
2527
  renderLanding();
2527
2528
  flashCard(project.id, { scroll: true });
2529
+ // If the renamed project was the OPEN one, its editor iframes still carry ?project=<old id> —
2530
+ // re-open so they re-src to the new id (a stale id 404s the next contract read/write/autosave).
2531
+ if (wasCurrent) await openProject(project.id);
2528
2532
  showToast(`Renamed to "${project.name}"`, 'ok');
2529
2533
  } else if (action === 'duplicate') {
2530
2534
  const { project } = await api(`/api/projects/${encodeURIComponent(id)}/duplicate`, { method: 'POST', body: '{}' });
@@ -2649,13 +2653,15 @@
2649
2653
  const pid = escapeAttr(p.id);
2650
2654
  const displayApp = appDisplayName(p.app);
2651
2655
  const meta = `${escapeHtml(displayApp)} · ${escapeHtml(relAgo(p.updatedAt))}`;
2652
- return `<div class="wf-option" role="option" id="ws-proj-opt-${pid}" data-id="${pid}" data-search="${escapeAttr((p.name + ' ' + displayApp + ' ' + p.app).toLowerCase())}" tabindex="-1" aria-selected="${current && current.id === p.id ? 'true' : 'false'}">`
2653
- + `<span class="wf-option-name">${escapeHtml(p.name)}</span><span class="wf-option-meta">${meta}</span>`
2654
- + `<span class="wf-option-actions">`
2655
- + `<button type="button" class="wf-act act-edit" data-act="rename" data-id="${pid}" tabindex="-1" data-tip="Rename" aria-label="Rename ${escapeAttr(p.name)}">✎</button>`
2656
- + `<button type="button" class="wf-act act-dup" data-act="duplicate" data-id="${pid}" tabindex="-1" data-tip="Duplicate" aria-label="Duplicate ${escapeAttr(p.name)}">⧉</button>`
2657
- + `<button type="button" class="wf-act act-archive" data-act="archive" data-id="${pid}" tabindex="-1" data-tip="Archive — recoverable" aria-label="Archive ${escapeAttr(p.name)}">⏏</button>`
2658
- + `</span></div>`;
2656
+ // A PURE SWITCHER: no per-row Rename/Duplicate/Archive icons — project MANAGEMENT lives only on
2657
+ // the landing cards' ⋯ menu (a picker that only lets you switch has one predictable affordance
2658
+ // per row; a lone kept icon would have no rule a user could guess). Clicking a row switches.
2659
+ // The current project carries `.selected` (not just aria-selected) so the accent "you are here"
2660
+ // marker (.wf-option.selected in app.css) actually shows — mirrors the workflow picker (aware.js).
2661
+ // It matters more now the action icons are gone: without it the open row is visually unmarked.
2662
+ const here = current && current.id === p.id;
2663
+ return `<div class="wf-option${here ? ' selected' : ''}" role="option" id="ws-proj-opt-${pid}" data-id="${pid}" data-search="${escapeAttr((p.name + ' ' + displayApp + ' ' + p.app).toLowerCase())}" tabindex="-1" aria-selected="${here ? 'true' : 'false'}">`
2664
+ + `<span class="wf-option-name">${escapeHtml(p.name)}</span><span class="wf-option-meta">${meta}</span></div>`;
2659
2665
  }).join('');
2660
2666
  html += `<div class="wf-empty-search" hidden>No projects match '<span class="wf-empty-term"></span>'</div>`;
2661
2667
  $projList.innerHTML = html;
@@ -2737,8 +2743,8 @@
2737
2743
  }
2738
2744
  if ($projList) {
2739
2745
  $projList.addEventListener('click', (e) => {
2740
- const act = e.target.closest('[data-act]');
2741
- if (act) { closeProjCombo(false); doProjectAction(act.dataset.act, act.dataset.id); return; }
2746
+ // Pure switcher: a row click switches projects. Management (rename/duplicate/archive) is on the
2747
+ // landing cards only, so there are no inline action icons to hit-test around here anymore.
2742
2748
  const o = e.target.closest('.wf-option');
2743
2749
  if (o) selectProjById(o.dataset.id);
2744
2750
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floless/app",
3
- "version": "0.101.0",
3
+ "version": "0.101.2",
4
4
  "type": "module",
5
5
  "description": "Thin localhost host for floless.app — serves web/ and shells the aware CLI. No engine, no LLM.",
6
6
  "bin": {