Skip to content

refactor(ui): build the floating toolbar and menus on stock Material components - #110

Merged
thisislvca merged 6 commits into
mainfrom
claude/dazzling-bardeen-0vg0kz-toolbar-menu
Dec 2, 2026
Merged

thisislvca merged 6 commits into
mainfrom
claude/dazzling-bardeen-0vg0kz-toolbar-menu

Conversation

@thisislvca

@thisislvca thisislvca commented Dec 1, 2026 •

Copy link
Copy Markdown
Owner

The selection toolbar and every overflow menu were redrawn by hand: AlbaFloatingToolbar was a Surface + Row, and AlbaMenu/AlbaMenuItem were a hand-positioned Popup with 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)

Before After
AlbaFloatingToolbar: Surface(CircleShape) + 64dp Row Stock HorizontalFloatingToolbar in 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 group
AlbaMenu: Popup with a custom PopupPositionProvider, its own scale/fade transition and a reduced-motion switch Stock DropdownMenu with Alba's medium shape, surfaceContainer and 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 off
AlbaMenuItem: clickable Row, hand-applied 0.38 alpha Stock DropdownMenuItem with MenuDefaults.itemColors() (the same onSurface/onSurfaceVariant and disabled colours), body large text, 24dp icon slots, 16dp side padding

The AlbaFloatingToolbar, AlbaMenu, AlbaMenuItem and AlbaMenuDivider signatures don't change, so the 6 AlbaMenu, 24 AlbaMenuItem and the toolbar call sites, and every testTag, stay as they are. The hand-written position provider and the unused MenuItemHeight/MenuWindowMargin constants 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 replace AlbaMenuDivider with separate group cards and change the API at every call site; and exitAlwaysScrollBehavior on the selection toolbar needs the gallery grid's nested scroll wired through GalleryHome. No strings or tags added or removed.

Tests

  • New screenshot tests with an open menu, rendered from the current menu in the first commit: gallery-selection-more (the selection toolbar's More menu) and viewer-more (the viewer's overflow), standard and dark.
  • Local: compileDebugUnitTestKotlin, compileDebugAndroidTestKotlin, detekt and ktlintCheck pass. These JVM classes pass on the UI commit: SelectionActionsTest, ViewerControlsTest, GalleryNavigationTest, AppSurfacesTest, AlbumsTest, AlbumOrderingTest, CollectionsHubTest, SharedAlbumControlsTest, PhotoInfoTest and every *Screenshots class (render only; CI compares).
  • Expected golden changes: the four new menu goldens, and 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.

Screen Before After
gallery-selection (standard) gallery-selection standard before gallery-selection standard after
gallery-selection (dark) gallery-selection dark before gallery-selection dark after
gallery-selection-more (standard) gallery-selection-more standard before gallery-selection-more standard after
gallery-selection-more (dark) gallery-selection-more dark before gallery-selection-more dark after
viewer-more (standard) viewer-more standard before viewer-more standard after
viewer-more (dark) viewer-more dark before viewer-more dark after

Also changed: gallery-selection (compact).

https://claude.ai/code/session_017vGQ3zr1LSQtH3D545V8mU


Generated by Claude Code

claude and others added 3 commits December 1, 2026 17:49
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
@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Screenshot goldens updated

CI recorded the goldens on Linux and pushed 626d9e9 to this branch. The checks run again on it.

compact

  • Changed: gallery-selection

dark

  • Changed: gallery-selection-more, gallery-selection, viewer-more

standard

  • Changed: gallery-selection-more, gallery-selection, viewer-more

Review the images in Files changed before merging: merging accepts them.

claude and others added 3 commits December 1, 2026 18:19
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
@thisislvca
thisislvca merged commit 5f5440b into main Dec 2, 2026
5 checks passed
@thisislvca
thisislvca deleted the claude/dazzling-bardeen-0vg0kz-toolbar-menu branch December 2, 2026 01:50
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