Repository navigation
refactor(ui): build the floating toolbar and menus on stock Material components - #110
Merged
Merged
Conversation
Records the selection toolbar's More menu and the viewer's overflow menu, standard and dark, before they move to Material's DropdownMenu. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vGQ3zr1LSQtH3D545V8mU
…components AlbaFloatingToolbar now wraps HorizontalFloatingToolbar, and AlbaMenu and AlbaMenuItem wrap DropdownMenu and DropdownMenuItem, instead of redrawing them with a Surface, a hand-positioned Popup and clickable rows (docs/design.md: wrap stock menus and floating toolbars, don't redraw them). Alba's colours, shape, shadow, widths and paddings pass through the components' parameters; the APIs and every testTag stay the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vGQ3zr1LSQtH3D545V8mU
Golden-New: dark/gallery-selection-more.png Golden-New: dark/viewer-more.png Golden-New: standard/gallery-selection-more.png Golden-New: standard/viewer-more.png
Contributor
Screenshot goldens updatedCI recorded the goldens on Linux and pushed 626d9e9 to this branch. The checks run again on it. compact
dark
standard
Review the images in Files changed before merging: merging accepts them. |
…/github.com/thisislvca/alba into claude/dazzling-bardeen-0vg0kz-toolbar-menu
Golden-Changed: compact/gallery-selection.png Golden-Changed: dark/gallery-selection-more.png Golden-Changed: dark/gallery-selection.png Golden-Changed: dark/viewer-more.png Golden-Changed: standard/gallery-selection-more.png Golden-Changed: standard/gallery-selection.png Golden-Changed: standard/viewer-more.png
…en-0vg0kz-toolbar-menu # Conflicts: # app/src/main/java/me/lvca/alba/app/ui/designsystem/AlbaFloatingDefaults.kt
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.
The selection toolbar and every overflow menu were redrawn by hand:
AlbaFloatingToolbarwas aSurface+Row, andAlbaMenu/AlbaMenuItemwere a hand-positionedPopupwith their own scale animation, 0.38 disabled alpha and clickable rows. docs/design.md asks for stock Material 3 menus and floating toolbars, wrapped rather than redrawn, and both are stable in Material 3 1.5.What changed (all in
designsystem/AlbaFloatingDefaults.kt)AlbaFloatingToolbar:Surface(CircleShape)+ 64dpRowHorizontalFloatingToolbarin Alba's floating colours (standardFloatingToolbarColors), the theme's full-corner shape, the same 3dp shadow and 8dp side padding, items 4dp apart. Like the old surface it still takes taps that land between its buttons, and it is a traversal groupAlbaMenu:Popupwith a customPopupPositionProvider, its own scale/fade transition and a reduced-motion switchDropdownMenuwith Alba's medium shape,surfaceContainerand 3dp shadow, 227–280dp wide as before. Material places it, dismisses it on an outside tap or back, and animates it on the theme's fast spatial/effects springs; the system's animation scale (the reduced-motion setting Alba reads) turns those offAlbaMenuItem: clickableRow, hand-applied 0.38 alphaDropdownMenuItemwithMenuDefaults.itemColors()(the same onSurface/onSurfaceVariant and disabled colours), body large text, 24dp icon slots, 16dp side paddingThe
AlbaFloatingToolbar,AlbaMenu,AlbaMenuItemandAlbaMenuDividersignatures don't change, so the 6AlbaMenu, 24AlbaMenuItemand the toolbar call sites, and every testTag, stay as they are. The hand-written position provider and the unusedMenuItemHeight/MenuWindowMarginconstants are gone.Visible differences, all Material's own behaviour: an end-of-screen overflow menu now lines up with its anchor's end (about 4dp from the edge instead of 11dp); a menu whose anchor has room to its end opens start-aligned (only on wide windows for the selection More menu); the gap between a row's icon and its text is Material's 12dp instead of 16dp. The toolbar is pixel-identical apart from shadow antialiasing. The stock toolbar also offers TalkBack a "collapse" action, which has nothing to hide here.
Left for later: Material 3 1.5's expressive grouped menus (
DropdownMenuPopup+DropdownMenuGroup) would replaceAlbaMenuDividerwith separate group cards and change the API at every call site; andexitAlwaysScrollBehavioron the selection toolbar needs the gallery grid's nested scroll wired throughGalleryHome. No strings or tags added or removed.Tests
gallery-selection-more(the selection toolbar's More menu) andviewer-more(the viewer's overflow), standard and dark.compileDebugUnitTestKotlin,compileDebugAndroidTestKotlin,detektandktlintCheckpass. These JVM classes pass on the UI commit:SelectionActionsTest,ViewerControlsTest,GalleryNavigationTest,AppSurfacesTest,AlbumsTest,AlbumOrderingTest,CollectionsHubTest,SharedAlbumControlsTest,PhotoInfoTestand every*Screenshotsclass (render only; CI compares).gallery-selection(standard, dark, compact) by a few shadow pixels.Screenshots
Before is 863a0df, after is 626d9e9, both recorded by CI on Linux. Standard and dark are shown; other variants that changed are listed under the table.
gallery-selection(standard)gallery-selection(dark)gallery-selection-more(standard)gallery-selection-more(dark)viewer-more(standard)viewer-more(dark)Also changed:
gallery-selection(compact).https://claude.ai/code/session_017vGQ3zr1LSQtH3D545V8mU
Generated by Claude Code