Expose platform metadata on WaveEnv and preview mocks#3021
Merged
Conversation
Co-authored-by: sawka <2722291+sawka@users.noreply.github.com>
Co-authored-by: sawka <2722291+sawka@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add platform to WaveEnv and implement platform checks
Expose platform metadata on WaveEnv and preview mocks
Mar 9, 2026
Co-authored-by: sawka <2722291+sawka@users.noreply.github.com>
| electron: overrides.electron ? { ...previewElectronApi, ...overrides.electron } : previewElectronApi, | ||
| electron: { | ||
| ...previewElectronApi, | ||
| getPlatform: () => platform, |
Contributor
There was a problem hiding this comment.
WARNING: The getPlatform function should be defined AFTER the ...overrides.electron spread to ensure it always returns the correct platform value, even when users override other electron properties.
Currently, if a user passes getPlatform in overrides.electron, it will override the platform-based implementation. The correct order should be:
electron: {
...previewElectronApi,
...overrides.electron,
getPlatform: () => platform,
},
Contributor
Code Review SummaryStatus: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Files Reviewed (3 files)
|
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.
WaveEnv did not surface platform information, so platform-aware behavior could not be added through the shared environment contract. This updates the contract, production implementation, and preview mock to carry platform state without wiring it into any consumers yet.
WaveEnv contract
platform: NodeJS.PlatformisWindows()andisMacOS()helpersProduction implementation
platformfromPLATFORMinfrontend/util/platformutil.tsisWindows/isMacOSfrom the same utility intomakeWaveEnvImpl()Preview mock
platformoverride toMockEnvplatform,isWindows(), andisMacOS()on the mock envapplyMockEnvOverrides()Example:
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.