Skip to content

Add Beta Features menu - #1860

Merged
wojtekn merged 7 commits into
trunkfrom
add/beta-features-menu
Oct 14, 2025
Merged

Add Beta Features menu#1860
wojtekn merged 7 commits into
trunkfrom
add/beta-features-menu

Conversation

@wojtekn

@wojtekn wojtekn commented Oct 8, 2025

Copy link
Copy Markdown
Contributor

Related issues

Proposed Changes

  • Added "Beta Features" menu to the app menu (available for all users, not just dev builds)
  • Beta features are disabled by default and saved in appdata-v1.json for cross-app/CLI access
  • Exposed "Studio Sites CLI" as the first beta feature
  • Updated CLI to check betaFeatures.studioSitesCli from appdata instead of ENABLE_CLI_V2 environment variable
  • Added "(Beta)" label to studio site command when the beta feature is enabled
Windows macOS
beta-features-menu-windows-after beta-features-menu-macos

Testing Instructions

Testing the Beta Features Menu

  1. Launch the Studio app
  2. Open the app menu (Studio menu on macOS, or File menu on other platforms)
  3. Find and click the "Beta Features" menu item
  4. You should see the "Studio Sites CLI" checkbox (unchecked by default)

Testing CLI Integration

  1. Build the CLI: npm run make
  2. Run CLI without beta feature: node dist/cli/main.js --help
    • Verify site command is NOT listed
  3. Enable beta feature in Studio app: Check "Beta Features → Studio Sites CLI"
  4. Run CLI again: node dist/cli/main.js --help
    • Verify site Manage local sites (Beta) command is now listed
  5. Test the command: node dist/cli/main.js site list
    • Should work if the beta feature is enabled

Verify Persistence

  1. Enable "Studio Sites CLI" in the app
  2. Quit and restart Studio
  3. Open Beta Features menu - checkbox should remain checked
  4. Check ~/Library/Application Support/Studio/appdata-v1.json (macOS) or equivalent
    • Should contain: "betaFeatures": { "studioSitesCli": true }

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?
@wojtekn wojtekn self-assigned this Oct 8, 2025
@wojtekn
wojtekn requested a review from a team October 8, 2025 15:58
@wojtekn
wojtekn marked this pull request as ready for review October 8, 2025 15:58

@bcotrim bcotrim left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as described and a nice addition in my opinion!
LGTM 👍

@wojtekn

wojtekn commented Oct 9, 2025

Copy link
Copy Markdown
Contributor Author

@bcotrim Thank you for your review. Your Feature Flags menu implementation paved the way. 🥳

@katinthehatsite katinthehatsite left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functionally, this works for me and I did not run into any issues 👍

I had one suggestion about the naming: to me, as a user with little context, it was not really clear what Studio Sites CLI did, especially since there was also Install CLI... command that was in the top menu. Perhaps we could improve the naming there

@wojtekn

wojtekn commented Oct 9, 2025

Copy link
Copy Markdown
Contributor Author

@katinthehatsite, do you see any short name we could use instead of the current one to make it more descriptive?

Alternatively, we could use the menu description. It looks like that on macOS:

Screenshot 2025-10-09 at 11 03 24

I'm unsure how it works on Windows, though.

@wojtekn
wojtekn force-pushed the add/beta-features-menu branch from 71d0094 to bb91703 Compare October 9, 2025 10:50
@github-actions

github-actions Bot commented Oct 9, 2025

Copy link
Copy Markdown
Contributor

📊 Performance Test Results

Comparing 7efcaac vs trunk

site-editor

Metric trunk 7efcaac Diff Change
load 11347.50 ms 10462.00 ms -885.50 ms 🟢 -7.8%

site-startup

Metric trunk 7efcaac Diff Change
siteCreation 13017.00 ms 13005.00 ms -12.00 ms 🟢 -0.1%
siteStartup 4919.00 ms 3946.00 ms -973.00 ms 🟢 -19.8%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change

@katinthehatsite

katinthehatsite commented Oct 9, 2025

Copy link
Copy Markdown
Contributor

Alternatively, we could use the menu description. It looks like that on macOS:

Oh I think this is very nice, let's do that. It would give users a brief idea of what the feature 👍 Worst case, we can try to limit it to Mac

@wojtekn

wojtekn commented Oct 9, 2025

Copy link
Copy Markdown
Contributor Author

I adjusted it for Windows, as it didn't look great with sublabel:

Before After
beta-features-menu-windows-before beta-features-menu-windows-after

@nightnei nightnei left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM and works as expected. Left just a few NIT comments
Screenshot 2025-10-10 at 17 26 09
Screenshot 2025-10-10 at 17 26 25
Screenshot 2025-10-10 at 17 27 35
Screenshot 2025-10-10 at 17 27 47

Comment thread src/ipc-types.d.ts
enableBlueprints: boolean;
}

// eslint-disable-next-line @typescript-eslint/no-empty-object-type

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems we don't need it. Also we can remove it from FeatureFlags.

Suggested change
// eslint-disable-next-line @typescript-eslint/no-empty-object-type

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wasn't it left here to limit the number of changes we need to make when we remove the last feature flag?

Comment thread src/lib/beta-features.ts Outdated
description?: string;
}

export const BETA_FEATURES_DEFINITION: Record< keyof BetaFeatures, BetaFeatureDefinition > = {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems it's not used outside

Suggested change
export const BETA_FEATURES_DEFINITION: Record< keyof BetaFeatures, BetaFeatureDefinition > = {
const BETA_FEATURES_DEFINITION: Record< keyof BetaFeatures, BetaFeatureDefinition > = {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, removed in d4e7aaa.

Comment thread src/lib/beta-features.ts Outdated
export const BETA_FEATURES: Record< keyof BetaFeatures, BetaFeatureDefinition > =
BETA_FEATURES_DEFINITION;

export function buildBetaFeatures( userData: BetaFeatures | undefined ): BetaFeatures {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
export function buildBetaFeatures( userData: BetaFeatures | undefined ): BetaFeatures {
function buildBetaFeatures( userData: BetaFeatures | undefined ): BetaFeatures {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in d4e7aaa

@wojtekn
wojtekn merged commit 0e50477 into trunk Oct 14, 2025
12 checks passed
@wojtekn
wojtekn deleted the add/beta-features-menu branch October 14, 2025 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants