@@ -29,6 +29,12 @@ const UIStrings = {
2929 * @description Title shown when a feature is unavailable due to multiple React Native hosts.
3030 */
3131 multiHostFeatureUnavailableTitle : 'Feature is unavailable' ,
32+ /**
33+ * @description Message for the "settings changed" banner shown when a reload
34+ * is required for frame timings in the Performance panel.
35+ */
36+ reloadRequiredForTimelineFramesMessage :
37+ 'Frame timings and screenshots are now available in the Performance panel. Please reload to enable.' ,
3238 /**
3339 * @description Detail message shown when a feature is disabled due to multiple React Native hosts.
3440 */
@@ -75,7 +81,7 @@ export class FuseboxFeatureObserver implements
7581 #handleMetadataUpdated(
7682 event : Common . EventTarget . EventTargetEvent < Protocol . ReactNativeApplication . MetadataUpdatedEvent > ) : void {
7783 // eslint-disable-next-line @typescript-eslint/naming-convention
78- const { unstable_isProfilingBuild, unstable_networkInspectionEnabled} = event . data ;
84+ const { unstable_isProfilingBuild, unstable_networkInspectionEnabled, unstable_frameRecordingEnabled } = event . data ;
7985
8086 if ( unstable_isProfilingBuild ) {
8187 FuseboxWindowTitleManager . instance ( ) . setSuffix ( '[PROFILING]' ) ;
@@ -87,6 +93,10 @@ export class FuseboxFeatureObserver implements
8793 if ( ! unstable_networkInspectionEnabled && ! Root . Runtime . conditions . reactNativeExpoNetworkPanel ( ) ) {
8894 this . #hideNetworkPanel( ) ;
8995 }
96+
97+ if ( unstable_frameRecordingEnabled ) {
98+ void this . #ensureTimelineFramesEnabled( ) ;
99+ }
90100 }
91101
92102 #handleSystemStateChanged(
@@ -132,6 +142,14 @@ export class FuseboxFeatureObserver implements
132142 } ) ;
133143 }
134144
145+ async #ensureTimelineFramesEnabled( ) : Promise < void > {
146+ if ( ! Root . Runtime . experiments . isEnabled ( Root . Runtime . RNExperimentName . ENABLE_TIMELINE_FRAMES ) ) {
147+ Root . Runtime . experiments . setEnabled ( Root . Runtime . RNExperimentName . ENABLE_TIMELINE_FRAMES , true ) ;
148+ UI . InspectorView ?. InspectorView ?. instance ( ) ?. displayReloadRequiredWarning (
149+ i18nString ( UIStrings . reloadRequiredForTimelineFramesMessage ) ) ;
150+ }
151+ }
152+
135153 #disableSingleHostOnlyFeatures( ) : void {
136154 if ( this . #singleHostFeaturesDisabled) {
137155 return ;
0 commit comments