Repository navigation
Description
Overview
Define the SettingsService protobuf service for daemon-owned configuration, implement the handler in nodespaced, and split commands/settings.rs: daemon config fetched via gRPC, display preferences remain local to the Tauri app. The vestigial switch_database hot-swap mechanism is deleted.
Problem Statement
commands/settings.rs mixes two concerns that belong in different processes under ADR-031:
- Daemon config (database path, gRPC address) — owned by
nodespaced, currently inaccessible to CLI or other clients - Display preferences (theme, render_markdown) — UI-only state, correctly stays in the Tauri process
Additionally, AppServices::switch_database() and the switch_database Tauri command are vestigial — under ADR-031 database switching means restarting nodespaced with a different NODESPACED_DB_PATH, not hot-swapping in-process. The hot-swap code adds complexity with no remaining purpose.
Proposed Solution
Define SettingsService in the nodespace proto for daemon config reads/writes. Implement the handler in nodespaced backed by a config file. Update commands/settings.rs to fetch daemon config via gRPC while keeping display preferences in local Tauri storage. Delete switch_database entirely.
Technical Specifications
Proto addition (packages/daemon/proto/nodespace.proto)
service SettingsService {
rpc GetDaemonConfig(GetDaemonConfigRequest) returns (DaemonConfigResponse);
rpc UpdateDaemonConfig(UpdateDaemonConfigRequest) returns (DaemonConfigResponse);
}
message DaemonConfigResponse {
string active_database_path = 1;
string grpc_address = 2;
}Reference Files
packages/desktop-app/src-tauri/src/commands/settings.rs— split daemon config vs display prefspackages/desktop-app/src-tauri/src/app_services.rs—switch_database()and related code to deletepackages/daemon/src/main.rs— registerSettingsService; config file path:~/.nodespace/daemon.toml
Implementation Details
packages/daemon/src/services/settings_service.rs— reads/writes~/.nodespace/daemon.toml; exposes via gRPCcommands/settings.rs— daemon config fields (active_database_path,grpc_address) fetched viaSettingsServiceClient;themeandrender_markdownremain in Tauri local storage unchanged- Delete:
AppServices::switch_database(),AppServices::switch_database_services(),switch_databaseTauri command, all callers
Acceptance Criteria
-
SettingsServiceproto defined and compiled via tonic-build - nodespaced handler reads/writes
~/.nodespace/daemon.toml -
commands/settings.rsfetches daemon config via gRPC; display prefs remain in Tauri local storage -
switch_databaseTauri command deleted -
AppServices::switch_database()and related hot-swap code deleted - Settings UI continues working for both daemon config and display preferences
-
cargo buildsucceeds -
bun run test:allpasses -
bun run quality:fixpasses
Dependencies
Related Issues
- Migrate Tauri command handlers to thin gRPC proxy wrappers #1113 (establishes gRPC client pattern in Tauri)
Activity
WIP: gRPC proxy migration for #1113 — Phases 2-4 of 5 complete
malibio commentedon May 18, 2026
Frontend baseline: 128 files / 3916 tests passed
Add SettingsService gRPC: daemon config via RPC, delete switch_databa…