poli0981andClaude Opus 5 e12e8009d7 feat(export,edit): the #export and #edit tabs (Phase 3)
Adds the export pipeline (tri-state folder picker, four format cards,
per-format options, download) and the edit tree (CRUD, search, duplicate
panel, drag & drop with keyboard "Move to…" parity, live event sync, WAI-ARIA
keyboard navigation). 338 tests, npm run verify green, manifest unchanged.

The Phase 3 exit criterion is covered by a test: an exported HTML file
re-imports losslessly, toolbar marker and all.

Pure logic lives in core/edit modules so the whole keyboard and selection
contract is testable without mounting components: core/select.ts (tri-state,
including the ancestor-splitting untick), core/search.ts, edit/patch-tree.ts
(immutable event patching), edit/tree-keyboard.ts, edit/move-target.ts.

An adversarial review found 14 defects, all fixed here. The pattern in the
serious ones was the same: mutate locally, then await a browser call that can
reject, and never look at the result.

- Every mutation now runs through a guard that reports the failure and
  resyncs from the browser. Previously a rejected delete removed an entire
  subtree from the UI while it still existed in the profile, with no error and
  no way back but a reload — and a rejected move left a node displayed under a
  folder it was not in.
- Permanent roots and policy-managed nodes were fully editable. Rename, delete
  and Move-to are now gated on both, in the mouse and keyboard paths, so calls
  the browser will always reject are never attempted. "Move to…" previously
  validated only the destination, so moving a root nested the two roots.
- New folder resolved the focused node's PARENT, so selecting a root yielded
  the synthetic root "0" and every create failed silently; selecting a folder
  created a sibling. It now targets the focused folder itself and expands it,
  so the inline rename input actually mounts.
- The tree kept DOM focus on the container and never published
  aria-activedescendant, so arrow-key navigation announced nothing.
- The container keydown handler ignored event.target and modifier state, so it
  stole keys aimed at row buttons and swallowed Ctrl/Cmd-F — which was not
  implemented at all.
- Search expansion was unioned in at render time but toggle() wrote only to
  `expanded`, making the disclosure button and ArrowLeft dead on every
  search-expanded folder. Search expansion is now merged into `expanded`.
- The tri-state checkbox never showed indeterminate: a parameterless Svelte
  action runs once at creation, so a partially selected folder looked
  identical to an unselected one.
- The export button re-serialized the whole tree on every render just to show
  a count, and its filename disagreed with the saved one.
- Markdown layout and CSV delimiter were unreachable from the Export tab.
- Search tested title and url separately; the spec defines one haystack.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-26 06:13:53 +07:00
2026-07-25 19:21:07 +07:00
S
Description
No description provided
GPL-3.0
3 MiB
0 Stars 1 Watchers 0 Forks
Languages
TypeScript 75.8%
Svelte 14.5%
JavaScript 9.2%
CSS 0.4%