Skip to content

Add SettingsService gRPC: daemon config via RPC, display prefs stay in Tauri #1138

Closed

Description

@malibio

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:

  1. Daemon config (database path, gRPC address) — owned by nodespaced, currently inaccessible to CLI or other clients
  2. 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 prefs
  • packages/desktop-app/src-tauri/src/app_services.rs — switch_database() and related code to delete
  • packages/daemon/src/main.rs — register SettingsService; config file path: ~/.nodespace/daemon.toml

Implementation Details

  • packages/daemon/src/services/settings_service.rs — reads/writes ~/.nodespace/daemon.toml; exposes via gRPC
  • commands/settings.rs — daemon config fields (active_database_path, grpc_address) fetched via SettingsServiceClient; theme and render_markdown remain in Tauri local storage unchanged
  • Delete: AppServices::switch_database(), AppServices::switch_database_services(), switch_database Tauri command, all callers

Acceptance Criteria

  • SettingsService proto defined and compiled via tonic-build
  • nodespaced handler reads/writes ~/.nodespace/daemon.toml
  • commands/settings.rs fetches daemon config via gRPC; display prefs remain in Tauri local storage
  • switch_database Tauri command deleted
  • AppServices::switch_database() and related hot-swap code deleted
  • Settings UI continues working for both daemon config and display preferences
  • cargo build succeeds
  • bun run test:all passes
  • bun run quality:fix passes

Dependencies

Related Issues

Activity

  1. added a commit that references this issue on May 17, 2026
  2. malibio commented on May 18, 2026

    @malibio
    CollaboratorAuthor

    Frontend baseline: 128 files / 3916 tests passed

  3. self-assigned this
    on May 18, 2026
  4. added a commit that references this issue on Jun 22, 2026
    b88096c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions