feat(config): add region and storefront persistence#11
Merged
flexiondotorg merged 4 commits intomainfrom Mar 21, 2026
Merged
Conversation
- Add electron-store dependency for persistent storage - Create config.ts with typed store wrapper for storefront and language - Detect region from OS locale with fallback to 'us' - Build Apple Music URL with three-tier fallback: persisted storefront, OS region, default - Append language parameter to URL when persisted - Listen for navigation events and update store on storefront changes - Avoid disk I/O churn by only writing when values change - Update documentation with region/storefront features Signed-off-by: Martin Wimpress <code@wimpress.io>
Contributor
There was a problem hiding this comment.
2 issues found across 8 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="AGENTS.md">
<violation number="1" location="AGENTS.md:128">
P2: This documentation line is inaccurate: `LOADING_TEXT` is not the only translation surface, and the language count is outdated. It can mislead future contributors into updating only one record and leaving UI strings inconsistent.</violation>
</file>
<file name="src/main.ts">
<violation number="1" location="src/main.ts:104">
P2: Do not overwrite persisted language with `null` when navigation URL omits `?l=`; this unintentionally clears the saved language preference.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Add regex validation to ensure storefront codes match exactly two lowercase letters. Prevents garbage values like 'includes' from being persisted when Apple Music navigates to internal paths. Signed-off-by: Martin Wimpress <code@wimpress.io>
- Add all 7 translation records to AGENTS.md contributor guidance - Fix null assignment in language persistence logic: result.language now falls back to currentLanguage instead of always writing null when ?l= parameter is absent, preventing silent clearing of user preference - Write storefront and language to storage only when values change Signed-off-by: Martin Wimpress <code@wimpress.io>
Contributor
There was a problem hiding this comment.
2 issues found across 2 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/main.ts">
<violation number="1" location="src/main.ts:106">
P2: Falling back to `currentLanguage` here makes language overrides sticky: URLs without `?l=` cannot clear a previously persisted language.</violation>
</file>
<file name="AGENTS.md">
<violation number="1" location="AGENTS.md:128">
P3: The new translation guidance has an incorrect language count (`31`), which now conflicts with `src/i18n.ts` (33 entries per record). Update the count to prevent contributors from following stale i18n docs.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Signed-off-by: Martin Wimpress <code@wimpress.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Closes #7
Checklist