Skip to content

fix(settings): merge defaults into stored settings to fix options pag… - #1371

Merged
VampireChicken12 merged 1 commit into
mainfrom
dev
Aug 20, 2026
Merged

fix(settings): merge defaults into stored settings to fix options pag…#1371
VampireChicken12 merged 1 commit into
mainfrom
dev

Conversation

@VampireChicken12

@VampireChicken12 VampireChicken12 commented Aug 20, 2026

Copy link
Copy Markdown
Member

…e crash (#1370)

Deep-merge the default configuration into stored settings when loading them on the options page and in the content script, and restore the defaults merge on background load removed in 82047c6. Newly added nested settings (e.g. videosPerRow.videosPerRow) are now always populated, preventing the NumberInput 'Cannot read properties of undefined' crash that stopped the options page from opening.

Summary by CodeRabbit

  • Bug Fixes
    • Improved settings loading to preserve default values when stored settings are incomplete.
    • Ensured settings are initialized with defaults when the application starts.
    • Added error logging for failures during default settings initialization.

…e crash (#1370)

Deep-merge the default configuration into stored settings when loading
them on the options page and in the content script, and restore the
defaults merge on background load removed in 82047c6. Newly added
nested settings (e.g. videosPerRow.videosPerRow) are now always
populated, preventing the NumberInput 'Cannot read properties of
undefined' crash that stopped the options page from opening.
@VampireChicken12
VampireChicken12 merged commit ca5ee13 into main Aug 20, 2026
5 of 6 checks passed
@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 519915ac-83d2-413e-b04b-34aeb486455a

📥 Commits

Reviewing files that changed from the base of the PR and between a06c4c6 and dbf88ff.

📒 Files selected for processing (3)
  • src/components/Settings/Settings.tsx
  • src/defaults.ts
  • src/pages/content/index.ts

Walkthrough

Settings retrieval now deep-merges stored values with default configuration values. Default values also initialize at startup, with failures logged to the console.

Changes

Settings defaults and loading

Layer / File(s) Summary
Default value initialization
src/defaults.ts
Startup execution calls setDefaultValues() and logs caught failures with the [defaults] prefix.
Deep-merged settings retrieval
src/components/Settings/Settings.tsx, src/pages/content/index.ts
Settings retrieval merges stored values over the default configuration before returning or resolving the result.

Estimated code review effort: 2 (Simple) | ~10 minutes

Poem

I’m a rabbit with settings to store,
Defaults now fill what was missing before.
Deep merges hop through each saved key,
Startup logs errors for all to see.
Thump, thump! The config is ready.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-project-automation github-project-automation Bot moved this from Todo to Done - Released in YouTube Enhancer Aug 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.34.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

Status: Done - Released

Development

Successfully merging this pull request may close these issues.

1 participant