alexeyinkin commented on code in PR #25397:
URL: https://github.com/apache/beam/pull/25397#discussion_r1106797494


##########
playground/frontend/lib/modules/examples/components/web_scroll_converter.dart:
##########
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import 'package:flutter/gestures.dart';
+import 'package:flutter/widgets.dart';
+
+/// For web, listens for mouse scroll events and adds dy
+/// to the given controller.
+///
+/// Use this to scroll horizontal lists that would otherwise not scroll
+/// because mouse wheel only scrolls vertically.
+///
+/// This widget appears to has no effect on swipe scrolling on mobile 
platforms.
+class WebScrollConverterWidget extends StatelessWidget {
+  final ScrollController scrollController;
+  final Widget child;
+
+  const WebScrollConverterWidget({
+    required this.scrollController,
+    required this.child,
+  });

Review Comment:
   Sort.



##########
playground/frontend/lib/modules/examples/components/web_scroll_converter.dart:
##########
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import 'package:flutter/gestures.dart';
+import 'package:flutter/widgets.dart';
+
+/// For web, listens for mouse scroll events and adds dy
+/// to the given controller.
+///
+/// Use this to scroll horizontal lists that would otherwise not scroll
+/// because mouse wheel only scrolls vertically.
+///
+/// This widget appears to has no effect on swipe scrolling on mobile 
platforms.
+class WebScrollConverterWidget extends StatelessWidget {
+  final ScrollController scrollController;
+  final Widget child;
+
+  const WebScrollConverterWidget({
+    required this.scrollController,
+    required this.child,
+  });
+
+  @override
+  Widget build(BuildContext context) {
+    return Listener(
+      onPointerSignal: (pointerSignal) {
+        if (pointerSignal is PointerScrollEvent) {
+          final delta = pointerSignal.scrollDelta.dy;
+          final overscroll = scrollController.position.animateTo(
+            scrollController.position.pixels + delta,
+            duration: const Duration(milliseconds: 100),
+            curve: Curves.linear,
+          );
+          print(overscroll);

Review Comment:
   Delete.



##########
playground/frontend/lib/modules/examples/components/filter/filter.dart:
##########
@@ -77,22 +78,29 @@ class _Types extends StatelessWidget {
 }
 
 class _Tags extends StatelessWidget {
-  const _Tags();
+  final ScrollController scrollController = ScrollController();

Review Comment:
   Private?



##########
playground/frontend/playground_components/lib/src/repositories/models/run_code_result.dart:
##########
@@ -33,13 +33,13 @@ enum RunCodeStatus {
 }
 
 const kFinishedStatuses = [
-  RunCodeStatus.unknownError,
-  RunCodeStatus.timeout,
   RunCodeStatus.compileError,
+  RunCodeStatus.finished,
+  RunCodeStatus.preparationError,
   RunCodeStatus.runError,
+  RunCodeStatus.timeout,
+  RunCodeStatus.unknownError,
   RunCodeStatus.validationError,
-  RunCodeStatus.preparationError,
-  RunCodeStatus.finished,

Review Comment:
   Revert.



##########
playground/frontend/playground_components/assets/translations/en.yaml:
##########
@@ -17,12 +17,16 @@
 
 errors:
   error: 'Error'
+  failedParseOptions: "Failed to parse pipeline options, please check the 
format (example: --key1 value1 --key2 value2), only alphanumeric and 
\",*,/,-,:,;,',. symbols are allowed"

Review Comment:
   Single quotes?



##########
playground/frontend/lib/modules/examples/components/web_scroll_converter.dart:
##########
@@ -0,0 +1,55 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import 'package:flutter/gestures.dart';
+import 'package:flutter/widgets.dart';
+
+/// For web, listens for mouse scroll events and adds dy
+/// to the given controller.
+///
+/// Use this to scroll horizontal lists that would otherwise not scroll
+/// because mouse wheel only scrolls vertically.
+///
+/// This widget appears to has no effect on swipe scrolling on mobile 
platforms.

Review Comment:
   Delete?



##########
playground/frontend/lib/pages/standalone_playground/notifiers/example_selector_state.dart:
##########
@@ -47,14 +47,28 @@ class ExampleSelectorState with ChangeNotifier {
 
   void addSelectedTag(String tag) {
     selectedTags.add(tag);
+    _sortTagsBySelected();
     notifyListeners();
   }
 
   void removeSelectedTag(String tag) {
     selectedTags.remove(tag);
+    _sortTagsBySelected();
     notifyListeners();
   }
 
+  void _sortTagsBySelected() {
+    tags.sort((a, b) {
+      if (selectedTags.contains(a) && !selectedTags.contains(b)) {
+        return -1;
+      } else if (!selectedTags.contains(a) && selectedTags.contains(b)) {
+        return 1;
+      } else {
+        return 0;

Review Comment:
   Sort by frequency as we did before?



##########
playground/frontend/playground_components/lib/src/controllers/code_runner.dart:
##########
@@ -122,8 +135,21 @@ class CodeRunner extends ChangeNotifier {
   }
 
   Future<void> cancelRun() async {
+    final hasInternet = (await Connectivity().checkConnectivity()).isConnected;
+    if (!hasInternet) {
+      _result = RunCodeResult(
+        status: _result?.status ?? RunCodeStatus.unspecified,
+        output: _result?.output,
+        log: _result?.log ?? '',
+        errorMessage: 'errors.internetUnavailable'.tr(),
+        graph: _result?.graph,
+      );
+      notifyListeners();
+      return;
+    }
+
     snippetEditingController = null;
-    await _runSubscription?.cancel();
+    unawaited(_runSubscription?.cancel());

Review Comment:
   Explain in a comment, add a TODO, link to an issue.



-- 
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