Skip to content

Reimplement Alert matching native compose#336

Merged
marcprux merged 5 commits intoskiptools:mainfrom
dfabulich:native-compose-alert
Feb 14, 2026
Merged

Reimplement Alert matching native compose#336
marcprux merged 5 commits intoskiptools:mainfrom
dfabulich:native-compose-alert

Conversation

@dfabulich
Copy link
Contributor

Fixes #135

This is a pretty extensive PR. As @joshuakcockrell pointed out, Skip alerts didn't look very much like a "stock" Compose alert. Compose offers two APIs for alerts, a high-level AlertDialog which gives you an opinionated container with an expected look and feel, and a low-level BasicAlertDialog where you do everything yourself.

Skip's implementation used BasicAlertDialog, but it didn't adhere to the Material Design that AlertDialog provided; as a result, it felt very iOS-y and not very native to the platform.

Ideally, we'd just pass everything we need to AlertDialog, but we can't do that, because AlertDialog supports only two buttons (confirm + dismiss), and doesn't support embedding text fields.

Soooo I forked AlertDialog from the original Compose sources, and checked it in as SkipAlertDialog.kt with some minor changes. I then added native AlertDialog playgrounds to the showcase, and verified that SkipAlertDialog's implementation was a pixel-perfect match for AlertDialog.

With that done, I added support for any number of neutral buttons to AlertDialog, added support for text fields, and added a scrolling container, allowing users to scroll to read very long messages.

I took screenshots of each of the dialogs comparing them to the standard. The only difference now is that SkipAlertDialog puts the destructive button above the cancel button in the long button titles case, but that feels right to me, so I left that difference in.

Skip Pull Request Checklist:

  • REQUIRED: I have signed the Contributor Agreement
  • REQUIRED: I have tested my change locally with swift test
  • OPTIONAL: I have tested my change on an iOS simulator or device
  • OPTIONAL: I have tested my change on an Android emulator or device
  • REQUIRED: I have checked whether this change requires a corresponding update in the Skip Fuse UI repository (link related PR if applicable)
  • OPTIONAL: I have added an example of any UI changes in the Showcase sample app

skiptools/skipapp-showcase#63


  • AI was used to generate or assist with generating this PR. Please specify below how you used AI to help you, and what steps you have taken to manually verify the changes.

I used Cursor to copy the code from Compose. I carefully reviewed every line, and manually tested thoroughly in the showcase.


@marcprux
Copy link
Member

Intriguing! Could you post some of the screenshots?

@joshuakcockrell
Copy link

Oh boy I'm excited to see this.

@dfabulich
Copy link
Contributor Author

New playground

alert-playground

Title only

title-only-skip title-only-alertdialog

Title + message

title-message-skip title-message-alertdialog

Long message

long-message-skip long-message-alertdialog

… but, in Skip, now you can scroll it!

long-message-scrolled-skip

Long button titles

long-button-titles-skip long-button-titles-alertdialog

It feels right to me to put "destructive" on the bottom.

Two buttons

two-buttons-skip two-buttons-alertdialog

Three buttons and five buttons (Skip only)

three-buttons-skip five-buttons-skip

Text fields (Skip only)

text-field-skip secure-field-skip

@marcprux marcprux added enhancement New feature or request compose Limitation of Jetpack Compose or issue with SwiftUI translation labels Feb 14, 2026
@marcprux
Copy link
Member

Looks great! Thanks!

@marcprux marcprux merged commit 5ec8d30 into skiptools:main Feb 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed compose Limitation of Jetpack Compose or issue with SwiftUI translation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Alerts with long button titles are truncated on Android

3 participants