Skip to content

Persist user preferences (theme, density, pageSize) under one typed store #170

Description

@greatest0fallt1me

Description

This is a UI/UX issue. Several UX choices (theme, list density, page size, sort) need persistence and currently sprawl into ad-hoc localStorage usage. Introduce a single typed userPrefs store with helpers (getPref, setPref) and migrate ThemeContext.tsx plus future density/page-size to it for consistent UX continuity.

Requirements and Context

  • Reference: src/ThemeContext.tsx, src/ThemeToggle.tsx
  • Single localStorage key callora.prefs holds a JSON map
  • Helpers handle JSON parse failures and migrate from any legacy keys
  • Default values exported as constants
  • Must be secure, tested, and documented
  • Should be efficient and easy to review

Suggested Execution

  1. Fork the repo and create a branch
    git checkout -b task/user-prefs-store
  2. Implement changes
    • src/utils/userPrefs.ts
    • Migrate ThemeContext.tsx to use it
    • Add format.test.ts-style unit tests for prefs
  3. Test and commit
    • npm test for new tests
    • Verify legacy theme key still loads after migration

Example commit message

chore: introduce typed userPrefs store

Acceptance Criteria

  • Single callora.prefs key holds all preferences
  • Helpers cover get/set/remove with default fallbacks
  • Theme migration from legacy keys works on first load
  • Unit tests cover parse failures and migrations

Guidelines

  • Strictly typed via TS generics
  • No external state libraries
  • Clear documentation and inline comments
  • Timeframe: 96 hours

Metadata

Metadata

Assignees

Labels

GRANTFOX OSSGrantFox open-source campaign taskMAYBE REWARDEDMay be rewarded under the GrantFox campaignOFFICIAL CAMPAIGNOfficial GrantFox campaign issueStellar WaveIssues in the Stellar wave programui/uxUI/UX design, usability, and visual polish

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions