Skip to content

Add multi-backend support to example app#41

Merged
linroid merged 1 commit intomainfrom
feat/multi-backend-example-app
Feb 11, 2026
Merged

Add multi-backend support to example app#41
linroid merged 1 commit intomainfrom
feat/multi-backend-example-app

Conversation

@linroid
Copy link
Owner

@linroid linroid commented Feb 11, 2026

Summary

  • BackendManager manages embedded and remote KDown instances with lifecycle management, switching, and connection state tracking
  • Embedded KDown instance is created once and reused across backend switches and local server startup
  • Local HTTP server controls merged into the Embedded entry in the backend selector UI (no separate "Local Server" backend type)
  • Android and Desktop both support starting a local HTTP server exposing the embedded instance
  • WebApp rewritten to use the shared Compose UI (App(backendManager)) in remote-only mode
  • SqliteTaskStore used for persistence on Android, iOS, and Desktop
  • Removed redundant BackendType enum (type derived from BackendConfig sealed class)
  • Removed redundant BackendConnectionState (reuses ConnectionState from the remote module directly)

Key architecture

  • BackendFactory uses lambda injection for platform-specific capabilities (embedded creation, local server, SQLite driver)
  • BackendManager stores a single embedded KDownApi instance, reused for both direct use and local server exposure
  • DisconnectedApi null-object pattern avoids nullable activeApi in remote-only mode (wasmJs)
  • BackendEntry.isEmbedded derived property replaces the deleted BackendType enum

Test plan

  • All platforms build: Android, Desktop (JVM), iOS, wasmJs, webApp
  • JVM unit tests pass (BackendManagerTest, FakeKDownApi, FakeBackendFactory)
  • Manual: verify embedded backend works on Android/Desktop
  • Manual: verify local server start/stop on Android/Desktop
  • Manual: verify remote backend connection from webApp
  • Manual: verify backend switching in the selector sheet

🤖 Generated with Claude Code

- BackendManager handles embedded and remote KDown instances with
  lifecycle management, switching, and connection state tracking
- Embedded KDown instance is created once and reused across switches
- Local HTTP server controls merged into the Embedded entry UI
- Android and Desktop both support starting a local server
- WebApp rewritten to use shared Compose UI with remote-only mode
- SqliteTaskStore used on all platforms with embedded support
- Removed redundant BackendType enum (derived from BackendConfig)
- Removed redundant BackendConnectionState (reuse remote ConnectionState)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Contributor

Test Results

756 tests  +84   756 ✅ +84   11s ⏱️ ±0s
 63 suites + 3     0 💤 ± 0 
 63 files   + 3     0 ❌ ± 0 

Results for commit 7063722. ± Comparison against base commit 5b3d423.

@claude
Copy link

claude bot commented Feb 11, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@linroid linroid merged commit ca1c9db into main Feb 11, 2026
7 checks passed
@linroid linroid deleted the feat/multi-backend-example-app branch February 11, 2026 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant