Skip to content

Persist app settings on the gateway (shared across clients) #14

Description

@BernardJen

Summary

Persist app-level settings on the gateway/Pi so every client connected to the daemon shares the same settings, and they survive a browser-data clear or switching devices.

Motivation

Today only the artwork session is persisted, and only in browser localStorage (src/ui/sessionStore.ts), scoped to a single browser. There is no defined home for global app settings, and nothing survives clearing the browser or moving to another device. Settings should live on the machine running the daemon (like gateway/.plotter-state.json) so all clients see one consistent configuration.

Scope — app settings, NOT artwork

This is distinct from the existing per-session artwork store and from project save/load (#8). Settings here are global preferences such as:

Per-session artwork stays where it is; projects are #8.

Behavior

  • Gateway stores settings on disk (mirror the .plotter-state.json / PLOTTER_STATE pattern).
  • New gateway endpoint(s) to read/write settings (gateway/server.ts).
  • Clients load settings from the gateway on connect and write back on change.
  • Sensible defaults when no settings file exists yet.

Acceptance criteria

  • Settings persist on the gateway/Pi disk, not just browser localStorage.
  • All clients connected to the same gateway see the same settings.
  • Settings survive a browser-data clear and switching devices.
  • Defaults apply cleanly on first run / missing file.
  • Artwork session persistence is unchanged; this is separate from project save/load (Save and load projects (local machine and Raspberry Pi) #8).

Notes

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions