Skip to content

Persist designer media preset across sessions#30

Merged
AlexNly merged 1 commit into
mainfrom
fix/persist-designer-media
Feb 2, 2026
Merged

Persist designer media preset across sessions#30
AlexNly merged 1 commit into
mainfrom
fix/persist-designer-media

Conversation

@AlexNly

@AlexNly AlexNly commented Feb 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • Save selected designer media preset to localStorage on change
  • Restore saved preset on page load (if still a valid option)

Fixes #29

Test plan

  • Open Designer tab, switch media to a non-default preset (e.g., 55x30 label)
  • Reload the page — designer should open with the same preset selected
  • Clear localStorage — should fall back to server default

@AlexNly AlexNly merged commit 51d91b6 into main Feb 2, 2026
2 checks passed
@AlexNly AlexNly deleted the fix/persist-designer-media branch February 2, 2026 14:26

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9e7f5f2283

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

if (config && config.default_media) {
sel.value = config.default_media;
}
const saved = localStorage.getItem('ditherbooth_designer_media');

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Guard localStorage access for blocked storage

Accessing localStorage can throw a SecurityError in environments where storage is blocked or disabled (e.g., Safari private mode, strict privacy settings). This new read runs during initialization, so a thrown error would abort the designer setup and leave the page unusable in those contexts. Consider wrapping the access in a try/catch or feature-checking storage availability before reading.

Useful? React with 👍 / 👎.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Persist designer media preset across sessions

1 participant