Skip to content

refactor: define the default option in adaptor/ instead of thunderbird/ - #59

Merged
snipsnipsnip merged 3 commits into
exteditor:mainfrom
snipsnipsnip:move-default-opts
Oct 26, 2026
Merged

snipsnipsnip merged 3 commits into
exteditor:mainfrom
snipsnipsnip:move-default-opts

Conversation

@snipsnipsnip

Copy link
Copy Markdown
Member

Preparation for adding more option items.

@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 283f85a6-0f3b-477a-b52a-4bf18e38d370
Commits

Reviewing files that changed from the base of the PR and between 519742c and b404e44.

Files selected for processing: 9
  • src/ghosttext-adaptor/client_options_loader.ts
  • src/root/background.ts
  • src/root/options.ts
  • src/root/startup/startup_background.ts
  • src/root/startup/startup_options.ts
  • src/test/sanity.test.ts
  • src/test/startup.test.ts
  • src/test/testbench/ghostbird.ts
  • src/thunderbird/options_util/options_store.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Summary

Summary by CodeRabbit

  • Improvements
    • The default connection port (4001) and enabled notifications setting are now consistently applied when initializing stored options in the background and settings experiences. This keeps default settings aligned across both parts of the app, while making the defaults configurable through shared startup settings. Existing saved option values are still handled by the options store.

The change exports stored-options defaults and passes them through background and options startup. OptionsStore now uses the supplied defaults when constructing OptionsSync. Startup tests and mocks provide the new dependency.

Changes: Stored options defaults

Layer / File(s) Summary
Define and consume defaults
src/ghosttext-adaptor/client_options_loader.ts, src/thunderbird/options_util/options_store.ts
The adaptor exports defaults with server port 4001 and notifications enabled. OptionsStore accepts these defaults and passes them to OptionsSync.
Pass defaults through startup
src/root/background.ts, src/root/options.ts, src/root/startup/startup_background.ts, src/root/startup/startup_options.ts, src/test/sanity.test.ts, src/test/startup.test.ts, src/test/testbench/ghostbird.ts
The startup contracts and entry points pass stored-options defaults. Tests and the background mock registry supply the new dependency. The background initializer imports AlarmHeart from its utility module.

Priority: Low

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

Change: Refactor

Possibly related PRs

  • exteditor/ghostbird#58: PR #58 adds the testbench mock that PR #59 updates to provide storedOptionsDefaults.
Merge Risk: Minimal · up to b404e

The default options are passed through both startup paths. No merge-blocking issue was identified.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Description check Warning The description states the general purpose of the change, but it omits the required current behavior, new behavior, manual testing steps, and contribution agreement sections from the template. Complete the template. Describe the current and new behavior, list manual verification steps, confirm the dual-license agreement, and add any relevant additional information.
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 9 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly and concisely describes the primary change: moving the default option definition from the Thunderbird layer to the adaptor layer.
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.
Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

A rabbit checks the port at four-oh-one,
And sets the default flags before the run.
Through startup paths the options hop,
To OptionsSync, where defaults drop.
The rabbit twitches, pleased to see,
Each mock now brings the needed key.

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

@codecov

codecov Bot commented Oct 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 61.29032% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 61.11%. Comparing base (519742c) to head (b404e44).
✅ All tests successful. No failed tests found.

Additional details and impacted files
Components Coverage Δ
app 64.33% <ø> (ø)
ghosttext 94.00% <100.00%> (+0.09%) ⬆️
infra 49.07% <25.00%> (-0.25%) ⬇️

@snipsnipsnip
snipsnipsnip added this pull request to the merge queue Oct 26, 2026
Merged via the queue into exteditor:main with commit bb5eaeb Oct 26, 2026
9 checks passed
@snipsnipsnip
snipsnipsnip deleted the move-default-opts branch October 26, 2026 07:15
@github-project-automation github-project-automation Bot moved this from 📥️Inbox to 🪺Experimental in Ghostbird Issues Oct 26, 2026
@snipsnipsnip snipsnipsnip moved this from 🪺Experimental to ✅Closed in Ghostbird Issues Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: ✅Closed

Development

Successfully merging this pull request may close these issues.

1 participant