Fix toggle buttons covering Back button in ConfigScreen#355
Merged
Conversation
5 tasks
Agent-Logs-Url: https://github.com/Preponderous-Software/roam/sessions/dda4c3b1-3a83-48ce-8691-d1c58e501480 Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix toggle buttons covering back button in settings screen
Fix toggle buttons covering Back button in ConfigScreen
Apr 23, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors ConfigScreen settings toggles to be scrollable so the Back button remains visible even when the toggle list overflows the screen.
Changes:
- Implemented a scrollable, row-based rendering for config toggles (with overflow indicator).
- Replaced the old back-button drawing logic with a fixed-position bottom button strip.
- Added mouse-wheel scrolling support and reset scroll state on screen entry.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/screen/configScreen.py |
Introduces scrollable toggle rendering, mouse wheel scrolling, and a fixed bottom Back button to prevent UI overflow from covering navigation. |
CHANGELOG.md |
Documents the UI refactor session and notes test status. |
Comment on lines
+62
to
+66
| visibleRows = int((y - startY - 80) / rowHeight) # 80px reserved for bottom Back button | ||
| maxOffset = max(0, len(toggleButtons) - visibleRows) | ||
| self.scrollOffset = max(0, min(self.scrollOffset, maxOffset)) | ||
|
|
||
| visibleToggles = toggleButtons[self.scrollOffset : self.scrollOffset + visibleRows] |
There was a problem hiding this comment.
visibleRows can become 0 (or negative) if the window height is small enough, which makes maxOffset and the slice math inconsistent (e.g., scroll offset can clamp beyond the last item and the range indicator can show something like "10-9 of 9", and no toggles render). Consider clamping visibleRows to at least 1 (or early-return with a message) before computing maxOffset/slicing.
Member
|
@copilot address comment |
Agent-Logs-Url: https://github.com/Preponderous-Software/roam/sessions/b64ae0e5-655a-438b-82d3-39198bdcc4fa Co-authored-by: dmccoystephenson <21204351+dmccoystephenson@users.noreply.github.com>
Contributor
Author
dmccoystephenson
approved these changes
Apr 23, 2026
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.
With 9 toggles and a fixed
yposincrement,ConfigScreenoverflows and buries the Back button. RefactorsdrawMenuButtons()to use the same scrollable-row pattern already established inControlsScreen.Changes
src/screen/configScreen.pydrawMenuButtons()now calculatesvisibleRowsfrom available vertical space (reserving 80px for the bottom strip), clampsscrollOffset, and renders only the visible slice. A"1–N of 9"indicator appears when content overflows.drawBackButton()replaced bydrawBottomButtons(), which always renders aty - 45regardless of toggle count, matchingControlsScreen.drawBottomButtons().handleScrollEvent(event)and wiredpygame.MOUSEWHEELinrun().rowHeight = 35,buttonHeight = 28, and bottom margin matchControlsScreenvalues exactly.scrollOffsetlifecycle — initialized to0in__init__, reset to0on eachrun()entry.