Reimplement Alert matching native compose#336
Merged
marcprux merged 5 commits intoskiptools:mainfrom Feb 14, 2026
Merged
Conversation
Member
|
Intriguing! Could you post some of the screenshots? |
|
Oh boy I'm excited to see this. |
Contributor
Author
Member
|
Looks great! Thanks! |
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 #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
AlertDialogwhich gives you an opinionated container with an expected look and feel, and a low-levelBasicAlertDialogwhere you do everything yourself.Skip's implementation used
BasicAlertDialog, but it didn't adhere to the Material Design thatAlertDialogprovided; 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, becauseAlertDialogsupports only two buttons (confirm + dismiss), and doesn't support embedding text fields.Soooo I forked
AlertDialogfrom the original Compose sources, and checked it in asSkipAlertDialog.ktwith some minor changes. I then added nativeAlertDialogplaygrounds to the showcase, and verified thatSkipAlertDialog's implementation was a pixel-perfect match forAlertDialog.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
SkipAlertDialogputs 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:
swift testskiptools/skipapp-showcase#63
I used Cursor to copy the code from Compose. I carefully reviewed every line, and manually tested thoroughly in the showcase.