Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces adaptive side rails (StartSideRail and EndSideRail) to support landscape, foldable, and tablet capture layouts. It extends CaptureSlotScope and PreviewOverlaySlotScope to propagate container layout metadata (orientation and isCompact) directly to child controls, allowing them to adapt their dimensions and axis. Additionally, new unit tests (CaptureSideRailsTest and CaptureSlotsTest) have been added to verify layout constraints, RTL ordering, and compact sizing using Robolectric and Truth assertions. The implementation is clean, well-tested, and adheres to the repository's style guides; I have no further feedback to provide.
This was referenced Nov 13, 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.
Summary
Adds the
StartSideRailandEndSideRailadaptive vertical chrome containers on top of theCaptureSlotsfoundation fromkim/adaptive/capture-slots. Four of the five posture scaffolds inkim/adaptive/layouts(FoldableLayout,TabletPortraitLayout,TabletLandscapeLayout, andCompactShortLayout) rely on vertical start/end rails rather than horizontal top/bottom bars. Factoring these rails into their own branch isolates collision-free 3-band vertical measurement, portrait-tablet thumb-zone biasing (centerVerticalFraction),360dpcompact-height fitting, per-slotOrientation.Vertical/isCompactscoping, and LTR/RTL vertical ordering invariants into a focused, unit-tested slice.Key Changes
CaptureSideRails.kt(:ui:components:capture):StartSideRail(START_SIDE_RAIL_TAG), stackingslots.topBar(top),slots.zoomControls(center), andslots.quickSettingsButton(bottom) inside per-controlOverlapAwareCaptureSlot(orientation = Orientation.Vertical, isCompact = isCompactHeight)scopes.EndSideRail(END_SIDE_RAIL_TAG), hosting optionalslots.elapsedTimeDisplay(top, gated byshowElapsedTimeInRail),VerticalRailShutterCluster(flipCameraButton -> captureButton -> imageWellin center), andslots.captureModeToggle(bottom).VerticalRailLayoutandVerticalRailShutterClustercustomLayoutcomposables plusMinSideRailWidth = 72.dpand 10 LTR/RTL/posture@Previewfunctions.TestTags.kt:START_SIDE_RAIL_TAG("rail_capture_start") andEND_SIDE_RAIL_TAG("rail_capture_end").CaptureSideRailsTest.kt:360dpcompact-height non-clipping/non-overlap, omitted-slot collapsing,1280dp(0.70f) tablet-portrait thumb-zone clamping, and livePreviewOverlaySlotScopepropagation.Technical Notes
VerticalRailLayout): Under bounded height, measuresTopfirst,Bottomsecond, and passes the remaining collision-free height (innerHeight - topReserved - bottomReserved) toCenter. Empty (0px-height) slots filter tonullso omitted sections reserve neither height norminSectionGap(12.dpstandard /8.dpcompact).centerVerticalFraction): Places theCenterband's midpoint atrailHeight * centerVerticalFraction.coerceIn(0f, 1f)(0.50fdefault;0.70ffor1280dpportrait tablet lower-grip reach) and clamps its top coordinate within[minCenterY, maxCenterY]so it can never collide withToporBottomsections.VerticalRailShutterCluster): Under bounded height, measuresCapturebeforeFlipCameraandImageWellso the primary shutter retains height priority in micro-heights, then places active controls in strictFlipCamera -> Capture -> ImageWellorder with inter-control gaps (48.dpstandard /20.dpcompact) compressing proportionally (min(targetTotalGapPx, maxAllowedGapPx)) when height-constrained.placeable.place(x, y)coordinates and enumlayoutIds rather than overridingLocalLayoutDirection, keeping vertical coordinates identical in LTR and RTL while child slots retain the caller'sLocalLayoutDirectionfor localized text and icons.OverlapAwareCaptureSlot(orientation = Orientation.Vertical, isCompact = isCompactHeight), giving every control independent viewfinder-overlap contrast detection plusOrientation.VerticalandisCompactlayout hints.Not Included Yet
FoldableLayout,TabletPortraitLayout,TabletLandscapeLayout, andCompactShortLayout(kim/adaptive/layouts).CaptureScaffoldcontrols andMinSideRailWidthcarousel clearance (kim/adaptive/layout-orchestrator).#649indicator pill,#635mode toggle,#644zoom bar RTL polish).kim/adaptive/content-gravity).WindowInsets; system bar, hinge, and cutout handling belongs to the hosting layouts.Testing
CaptureSideRailsTest(Robolectric Compose UI suite):< 0.5dpLTR/RTL vertical coordinate parity, and childLocalLayoutDirectioninheritance for bothStartSideRail(3 slots) andEndSideRail(5 slots).360dpcompact-height stress test (isCompactHeight = true, recording timer + image well active) verifying zero clipping (getBoundsInRoot==getUnclippedBoundsInRoot) and zero overlap across all 8 controls.elapsedTimeDisplay,imageWell,topBar,quickSettingsButton) are omitted.1280dptablet-portrait thumb-zone test (centerVerticalFraction = 0.70f, custom posture padding) verifying896dpmidpoint alignment and>= 16dpbottom-control clearance.PreviewOverlaySlotScopeOrientation.VerticalandisCompactpropagation into slot composables.