Skip to content

feat(connections): working delete confirm + disconnect + set-primary guard - #88

Merged
ajianaz merged 1 commit into
developfrom
feat/connections-delete-confirm-disconnect
Jul 1, 2026
Merged

ajianaz merged 1 commit into
developfrom
feat/connections-delete-confirm-disconnect

Conversation

@ajianaz

@ajianaz ajianaz commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Follow-up to #84 / #85 / #86 / #87 — Connection Manager manual-test fixes + new disconnect.

Issues found during manual UI testing

  1. Delete did nothing. Native confirm() is blocked in the Tauri webview
    (it returns falsy immediately), so the delete branch never ran.
  2. No way to stop using a backend — the app always held an active client.
  3. Set Primary could activate a dead backend (no status guard).

Changes

Delete confirm (fix #1)

Replaced native confirm() with an in-app modal in ConnectionManager.svelte
(confirm-overlay / confirm-dialog). Esc and Cancel dismiss; Delete proceeds.
Tracks pendingDelete state. Matches the existing MemoryDetail.svelte pattern.

Disconnect (fix #2)

  • New disconnect_connection command: drops AppState.uteke_client to None
    (recall/search fail until reconnect) and marks the primary connection
    disconnected. The row and primary flag are preserved.
  • New store::set_status(id, status) helper — sets status without bumping
    last_tested_at (not a health check).
  • ipc.ts: connection.disconnect() wrapper.
  • stores/connections.svelte.ts: disconnect() wired through.
  • UI: "Disconnect" button shown only on the connected primary.

Set Primary guard (fix #3)

UI now only offers "Set Primary" on connections whose status is connected.
Combined with disconnect, the lifecycle is: Test → connected → Set Primary →
(optional) Disconnect → Reconnect.

Docs

  • .agent.md connection-layer rules 6–8 (disconnect vs reconnect, guard,
    no native confirm/alert).
  • CHANGELOG.md updated.

Validation

  • cargo fmt + cargo clippy --all-targets -- -D warnings clean.
  • npm run build clean.

…guard

Three issues found during manual testing of the Connection Manager:

1. Delete did nothing: native confirm() is blocked in the Tauri webview
   (returns falsy immediately). Replaced with an in-app confirm modal
   (confirm-overlay / confirm-dialog pattern, Esc/cancel supported).

2. No way to stop using a backend. Added disconnect_connection command:
   drops AppState.uteke_client to None (recall/search fail until reconnect)
   and marks the primary connection 'disconnected'. Row + primary flag kept.
   New store::set_status helper sets status without bumping last_tested_at.

3. Set Primary could activate a dead backend. Now the UI only offers
   'Set Primary' on connections whose status is 'connected', and
   'Disconnect' only on the connected primary.

- disconnect button on connected primary; reconnect already existed
- ipc.ts: connection.disconnect() wrapper
- store: disconnect() wired through
- .agent.md: connection-layer rules 6-8 (disconnect/reconnect, guard, no native confirm)
- CHANGELOG updated
@ajianaz
ajianaz merged commit ccd9b88 into develop Jul 1, 2026
8 checks passed
@ajianaz
ajianaz deleted the feat/connections-delete-confirm-disconnect branch July 1, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant