Skip to content

Guard storage access for delivery readiness#1

Open
love19870821 wants to merge 1 commit into
masterfrom
codex/create-a-stylish-voice-note-tool
Open

Guard storage access for delivery readiness#1
love19870821 wants to merge 1 commit into
masterfrom
codex/create-a-stylish-voice-note-tool

Conversation

@love19870821
Copy link
Copy Markdown
Owner

Motivation

  • Prevent runtime errors in environments where localStorage is unavailable or restricted so the app remains usable.
  • Surface a clear, user-facing status when persistent storage cannot be used so users know data will only persist for the current page.

Description

  • Add isStorageAvailable() which safely tests localStorage by attempting a set/remove and returns a boolean.
  • Guard loadEntries() to return an empty list when storage is unavailable and set speechStatus to a helpful message, and keep loadEntries() JSON parsing inside a try/catch.
  • Guard saveEntries() to no-op when storage is unavailable and show a speechStatus message on write failure.

Testing

  • Launched a static server with python -m http.server 8000 and ran a Playwright script that opened the page and produced artifacts/voice-ledger-final.png, and the script completed successfully.
  • No unit tests were added; the automated UI screenshot run succeeded.

Codex Task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant