List: make the reorder drag visible on dark backgrounds - #518
Open
humbuckr wants to merge 1 commit into
Open
Conversation
A dragged row is styled with Modifier.shadow(8.dp) and nothing else. A shadow expresses elevation by darkening what is around the row, so over a dark page it expresses nothing — on #000 there is nothing left to darken, and the row being dragged is pixel-identical to the rows at rest. A reorder on a dark-themed app therefore has no visible affordance at all. Material's own answer for elevation on dark surfaces is tonal: the surface gets lighter. This draws that alongside the shadow, so light themes keep the shadow they already had and dark themes gain feedback they never had. Drawn over the content rather than behind it, because a list row usually paints its own background and a tint behind it would never be seen. Tinted with onSurface so it follows the colour scheme in both directions. Apps cannot work around this today: SwiftUI's onMove is invoked from onDragEnd, detectReorderAfterLongPress claims the long press before any app gesture sees it, and onLongPressChange() only ever calls onChanged(true). Tested on device — Android 14, Samsung SM-A326U, a playlist of 24 rows on a #121212 page: the dragged row now lifts visibly and returns to rest on drop. Refs skiptools#517
|
Thank you for your pull request and welcome to the Skip community. We require contributors to sign our contributor license agreement (CLA), and we don't seem to have the user(s) @humbuckr on file. In order for us to review and merge your code, for each noted user please add your GitHub username to Skip's .clabot file |
Member
|
This looks useful? Could you post a before and after screenshot of a row being dragged with this effect? |
Author
|
Hey Marc - I am new to Git and skip-ui. i dont have a screenshot from
before now. sorry.
…On Mon, Aug 31, 2026 at 7:12 AM marcprux ***@***.***> wrote:
*marcprux* left a comment (skiptools/skip-ui#518)
<#518 (comment)>
This looks useful?
Could you post a before and after screenshot of a row being dragged with
this effect?
—
Reply to this email directly, view it on GitHub
<#518?email_source=notifications&email_token=ABF5R7G2X32PJAJZXDBYQPT5MWBWTA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKNBXHE3DANBVGM2KM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-5479604534>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABF5R7DWHMHAEY2PETN6YIT5MWBWTAVCNFSNUABFKJSXA33TNF2G64TZHM3DMOJZGUZDQNZVHNEXG43VMU5TKMRZGYYTCOJYGAZKC5QC>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/ABF5R7HDMBJ4MLCNSBUIXBD5MWBWTA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKNBXHE3DANBVGM2KM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJKTGN5XXIZLSL5UW64Y>
and Android
<https://github.com/notifications/mobile/android/ABF5R7FJ4PJDVAUMCG2J6CD5MWBWTA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTKNBXHE3DANBVGM2KM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLTGN5XXIZLSL5QW4ZDSN5UWI>.
Download it today!
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
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.
Fixes the problem reported in #517.
The problem
RenderReorderableItemstyles the dragged row withModifier.shadow(8.dp)andnothing else. A shadow expresses elevation by darkening what is around the
row — so over a dark page it expresses nothing. On
#000there is nothing leftto darken, and the row under your finger is pixel-identical to the rows at rest.
A reorder on a dark-themed app has no visible affordance at all.
The change
Draw a tonal lift alongside the shadow, which is Material's own answer for
elevation on dark surfaces: the surface itself gets lighter.
Two choices worth flagging for review:
background, so a tint drawn behind it would never be seen.
onSurface, not a fixed colour, so it follows the scheme in bothdirections — lighter on dark themes, darker on light ones. Light themes keep
the shadow they already had and gain a subtle press-like tint; dark themes gain
the only feedback they can receive.
Happy to put it behind an environment hook in the shape of
material3Rippleinstead, if you would rather this be opt-in than a default.
Why apps cannot work around it
onMoveis invoked fromonDragEnd, so SwiftUI code learns about the moveonly on drop.
Modifier.detectReorderAfterLongPressclaims the long press, so an app's own.onLongPressGesture(..., onPressingChanged:)on the row never fires.onLongPressChange()callsonChanged(true)and nothing ever calls it withfalse.Testing
Built and run on device: Android 14, Samsung SM-A326U (Dimensity 700), release
build, a 24-row playlist on a
#121212page with#252525rows. Before thepatch, dragging produced no visible change; after it, the dragged row lifts while
held and returns to rest on drop. Light-theme rendering unchanged apart from the
new tint.