Skip to content

Study chapter management - Delete, rename, change orientation#2912

Open
CloudyDino wants to merge 6 commits into
lichess-org:mainfrom
CloudyDino:study-chapter-management
Open

Study chapter management - Delete, rename, change orientation#2912
CloudyDino wants to merge 6 commits into
lichess-org:mainfrom
CloudyDino:study-chapter-management

Conversation

@CloudyDino
Copy link
Copy Markdown
Contributor

Study chapter management

Adds chapter management actions for study contributors. When a user has write access to a study, each chapter in the chapter list now shows a settings icon with options to:

  • Delete a chapter (with confirmation dialog)
  • Rename a chapter
  • Change orientation (viewing side) of a chapter

All operations use the lichess study WebSocket protocol (deleteChapter and editChapter events), matching how the web client handles these actions.

Implementation details

  • StudyController.deleteChapter sends the chapter ID directly as the socket data payload, then navigates to an adjacent chapter. When deleting the last chapter, it waits briefly for the server to create the auto-generated empty replacement before re-fetching.
  • StudyController.editChapter sends the full editChapter payload (id, name, orientation, mode, description) and optimistically updates local state.
  • Error handling via snackbar for failed deletions.

Related issues

These issues request chapter creation, which is not included here, but this PR builds the chapter management UI that creation can be added to.

Files changed

  • lib/src/model/study/study_controller.dartdeleteChapter and editChapter methods
  • lib/src/view/study/study_bottom_bar.dart — Settings cog icon, action sheet, rename dialog, orientation picker

Testing done

Android.Testing_compressed.webm

CloudyDino and others added 2 commits April 7, 2026 16:50
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@veloce
Copy link
Copy Markdown
Contributor

veloce commented Apr 14, 2026

Thanks for taking care of this. I'm focusing on the next release so there will be a delay before I review this fyi.

@CloudyDino CloudyDino closed this Apr 22, 2026
@CloudyDino CloudyDino deleted the study-chapter-management branch April 22, 2026 16:55
@CloudyDino CloudyDino restored the study-chapter-management branch April 22, 2026 16:55
@CloudyDino CloudyDino reopened this Apr 22, 2026
CloudyDino and others added 3 commits April 22, 2026 11:55
The chapter settings menu referenced widget.id, but _StudyChaptersMenu
exposes `options`, not `id`. Update the four call sites to use
studyControllerProvider(widget.options) to match the rest of the widget.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@veloce
Copy link
Copy Markdown
Contributor

veloce commented May 19, 2026

I have not forgotten you @CloudyDino ; and this PR is definitely wanted. But this is a complex subject, and this PR is only the beginning of a lot of work.

For now I don't have the time to deal with it, as we have other priorities. But I will eventually. Sorry for the delay and thank you for your patience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants