Improve metronome mobile fit and modal-driven pause/resume lifecycle - #1
Merged
awjcreation merged 2 commits intoJun 20, 2026
Conversation
Copilot
AI
changed the title
[WIP] Improve metronome functionality for mobile devices
Improve metronome mobile fit and modal-driven pause/resume lifecycle
Jun 20, 2026
awjcreation
approved these changes
Jun 20, 2026
awjcreation
marked this pull request as ready for review
June 20, 2026 10:45
awjcreation
merged commit Jun 20, 2026
bf5e872
into
refactor/code-consistency-optimization
4 checks passed
There was a problem hiding this comment.
Pull request overview
This PR improves the metronome experience on small mobile screens and makes metronome playback pause/resume deterministically around metronome settings/help modals to avoid inconsistent state and duplicate runtime loops.
Changes:
- Added mobile-focused
@mediaoverrides to reduce metronome layout footprint on narrow/short screens. - Introduced modal-aware metronome lifecycle helpers (
pauseMetronomeForModal,isAnyMetroModalOpen,resumeMetronomeAfterModal) plus session flags to resume only when appropriate. - Wired modal open/close handlers to pause on open and conditionally resume on close.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| styles.css | Adds small-screen metronome layout overrides to prevent overflow and keep core controls visible on mobile. |
| app.js | Adds modal pause/resume guards and state flags to keep metronome playback coherent across settings/help modal interactions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
awjcreation
added a commit
that referenced
this pull request
Jun 20, 2026
…mization Merge pull request #1 from awjcreation/copilot/improve-metronome-mobile-experience ## Summary This pull request refactors parts of the codebase to improve consistency, readability, and maintainability. ## Changes - cleaned up code structure - improved consistency across files/components - applied refactoring changes to simplify maintenance - introduced small optimizations related to code organization ## Why These changes make the project easier to maintain and prepare the codebase for future feature work. ## Testing - reviewed changed files - verified the app still builds and behaves as expected
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Metronome UI was overflowing on phone-sized screens, and opening metronome modals did not reliably pause/resume playback with updated settings.
This PR tightens the mobile metronome layout and adds deterministic modal lifecycle handling so playback state remains coherent without duplicate timers/players.
Mobile metronome layout fit
@mediaoverrides for small screens (max-width: 430px) and short viewports (max-height: 760px).Modal-aware playback lifecycle
pauseMetronomeForModal()isAnyMetroModalOpen()resumeMetronomeAfterModal()State consistency and no duplicate runtime loops
metroWasRunningBeforeModalmetroPausedByModalstartMetronome(), preventing duplicate timer/audio loop startup.