diff --git a/docs/superpowers/plans/2026-07-10-federation-editor-phase2-kind-aware.md b/docs/superpowers/plans/2026-07-10-federation-editor-phase2-kind-aware.md new file mode 100644 index 0000000..1e3ad81 --- /dev/null +++ b/docs/superpowers/plans/2026-07-10-federation-editor-phase2-kind-aware.md @@ -0,0 +1,722 @@ +# Kind-Aware Remote Editor — Implementation Plan (Phase 2) + +> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking. + +**Goal:** An in-UI editor (both UIs) to add/edit/remove/test federation remotes of both kinds (catacomb + PeerTube), applied live, with PeerTube remotes manageable now and browsable in phase 3. + +**Architecture:** A `RemoteClientKind` enum wraps `RemoteClient`/`PeerTubeClient`; the live remotes lists hold it (web behind a `RwLock` for live-apply). Dedicated `/api/remotes/*` endpoints (extended `GET`, new `PUT` whole-list-replace, new `POST /test`) manage them, with URL-keyed write-only password merge on the web. Both editors gain a kind selector + conditional username field. Existing catacomb browse is untouched; PeerTube browse is a phase-3 stopgap. + +**Tech Stack:** Rust, axum, eframe/egui, reqwest (blocking), serde/serde_json; the embedded `web_ui/index.html` SPA. + +## Global Constraints + +- Inherits `docs/superpowers/specs/2026-07-10-federation-remote-editor-design.md` for unchanged editor mechanics; deltas in `docs/superpowers/specs/2026-07-10-federation-editor-phase2-kind-aware-design.md`. +- Web config source of truth is `state.config` (`Mutex`, accessed via `.lock_recover()`); save via `cfg.save(&state.config_path)`; on save error don't swap the live list; drop the config lock before taking the remotes lock. +- Web passwords masked/write-only: `GET` never returns plaintext; blank on save keeps the stored secret, matched by URL. Desktop shows passwords in the clear. +- After any edit, both UIs refetch and clear the current remote selection. +- The web SPA is one embedded file; **a `cargo build` does not catch JS syntax errors** — after editing `web_ui/index.html`, run `awk '/