Malarg commented on code in PR #24456:
URL: https://github.com/apache/beam/pull/24456#discussion_r1037875995


##########
playground/frontend/lib/pages/embedded_playground/components/embedded_actions.dart:
##########
@@ -58,16 +59,29 @@ class EmbeddedActions extends StatelessWidget {
   void _openStandalonePlayground(PlaygroundController controller) {
     // The empty list forces the parsing of EmptyExampleLoadingDescriptor
     // and prevents the glimpse of the default catalog example.
+
+    final descriptor = controller.getLoadingDescriptor();
+    final descriptors = descriptor.descriptors;
+    final urlDescriptors = descriptors.where((d) => d.canBePassedInUrl);
+    final jsDescriptors = descriptors.where((d) => !d.canBePassedInUrl);
+
+    final json = jsonEncode(
+      urlDescriptors.map((d) => d.toJson()).toList(growable: false),
+    );
     final window = html.window.open(
-      '/?$kExamplesParam=[]&$kSdkParam=${controller.sdk?.id}',
+      '/?$kExamplesParam=$json&$kSdkParam=${controller.sdk?.id}',
       '',
     );
 
-    javaScriptPostMessageRepeated(
-      window,
-      SetContentMessage(
-        descriptor: controller.getLoadingDescriptor(),
-      ),
-    );
+    if (jsDescriptors.isNotEmpty) {
+      javaScriptPostMessageRepeated(
+        window,
+        SetContentMessage(
+          descriptor: descriptor.copyWith(

Review Comment:
   Thanks, fixed



##########
playground/frontend/playground_components/lib/src/controllers/snippet_editing_controller.dart:
##########
@@ -45,16 +47,26 @@ class SnippetEditingController extends ChangeNotifier {
     _onSymbolsNotifierChanged();
   }
 
-  set selectedExample(Example? value) {
-    _selectedExample = value;
+  void configure({
+    required Example? example,
+    ExampleLoadingDescriptor? descriptor,
+    String? pipelineOptions,
+  }) {
+    _descriptor = descriptor ?? _descriptor;
+    _selectedExample = example ?? _selectedExample;
+    
+    if (example != null && descriptor == null) {
+      _descriptor = null;
+    }

Review Comment:
   fixed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to