Skip to content

mock out settings better (use default config)#3022

Merged
sawka merged 1 commit intomainfrom
sawka/mock-settings
Mar 10, 2026
Merged

mock out settings better (use default config)#3022
sawka merged 1 commit intomainfrom
sawka/mock-settings

Conversation

@sawka
Copy link
Member

@sawka sawka commented Mar 9, 2026

No description provided.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 9, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 44fb63a7-4f3c-4120-978d-1e0dfd4ac5f0

📥 Commits

Reviewing files that changed from the base of the PR and between 1aee6e2 and 44cb258.

📒 Files selected for processing (2)
  • frontend/preview/mock/defaultconfig.ts
  • frontend/preview/mock/mockwaveenv.ts

Walkthrough

A new configuration module is introduced (defaultconfig.ts) that assembles default configuration by importing pre-built JSON files into a DefaultFullConfig constant. Simultaneously, mockwaveenv.ts is refactored to shift from config-centric to settings-centric overrides: the MockEnv type field is renamed from config to settings, and the makeMockGlobalAtoms function signature is expanded to accept settingsOverrides as a first parameter before atomOverrides. Internal wiring is updated to use the new DefaultFullConfig and process configuration through settings overrides instead of config overrides.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive No description was provided by the author, making it impossible to assess relatedness to the changeset. Add a pull request description explaining the motivation and benefits of refactoring the mock settings to use default config.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: refactoring mock settings to use a default config structure for better test mocking.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch sawka/mock-settings

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 and usage tips.

@kilo-code-bot
Copy link
Contributor

kilo-code-bot bot commented Mar 9, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • frontend/preview/mock/defaultconfig.ts - New file providing default configuration
  • frontend/preview/mock/mockwaveenv.ts - Updated to use full config with proper atom derivation

Review Notes:

The PR introduces a DefaultFullConfig that provides the complete configuration structure for preview mode, allowing the mock environment to work with full configuration rather than just settings. The changes are well-implemented:

  1. The new defaultconfig.ts file properly imports and exports default configuration from JSON files
  2. The MockEnv type field was renamed from config to settings for clarity (no external usages found)
  3. The atom derivation pattern is correct, properly creating fullConfigAtom and deriving settingsAtom from it

No security vulnerabilities, runtime errors, or logic bugs were identified.

@cloudflare-workers-and-pages
Copy link

Deploying waveterm with  Cloudflare Pages  Cloudflare Pages

Latest commit: 44cb258
Status: ✅  Deploy successful!
Preview URL: https://6f861b9b.waveterm.pages.dev
Branch Preview URL: https://sawka-mock-settings.waveterm.pages.dev

View logs

@sawka sawka merged commit f5480cb into main Mar 10, 2026
8 checks passed
@sawka sawka deleted the sawka/mock-settings branch March 10, 2026 00:04
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