alexeyinkin commented on code in PR #26964:
URL: https://github.com/apache/beam/pull/26964#discussion_r1212966881
##########
learning/tour-of-beam/frontend/integration_test/tour_page_test.dart:
##########
@@ -238,7 +239,7 @@ Future<void> _selectExampleWithSnippet(WidgetTester wt)
async {
for (final node in module.nodes) {
Review Comment:
Rename the function to `_selectUnitWithSnippet`?
Try to walk the tree.
##########
learning/tour-of-beam/frontend/lib/pages/tour/controllers/content_tree.dart:
##########
@@ -49,7 +49,6 @@ class ContentTreeController extends ChangeNotifier {
_onContentTreeCacheChange();
}
- Sdk get sdk => GetIt.instance.get<AppNotifier>().sdk ?? initialSdk;
Review Comment:
Delete `initialSdk` entirely?
##########
learning/tour-of-beam/frontend/lib/pages/tour/screen.dart:
##########
@@ -87,18 +87,19 @@ class _UnitContentWidget extends StatelessWidget {
return AnimatedBuilder(
animation: tourNotifier,
builder: (context, widget) {
- return !tourNotifier.isUnitContainsSnippet
- ? UnitContentWidget(tourNotifier)
- : SplitView(
+ return tourNotifier.showPlayground
+ ? SplitView(
direction: Axis.horizontal,
dragHandleKey: TourScreen.dragHandleKey,
first: UnitContentWidget(tourNotifier),
- second: tourNotifier.isSnippetLoading
+ second: tourNotifier.currentUnitContent == null ||
+ tourNotifier.isSnippetLoading
? const Center(child: CircularProgressIndicator())
: PlaygroundWidget(
tourNotifier: tourNotifier,
),
Review Comment:
Extract.
##########
learning/tour-of-beam/frontend/lib/state.dart:
##########
@@ -31,21 +31,17 @@ class AppNotifier extends ChangeNotifier {
unawaited(_readSdk());
}
- Sdk? get sdk => _sdk;
+ Sdk get sdk => _sdk ?? Sdk.java;
Review Comment:
Make the global `defaultSdk` constant.
##########
learning/tour-of-beam/frontend/lib/pages/tour/state.dart:
##########
@@ -62,7 +63,7 @@ class TourNotifier extends ChangeNotifier with
PageStateMixin<void> {
initialBreadcrumbIds: initialBreadcrumbIds,
),
playgroundController = _createPlaygroundController(initialSdk.id) {
- _appNotifier.sdk ??= initialSdk;
+ _appNotifier.sdk = initialSdk;
Review Comment:
Delete `initialSdk` entirely?
##########
learning/tour-of-beam/frontend/lib/pages/tour/state.dart:
##########
@@ -49,6 +49,7 @@ class TourNotifier extends ChangeNotifier with
PageStateMixin<void> {
final _unitContentCache = GetIt.instance.get<UnitContentCache>();
final _unitProgressCache = GetIt.instance.get<UnitProgressCache>();
UnitContentModel? _currentUnitContent;
+ UnitContentModel? _previousUnitContent;
Review Comment:
```suggestion
bool _isPlaygroundShown = false;
```
--
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]