feat(ui): cross-platform confirm dialog (fix Alert.alert no-op on web)#67
Merged
Conversation
Alert.alert renders nothing on React Native Web — its confirm buttons never fire — so every confirmation (delete, sign out, uninstall, state transition, action confirmText) was a silent no-op in the web build, and notification alerts (upload/account/required-field errors) never showed. - Add ConfirmProvider + useConfirm(): a promise-based confirm backed by the Dialog/Modal primitives, so it works identically on web and native. Wired into the root layout. - Replace all confirm-style Alert.alert with useConfirm: record delete (detail + list), sign out (more + profile), package uninstall, state transition, and the object-action confirmText prompt in useRecordActions. - Replace notification-style Alert.alert with toasts: delete/upload failures, account success/error, and the action required-field message. Verified in-browser against a local 7.5.0 server: advancing crm_opportunity now shows a real "更新状态" confirm dialog, and confirming applies the transition (stage proposal → negotiation) and re-highlights the diagram — previously impossible on web. Adds useConfirm tests; typecheck + lint clean; full suite green apart from the pre-existing snapshots. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Problem
Alert.alertrenders nothing on React Native Web — its confirm buttons never fire. So every confirmation was a silent no-op in the web build: record delete, sign out, package uninstall, the new state-machine transition, and the object-actionconfirmTextprompt. Notification-style alerts (upload/account/required-field errors) also never appeared.Fix
ConfirmProvider+useConfirm()— a promise-based confirm backed by theDialog/Modalprimitives, working identically on web and native. Wired into the root layout.Alert.alertwithuseConfirm: record delete (detail + list), sign out (more + profile), package uninstall, state transition, and the actionconfirmTextprompt inuseRecordActions.Alert.alertwith toasts: delete/upload failures, account success/error, action required-field message.Alert.alertreferences remain inapp/,components/,hooks/.Verification
crm_opportunitynow shows a real 更新状态 confirm dialog (取消 / 确认, localized); confirming applies the transition (proposal → negotiation) and re-highlights the diagram — previously impossible on web.useConfirmtests (resolves true on confirm / false on cancel);tsc+eslintclean (one pre-existing unrelated warning); full suite 1130 pass (20 pre-existing snapshot failures, unrelated).This resolves the limitation flagged in #66.
🤖 Generated with Claude Code