feat: [BoardEditor] add reset board and starting position option
Implements #1010
Screenshot:
Should I also add an option to Load from FEN?
These new buttons should not be placed here, and should not look like a chip. They are action buttons (clear board) where the other ones are toggles on the current position.
We should rearrange as follow imo:
- add a 'menu' button (menu icon 3 bars as in game screen)
- flip board, clear board and reset board should be part of this new menu
- the actual
BoardEditorMenushould be renamedBoardEditorPositionSettings - the button icon for the position settings should be changed to a 'settings' (cog) icon
Should I also add an option to
Load from FEN
We could, but we already have the "Load position" screen which achieves the same.
More interesting is to add the choice picker to choose a preconfigured opening or endgame position like in the website.
Made the suggested changes. Screenshots:
While we're modifying menu(now settings), I also think we should move the castling options around for better clarity. I would suggest something like this:
More interesting is to add the choice picker to choose a preconfigured opening or endgame position like in the website.
A separate issue is raised for this. I can pick this separately.
I'm not sure about the settings icon on the top nav bar.
I'd expect these settings to be configuration for the board editor itself (like configuring behavior of the editor), and they actually are position related, switches to change the FEN output.
So the button should not be placed on top imo, but I agree that the settings (cog) icon is not a good choice either. Maybe we should just revert to the 'tune' icon and put it back at the bottom. Not entirely satisfied with the tune icon but I cannot find any better one.
Hello! I was missing this from the app and decided to try and see if I could implement it without noticing there is a PR open.
It doesn't look like there is much activity around this, so I'll share my proposal:
which I think looks reasonably similar to the webpage:
The implementation is as simple as:
diff --git a/lib/src/view/board_editor/board_editor_screen.dart b/lib/src/view/board_editor/board_editor_screen.dart
index e5a66bd1879d..3a76be5579f5 100644
--- a/lib/src/view/board_editor/board_editor_screen.dart
+++ b/lib/src/view/board_editor/board_editor_screen.dart
@@ -315,6 +315,20 @@ class _BottomBar extends ConsumerWidget {
),
icon: Icons.tune,
),
+ BottomBarButton(
+ label: context.l10n.startPosition,
+ onTap: () => ref
+ .read(boardEditorControllerProvider(initialFen).notifier)
+ .loadFen(kInitialFEN),
+ icon: CupertinoIcons.arrow_counterclockwise,
+ ),
+ BottomBarButton(
+ label: context.l10n.clearBoard,
+ onTap: () => ref
+ .read(boardEditorControllerProvider(initialFen).notifier)
+ .loadFen(kEmptyFEN),
+ icon: CupertinoIcons.delete_simple,
+ ),
BottomBarButton(
key: const Key('flip-button'),
label: context.l10n.flipBoard,
Let me know if I should open a PR. Thanks for your hard work!
Closed by https://github.com/lichess-org/mobile/pull/1394