Problem/Motivation
Users of xAPI activities have been finding the nested navigation a bit challenging, with too little space for the activity, too much unexpected scrolling, etc.
Steps to reproduce
Proposed resolution
The idea got floated for a full-screen experience for these types of activities and this module uses a restyling of the current page rather than building a separate view or modal.
I gave the module some initial logic around where focus mode settings can get applied and what takes precedence over what (e.g. an individual activity's settings override its parent lesson's) and I'm open to changes for all of that.
This issue can be used to easily evaluate a solution that, if it works out, we can turn into its own project.
Remaining tasks
Including but not limited to:
- Maintainer review of the Focus Mode module
- More accessibility testing
- Create a
:has()fallback - Test with BigPipe enabled
User interface changes
- The focus mode itself, where an activity is made full-screen
- A new admin settings form
- Per-entity settings
- A "required" mode that adds a start screen
- An "optional" mode that provides a focus mode toggle button
API changes
TBD based on what ends up being approved.
Data model changes
Adds a focus_mode field to course bundles, lessons, and activities.
AI disclosure
The module code was generated by Claude Code. I directed it to follow Drupal core and LMS sibling module conventions, and I asked it to achieve functionality that I wanted, but not being a backend dev myself I cannot vouch for what it ended up doing, particularly architecturally. It set up tests and ran automated checks mostly on its own. I also had it provide some backward compatibility that I discovered a specific site needed in order to test the focus mode. If any or all of the backend code needs ripping out I will not be offended.
On the frontend and documentation side of things, I used Claude for some of the grunt work but I also did my own writing/editing and do feel a lot more confident in that work. That said, I always appreciate feedback if anything looks odd.
Issue fork lms-3624561
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments