Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
933bb24
Integration test to load the default example of the default SDK and c…
alexeyinkin Dec 20, 2022
acd76ef
Fix formatting and README (#24730)
alexeyinkin Dec 20, 2022
07e78c6
Support collection v1.17.0 (#24730)
alexeyinkin Dec 21, 2022
5ffd808
LoadingIndicator on chaning examples, remove duplicating licenses (#2…
alexeyinkin Dec 21, 2022
9bb0268
Add a missing license header (#24730)
alexeyinkin Dec 21, 2022
27c870c
Merge branch 'master' into issue24730_integration_changing-example
alexeyinkin Dec 23, 2022
e888e27
Integration test for changing SDK and running code (#24779) (#382)
alexeyinkin Dec 28, 2022
cc8a998
Merge branch 'master' into issue24730_integration_changing-example
alexeyinkin Jan 4, 2023
9c16c66
Issue24779 integration changing sdk from 24370 (#387)
alexeyinkin Jan 4, 2023
8d4f85f
integration tests run and editing
Malarg Jan 12, 2023
d9c23a6
Merge branch 'master' into playground_integration_test_run_and_editing
Malarg Jan 12, 2023
7dbd08b
example selector test
Malarg Jan 17, 2023
4fe215d
minor fixes
Malarg Jan 17, 2023
0e2a469
rat
Malarg Jan 17, 2023
a33d058
fix pr
Malarg Jan 24, 2023
b350351
minor
Malarg Jan 24, 2023
a9a5e88
Merge branch 'master' into playground_integration_test_run_and_editing
Malarg Jan 24, 2023
01fe5a7
minor
Malarg Jan 24, 2023
4275eb6
rat
Malarg Jan 24, 2023
7316da0
integration test finder written
Malarg Jan 26, 2023
17b767a
Merge branch 'master' into playground_integration_test_run_and_editing
Malarg Jan 26, 2023
c8deff8
integration test minor fixes
Malarg Jan 26, 2023
e3fcab5
minor fixes
Malarg Jan 26, 2023
77f372f
removed comment
Malarg Jan 26, 2023
52ad461
minor fixes
Malarg Jan 27, 2023
63f8faa
Merge branch 'master' into playground_integration_test_run_and_editing
Malarg Jan 27, 2023
b047239
playground integration tests minor fixes
Malarg Jan 30, 2023
5514e59
integration test pumpAnSettleNoException
Malarg Jan 31, 2023
305e4cd
integration test shortcut refactor
Malarg Jan 31, 2023
01a0659
integration test another changing shortcuts running
Malarg Jan 31, 2023
014906f
upgrade to flutter 3.7.1
Malarg Feb 6, 2023
e527f59
workaround comment
Malarg Feb 6, 2023
7f9adc0
playground frontend updated major versions
Malarg Feb 7, 2023
d4fd93f
issues 25329 25331 25336
Malarg Feb 9, 2023
488f8d3
Merge branch 'master' into issue25329_fix-cors-issue-when-no-internet
Malarg Feb 9, 2023
8034768
25329 extract connectivity extension to separate file
Malarg Feb 9, 2023
53e09ca
Merge remote-tracking branch 'apache/master' into playground_integrat…
alexeyinkin Feb 14, 2023
e77ffaf
Upgrade Flutter to 3.7.3 in integration tests (#24730)
alexeyinkin Feb 14, 2023
a90fbbf
Fix integration test (#24730)
alexeyinkin Feb 14, 2023
72a0ed3
Merge remote-tracking branch 'origin/issue25337_flutter371' into play…
alexeyinkin Feb 14, 2023
916a966
fix cors issue and added mouse scroll to tags
Malarg Feb 14, 2023
cd83c1f
Upgrade Flutter in Dockerfile (#24720)
alexeyinkin Feb 14, 2023
ffa95e7
sorting moved to model
Malarg Feb 15, 2023
eb33795
sorting moved to model
Malarg Feb 15, 2023
399a80a
sorting moved to model
Malarg Feb 15, 2023
0fe9113
Merge branch 'master' into playground_integration_test_run_and_editing
Malarg Feb 16, 2023
6080a4b
bugs fix
Malarg Feb 16, 2023
b7b14b4
issue 25278
Malarg Feb 16, 2023
2ca302e
fix pr
Malarg Feb 17, 2023
781de4f
quites fix in en.yaml
Malarg Feb 17, 2023
694e22e
Fix not loading default example (#25528)
alexeyinkin Feb 17, 2023
284ed49
Merge branch 'master' into issue25329
Malarg Feb 17, 2023
ccf8c3b
Merge branch 'playground_integration_test_run_and_editing' into issue…
Malarg Feb 17, 2023
03f7a5f
Merge branch 'master' into playground_integration_test_run_and_editing
Malarg Feb 17, 2023
28449be
Merge branch 'playground_integration_test_run_and_editing' into issue…
Malarg Feb 17, 2023
6e4581b
fix compile error
Malarg Feb 17, 2023
3aa9fec
Refactor output tabs, test embedded playground (#25136) (#439)
alexeyinkin Feb 21, 2023
1e17d04
Change example paths to IDs in integration tests
alexeyinkin Feb 24, 2023
dd1d275
Merge branch 'master' into playground_integration_test_run_and_editing
Malarg Mar 1, 2023
08fb4ac
issue25731 shortcut keys sequence
Malarg Mar 6, 2023
7865e94
Update playground/frontend/playground_components/test/src/models/shor…
Malarg Mar 7, 2023
b70d080
issue25731 fix shortcut modal width, fix shortcut meta key text
Malarg Mar 7, 2023
a19fd61
issue25731 fix shortcut modal window
Malarg Mar 10, 2023
b79ce1c
merge from master
Malarg Mar 10, 2023
9ecae3c
issue25731 pr fix
Malarg Mar 10, 2023
a5de7f4
issue25731 fix pr
Malarg Mar 16, 2023
18685af
issue25731 remane file
Malarg Mar 16, 2023
b31f5c4
fix test
Malarg Mar 17, 2023
543316f
Merge branch 'master' into issue25731_beam_shortcut_key_sequence
Malarg Mar 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import 'package:playground/modules/examples/components/description_popover/descr
import 'package:playground/modules/examples/example_selector.dart';
import 'package:playground/modules/sdk/components/sdk_selector.dart';
import 'package:playground/modules/sdk/components/sdk_selector_row.dart';
import 'package:playground/modules/shortcuts/components/shortcuts_modal.dart';
import 'package:playground/modules/shortcuts/components/shortcuts_dialog.dart';
import 'package:playground/pages/standalone_playground/widgets/editor_textarea_wrapper.dart';
import 'package:playground/pages/standalone_playground/widgets/feedback/feedback_dropdown_content.dart';
import 'package:playground/pages/standalone_playground/widgets/feedback/playground_feedback.dart';
Expand Down Expand Up @@ -117,6 +117,6 @@ extension CommonFindersExtension on CommonFinders {
}

Finder shortcutsModal() {
return byType(ShortcutsModal);
return byType(ShortcutsDialogContent);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Future<void> checkShortcutsModal(WidgetTester wt) async {

expect(find.shortcutsModal(), findsOneWidget);

await wt.tap(find.text(appLocale.close));
await wt.sendKeyEvent(LogicalKeyboardKey.escape);
await wt.pumpAndSettle();

expect(find.shortcutsModal(), findsNothing);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ Future<void> _checkAutocomplete(WidgetTester wt) async {
await wt.enterCodeFieldText('\n\n\n\n\nsdk');

final playgroundController = wt.findPlaygroundController();
await wt.runShortcut(
playgroundController.showSuggestionsShortcut.shortcuts,
);
await wt.runShortcut(playgroundController.showSuggestionsShortcut);
await wt.pumpAndSettle();

expect(find.text('sdkHttpMetadata'), findsOneWidget);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Future<void> _checkResetShortcut(

expect(controller.source, isNot(startSource));

await wt.runShortcut(controller.resetShortcut.shortcuts);
await wt.runShortcut(controller.resetShortcut);
await wt.pumpAndSettle();

expect(startSource, controller.source);
Expand All @@ -61,7 +61,7 @@ Future<void> _checkRunShortcut(
PlaygroundController controller,
) async {
final output = controller.codeRunner.resultLogOutput;
await wt.runShortcut(controller.runShortcut.shortcuts);
await wt.runShortcut(controller.runShortcut);
await wt.pumpAndSettle();

expect(output, isNot(controller.codeRunner.resultLogOutput));
Expand All @@ -74,7 +74,7 @@ Future<void> _checkClearOutputShortcut(
expect(controller.codeRunner.resultLogOutput, isNotEmpty);
expect(controller.codeRunner.resultLogOutput, isNotNull);

await wt.runShortcut(kClearOutputShortcut.shortcuts);
await wt.runShortcut(kClearOutputShortcut);
await wt.pumpAndSettle();

expect(controller.codeRunner.resultLogOutput, isEmpty);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/*
* 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:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:playground/constants/font_weight.dart';
import 'package:playground/constants/sizes.dart';
import 'package:playground/modules/shortcuts/components/shortcut_row.dart';
import 'package:playground/modules/shortcuts/constants/global_shortcuts.dart';
import 'package:playground_components/playground_components.dart';

class ShortcutsDialogContent extends StatelessWidget {
static const _kModalMaxWidth = 400.0;
static const _kShortcutsMaxWidth = 200.0;

const ShortcutsDialogContent({
required this.playgroundController,
});

final PlaygroundController playgroundController;

@override
Widget build(BuildContext context) {
return SizedBox(
width: _kModalMaxWidth,
child: Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisSize: MainAxisSize.min,
children: [
...[
...playgroundController.shortcuts,
...globalShortcuts,
]
.map(
(shortcut) => Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
ConstrainedBox(
constraints:
const BoxConstraints(maxWidth: _kShortcutsMaxWidth),
child: ShortcutRow(shortcut: shortcut),
),
const SizedBox(width: kMdSpacing),
Expanded(
child: Text(
shortcut.actionIntent.slug.tr(),
style: const TextStyle(fontWeight: kBoldWeight),
),
),
],
),
)
.alternateWith(
const SizedBox(
height: kXlSpacing,
),
),
],
),
);
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ class NewExampleIntent extends BeamIntent {
}

final kClearOutputShortcut = BeamShortcut(
shortcuts: LogicalKeySet(
keys: [
LogicalKeyboardKeyExtension.metaOrControl,
LogicalKeyboardKey.keyB,
),
],
actionIntent: const ClearOutputIntent(),
createAction: (BuildContext context) => CallbackAction(
onInvoke: (_) => Provider.of<PlaygroundController>(
Expand All @@ -45,10 +45,10 @@ final kClearOutputShortcut = BeamShortcut(
);

final kNewExampleShortcut = BeamShortcut(
shortcuts: LogicalKeySet(
keys: [
LogicalKeyboardKeyExtension.metaOrControl,
LogicalKeyboardKey.keyM,
),
],
actionIntent: const NewExampleIntent(),
createAction: (_) => CallbackAction(
onInvoke: (_) => launchUrl(Uri.parse('/')),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import 'package:url_launcher/url_launcher.dart';

import '../../../constants/links.dart';
import '../../../modules/analytics/analytics_service.dart';
import '../../../modules/shortcuts/components/shortcuts_modal.dart';
import '../../../modules/shortcuts/components/shortcuts_dialog.dart';
import '../../../src/assets/assets.gen.dart';

enum HeaderAction {
Expand Down Expand Up @@ -85,9 +85,11 @@ class _MoreActionsState extends State<MoreActions> {
title: Text(appLocale.shortcuts),
onTap: () {
AnalyticsService.get(context).trackOpenShortcutsModal();
showDialog<void>(
BeamDialog.show(
actions: [BeamCloseButton()],
context: context,
builder: (BuildContext context) => ShortcutsModal(
title: Text(appLocale.shortcuts),
child: ShortcutsDialogContent(
playgroundController: widget.playgroundController,
),
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ widgets:

codeEditor:
label: 'Code Text Area'

closeButton:
label: 'Close'

output:
filter:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,14 @@ export 'src/services/symbols/loaders/yaml.dart';
export 'src/theme/switch_notifier.dart';
export 'src/theme/theme.dart';
export 'src/util/async.dart';
export 'src/util/iterable.dart';
export 'src/util/logical_keyboard_key.dart';
export 'src/util/pipeline_options.dart';
export 'src/util/string.dart';

export 'src/widgets/bubble.dart';
export 'src/widgets/clickable.dart';
export 'src/widgets/close_button.dart';
export 'src/widgets/complexity.dart';
export 'src/widgets/dialog.dart';
export 'src/widgets/divider.dart';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,34 +312,34 @@ class PlaygroundController with ChangeNotifier {
}

late BeamShortcut runShortcut = BeamShortcut(
shortcuts: LogicalKeySet(
keys: [
LogicalKeyboardKeyExtension.metaOrControl,
LogicalKeyboardKey.enter,
),
],
actionIntent: const RunIntent(),
createAction: (BuildContext context) => CallbackAction(
onInvoke: (_) => codeRunner.runCode(),
),
);

late BeamShortcut resetShortcut = BeamShortcut(
shortcuts: LogicalKeySet(
keys: [
LogicalKeyboardKeyExtension.metaOrControl,
LogicalKeyboardKey.shift,
LogicalKeyboardKey.keyE,
),
],
actionIntent: const ResetIntent(),
createAction: (BuildContext context) => CallbackAction(
onInvoke: (_) => reset(),
),
);

late BeamShortcut showSuggestionsShortcut = BeamShortcut(
shortcuts: LogicalKeySet(
keys: [
LogicalKeyboardKeyExtension.metaOrControl,
LogicalKeyboardKey.shift,
LogicalKeyboardKey.keyS,
),
],
actionIntent: const ShowSuggestionsIntent(),
createAction: (BuildContext context) => CallbackAction(
onInvoke: (_) => showSuggestions(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,32 @@ import 'package:flutter/services.dart';
import 'intents.dart';

class BeamShortcut {
final LogicalKeySet shortcuts;
// Keys in the order to be shown or mocked.
//
// A list is required because a [LogicalKeySet] discards the original order.
final List<LogicalKeyboardKey> keys;

LogicalKeySet get keySet => LogicalKeySet.fromSet(keys.toSet());

final BeamIntent actionIntent;
final CallbackAction Function(BuildContext) createAction;

BeamShortcut({
required this.shortcuts,
required this.keys,
required this.actionIntent,
required this.createAction,
});

static const _metaKeyName = 'CMD/CTRL';
static const _metaKeyName = 'Command';
static const _glue = ' + ';

String get title {
return shortcuts.keys
.map(getKeyDisplayName)
return keys
.map(_getKeyDisplayName)
.join(_glue);
}

String getKeyDisplayName(LogicalKeyboardKey e) {
String _getKeyDisplayName(LogicalKeyboardKey e) {
if (e.keyId == LogicalKeyboardKey.meta.keyId) {
return _metaKeyName;
}
Expand Down
Loading