Unify the settings and workspace-editor surfaces
Status: Partially implemented — the auth source-folder validation, shared error dialog, shared modal lifecycle/sizing rules, settings modal enum convergence, shared settings/editor row helpers, save-preview cleanup, and row-parity tests have shipped. The remaining work is the deeper per-domain edit subsystem and full input/mouse/flow convergence so Settings and the workspace Editor differ only by the config layers they read and write.
Shipped facts
The global Settings screen and the workspace Editor screen edit the same config domains — auth, mounts, env/secrets, trust, general — and now share several cross-cutting pieces. Auth source-folder validation routes through the same validate_auth_source_folder (crates/jackin/src/console.rs), which wraps the runtime gate validate_sync_source_dir (crates/jackin-instance/src/auth.rs), and both surfaces render rejection through the same shared error_popup widget rather than diverging inline-vs-silent behavior. Modal lifecycle and sizing moved onto shared primitives: parent-return behavior uses the shared modal stack semantics, settings modal state has converged from three parallel enum families into one structural container, and modal rectangles route through the shared registry.
Row rendering has also moved closer to parity: shared settings/editor row helpers cover auth rows, env/secrets rows, label/value rows, and mount headers, with parity tests guarding the common row vocabulary. Save-preview formatting now shares common line builders, and the remaining surface-specific code is mostly the host state adapters, domain routing, persistence targets, and flow-specific input/mouse handling.
The item is still not finished. Settings and Editor do not yet share one complete per-domain edit subsystem, the proposed ConfigSurfaceHost host trait remains a design target rather than an implemented boundary, and the trust asymmetry (a first-class SettingsTrustState tab in settings versus a ConfirmTarget::TrustRoleSource confirm flow in the editor) still needs a deliberate convergence decision.
The full duplication inventory (modal-taxonomy table, twinned function families, target host-trait architecture, proposed code shapes) is written up in Unifying the Settings and Editor Config Surfaces; this item tracks only what is left to build.
Remaining work
- Introduce the shared per-domain edit subsystem (flatten/validation, render, edit-flow handlers, persistence handoff) behind a host trait so settings and editor differ only in which config layers/scopes they read and write.
- Collapse the remaining auth edit-flow twins (plain credential, 1Password source, op-picker family, open/restore/persist/clear) into one generic implementation.
- Converge the mounts, env/secrets, trust, and general domains onto the same shared edit flow, reconciling the settings
Global/Rolevs editorWorkspace/Rolescope split and the trust tab-vs-confirm-flow asymmetry. - Converge the remaining input and mouse routing around tab strips, footer hints, row hit-testing, and modal handoff where state adapters still duplicate behavior across
EditorState,SettingsEnvState,GlobalMountsState, andSettingsAuthState. - Add cross-surface equivalence tests per domain (open, each apply, validate, error, cancel, persist) so a change to shared code is provably identical on both screens.
- Update the Auth source-folder sync spec as each slice lands.
Related work
- Unifying the Settings and Editor Config Surfaces — duplication map and target architecture design rationale.
- Auth source-folder sync spec — the behavioral invariants the auth slice must preserve.
- Auth reliability program — the feature whose Phase 1 hardening surfaced the duplication.
- Split input/editor.rs — sibling codebase-health item on the same input/modal layer; sequence the unification with it so the split divides one implementation.
- TUI architecture — the model/decision/view split both screens must follow.