feat: add button to create a new study - #3533
tom-anders wants to merge 1 commit into
Conversation
b29d926 to
bf0480b
Compare
There was a problem hiding this comment.
Pull request overview
Adds end-to-end UI to create a new Study from the Study list (and to add a chapter from within a study), wiring it to the Study API and extending widget tests/helpers to cover the new flows.
Changes:
- Add a “Create study” FAB on the Study list that opens a new Create Study bottom sheet and navigates to the created study.
- Introduce new bottom sheets for creating a study (settings) and creating a study chapter (empty/FEN/PGN), backed by new payload types + repository methods.
- Expand widget test coverage and add shared test utilities for opening bottom sheets and mocking clipboard content.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| test/view/study/create_study_chapter_bottom_sheet_test.dart | New widget tests covering chapter creation flows (empty/FEN/PGN, new/existing study). |
| test/view/study/create_study_bottom_sheet_test.dart | New widget test verifying Create Study defaults and transition to chapter creation. |
| test/view/play/create_challenge_bottom_sheet_test.dart | Refactor tests to use shared bottom-sheet opener helper. |
| test/view/more/import_pgn_screen_test.dart | Switch to shared clipboard mocking helper. |
| test/test_helpers.dart | Add shared mockClipboard helper for widget tests. |
| test/test_bottom_sheet_opener.dart | New shared TestBottomSheetOpener widget + open helper to reduce test boilerplate. |
| lib/src/view/study/study_list_screen.dart | Add FAB entry point to create a new study via bottom sheet. |
| lib/src/view/study/study_bottom_bar.dart | Add “New chapter” action that opens the chapter-creation bottom sheet. |
| lib/src/view/study/create_study_chapter_bottom_sheet.dart | New UI for creating chapters from empty/FEN/PGN + file import, calling repository APIs. |
| lib/src/view/study/create_study_bottom_sheet.dart | New UI for choosing study settings before creating the first chapter. |
| lib/src/model/study/study.dart | Add payload types + enums to support study/chapter creation parameters. |
| lib/src/model/study/study_repository.dart | Add API methods to create chapters, delete chapters, and create a study + replace initial empty chapter. |
Suppressed comments (2)
test/view/study/create_study_bottom_sheet_test.dart:66
_TestBottomSheetOpeneris unused (the test usesTestBottomSheetOpener). Remove this dead code to keep the test file focused and avoid unused-element noise.
This issue also appears on line 82 of the same file.
test/view/study/create_study_bottom_sheet_test.dart:86
- Remove the remaining unused
_TestBottomSheetOpenerwidget block.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
On web, the create study plus sign button is visible even on the main studies page. I'd propose that we show "create study" always (within the studies section) so that it's more discoverable. Thoughts? |
f57d4ce to
c72421d
Compare
|
hmm not sure why the formatting check fails, locally |
c72421d to
b4b88da
Compare
56b1ee9 to
d7eef5e
Compare
Good suggestion I think, added it: studyButton.webm |
|
@veloce Finally got around to fixing the formatting issues, sorry about that. It's ready for review now :) |
|
@tom-anders sorry, now there are conflicts with the new lints, can you solve them please? thanks |
d7eef5e to
dd71db5
Compare
dd71db5 to
660c1b0
Compare
|
@veloce fixed 👍 |
veloce
left a comment
There was a problem hiding this comment.
Looks good! only a small comment.
| actions: const [AccountMenuButton()], | ||
| ), | ||
| body: const _Body(), | ||
| floatingActionButton: const CreateStudyFloatingActionButton(), |
There was a problem hiding this comment.
I'd put the floating button only in the study list screen. Because the learn screen is not just about studies.
create-study.webm
based on #3532