-
-
Notifications
You must be signed in to change notification settings - Fork 226
Add SMS actions: Send SMS and Compose SMS #1849
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: sds100 <[email protected]>
Co-authored-by: sds100 <[email protected]>
Co-authored-by: sds100 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Instead of showing two dialogs can you use a jetpack compose bottom sheet instead? Look at how the other action bottom sheets are implemented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in commit d774d78. Created SmsActionBottomSheet following the pattern of HttpRequestBottomSheet with text fields for phone number and message. The bottom sheet validates inputs before allowing submission.
| } | ||
|
|
||
| @Serializable | ||
| sealed class Sms : ActionData() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot do not create a parent Sms action.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in commit d774d78. Removed the parent Sms sealed class. Now SendSms and ComposeSms are separate data classes directly under ActionData.
Co-authored-by: sds100 <[email protected]>
Overview
This PR implements two new actions for sending SMS messages, addressing issue requirements for SMS functionality in Key Mapper.
New Actions
1. Send SMS
Instantly sends an SMS message to a specified phone number with a predefined message. Uses
ACTION_SENDTOintent to send the message directly through the default messaging app.2. Compose SMS
Opens the messaging app with a pre-filled SMS message, allowing the user to review and edit before sending. Uses
ACTION_VIEWintent to provide a safer, user-controlled sending experience.Implementation Details
Both actions prompt the user to configure:
The actions are:
SEND_SMSAndroid permission with proper request flowTechnical Changes
Core Components:
SendSmsandComposeSmsdata classes directly toActionData(no parent sealed class)sendSms()andcomposeSms()methods inPhoneAdapter/AndroidPhoneAdapterSmsActionBottomSheetfor SMS configuration UI following the pattern of other action bottom sheetsPerformActionsUseCaseDatabase:
SEND_SMSandCOMPOSE_SMSentity types toActionEntityEXTRA_SMS_MESSAGEconstant for message persistenceActionDataEntityMapperPermissions:
SEND_SMSpermission to the permission systemAndroidManifest.xmlUI/UX:
SmsActionBottomSheetwith Material Design components for a unified configuration experienceic_outline_message_24.xml)Error Handling:
NoAppToSendSmserror type for cases where no SMS app is availableTesting
While the implementation follows all established patterns in the codebase, testing should verify:
Files Changed
All changes follow existing code patterns and maintain backward compatibility.
Fixes #727
Original prompt
Fixes #727
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.