Skip to content

feat: remember last-used charset / color in localStorage #4

Description

@can4hou6joeng4

Why

First-time visitors discover a charset they like (often braille or blocks), leave, and come back to the default. A tiny localStorage restore would make the tool feel sticky without accounts.

Scope (keep small)

  • Persist charset and color mode only (not brightness/contrast — those are image-specific).
  • Key namespaced, e.g. semaphore-charset, semaphore-color.
  • Read on boot in src/tool.ts after the control DOM is wired; write on change.
  • Ignore malformed values; fall back to current defaults.
  • Theme already uses localStorage (semaphore-theme in shared.ts) — mirror that style.

Out of scope

  • Syncing across devices
  • Persisting the last image (privacy + storage)
  • Server-side anything

Acceptance

  • Reload /tool keeps the last charset and color
  • Clearing site data restores defaults
  • npm test and npm run build still pass
  • No new network calls; still fine under connect-src 'none'

Pointers

  • src/tool.ts — control wiring
  • src/shared.ts — existing theme localStorage pattern
  • STYLEGUIDE.md — copy voice if you touch any user-visible string

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions