Skip to content

[client] Add theme preference store coverage - #7555

Open
TechHutTV wants to merge 1 commit into
mainfrom
feat/preferences-theme-coverage
Open

TechHutTV wants to merge 1 commit into
mainfrom
feat/preferences-theme-coverage

Conversation

@TechHutTV

@TechHutTV TechHutTV commented Sep 15, 2026

Copy link
Copy Markdown
Collaborator

Describe your changes

The preferences store now has focused regression coverage for theme defaults, valid and invalid persisted values, persistence across reloads, subscriber broadcasts, and idempotent updates. These tests protect the existing theme preference behavior without changing production code.

Relates to #7344

Issue ticket number and link

Not applicable: test-only coverage; no behavior changes.

Stack

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is it a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • I ran and tested this change locally — I did not rely on CI to find out whether it works
  • This PR has a single purpose (not a fix + refactor + feature in one)
  • This change is a trivial fix, OR it links an issue the NetBird team agreed on beforehand. Changes to the public API, gRPC protocols, functionality behavior, CLI / service flags, or new features always need that agreement first. See CONTRIBUTING.md.

By submitting this pull request, you confirm that you have read and agree to the terms of the Contributor License Agreement.

Documentation

Select exactly one:

  • I added/updated documentation for this change
  • Documentation is not needed for this change (explain why)

This PR adds tests only and does not change user-facing behavior or documentation.

Docs PR URL (required if "docs added" is checked)

Paste the PR link from https://github.com/netbirdio/docs here:

https://github.com/netbirdio/docs/pull/__

Review in cubic

Summary by CodeRabbit

  • Tests
    • Expanded coverage for theme preference behavior, including system defaults, light and dark themes, and settings loaded from existing files.
    • Added validation for unsupported or unknown theme values, ensuring they fall back safely or are rejected as appropriate.
    • Verified that theme changes persist across reloads, notify the application once, and avoid duplicate notifications when unchanged.

@coderabbitai

coderabbitai Bot commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 2cc6e63d-5809-46d7-a338-a5f61cb09b08

📥 Commits

Reviewing files that changed from the base of the PR and between 08699a9 and c403c7e.

📒 Files selected for processing (1)
  • client/ui/preferences/store_test.go

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The preferences store tests now cover theme defaults, stored values, updates, persistence, broadcasts, idempotency, and rejection of unsupported values.

Changes

Preference theme behavior

Layer / File(s) Summary
Theme loading and defaults
client/ui/preferences/store_test.go
Tests verify ThemeSystem defaults for missing and corrupt files, legacy files without a theme, unknown values, and valid stored themes.
Theme mutation and persistence
client/ui/preferences/store_test.go
Tests verify supported theme updates, persistence across reloads, one change broadcast, idempotent updates, and ErrUnsupportedTheme handling.

Suggested reviewers: mlsmaycon

Priority: ⬇️ Low

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

Change: Other

Merge Risk: ⚪ Minimal · up to c403c

The added tests cover theme defaults, persistence, notifications, and validation without changing production behavior. The change is ready to merge.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the addition of theme preference store test coverage.
Description check ✅ Passed The description follows the repository template, explains the test-only scope, identifies the related pull request, records the relevant checklist items, and explains why documentation is not needed.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/preferences-theme-coverage

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.

@sonarqubecloud

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai 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.

No issues found across 1 file

Re-trigger cubic

@github-actions

Copy link
Copy Markdown

Release artifacts

Built for PR head c403c7e in workflow run #19010.

Artifact Link
All release artifacts Download
Linux packages Download
Windows packages Download
macOS packages Download
UI artifacts Download
UI GTK3 artifacts Download
UI macOS artifacts Download

GHCR images (amd64)

This comment is updated by the Release workflow. Artifact links expire according to the workflow retention policy.

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.

1 participant