feat(bot): UX improvements — inline welcome keyboard, consistent language, fixed stale keyboard bug#39
Merged
Merged
Conversation
… cleaner keyboards Remove redundant ⏭️ Skip button from doneKeyboard (same as ✅ Selesai). Replace /done with /selesai in prompts for Indonesian consistency. Support both /selesai and /done in regex for backward compat. Add /status to COMMANDS_TEXT. Add save-ticket-code reminder in reportSuccess. Add 🔍 Cek status inline button in post-submit actions. Extract replyTicketStatus shared function reused by /status command + callback.
Replace hardcoded /command text listing in welcomeBack and registrationSuccess with an inline keyboard (buildWelcomeKeyboard) with action buttons: 📝 Buat laporan baru → new_report callback ❓ Bantuan → show_commands callback Gives users a tappable interface instead of command text, matching the category picker pattern already used in the report flow. Changes: - Add buildWelcomeKeyboard() to keyboards.ts - Simplify welcomeBack() message — remove Perintah: block - Simplify registrationSuccess() message — same - Use buildWelcomeKeyboard() in /start command response - Use buildWelcomeKeyboard() after successful registration
…ter selection Add ❌ Batal button to category inline keyboard so users can cancel from category step. After selecting/skipping a category, send a reply message with doneKeyboard (✅ Selesai + ❌ Batal) so users have proper navigation buttons instead of only the inline 'Lewati lampiran' button.
…etween hears handler and skip_attachment callback Both bot.ts (✅ Selesai hears) and callbacks.ts (skip_attachment callback) had identical logic: buildReportSummary → reply with remove_keyboard → reply 'Pilih aksi:' with buildConfirmKeyboard. Extracted into promptConfirmReport() in helpers.ts. Also fixed stale reply keyboard bug (skip_attachment wasn't removing doneKeyboard).
…neKeyboard only The 'Lewati lampiran' inline button and ✅ Selesai reply button both did the same thing (promptConfirmReport). Removed the inline path: category_ and skip_category callbacks no longer set buildSkipAttachmentKeyboard on the edited message; rely solely on doneKeyboard reply keyboard for attachment step navigation.
After selecting a category, the inline message was edited to show the full categorySelected text (including lampiran instruction), followed by a separate reply message with similar instruction. Now the old inline message gets a short confirmation (✅ Kategori dipilih / ✅ Tanpa kategori) and the full text + doneKeyboard are in a single new message.
…s, enable watch mode - Add tsx watch to dev script for auto-restart on file changes - Remove Lewati and ❌ Batal buttons from category keyboard - Remove skip_category and cancel_category callbacks (no longer needed) - Simplify categorySelected to a short confirmation message - Add ATTACHMENT_PROMPT as a cleaner separate prompt for attachment step - Update messages to use 'Selesai' instead of '/selesai' for consistency
|
🎉 This PR is included in version 1.3.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
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.
Changes
UX Flow
Bug Fixes
Refactors
promptConfirmReport()shared helper (eliminated duplication between hears handler and callback)buildSkipAttachmentKeyboard,cancelKeyboardremnants,skip_category/cancel_categorycallbackstsx watchfor auto-restart in devFiles Changed
apps/bot/src/bot.ts— guard for empty session, use promptConfirmReportapps/bot/src/handlers/callbacks.ts— simplified category select, removed skip/cancel_categoryapps/bot/src/handlers/commands.ts— use buildWelcomeKeyboard, replyTicketStatusapps/bot/src/conversations/invite.ts— use buildWelcomeKeyboardapps/bot/src/utils/helpers.ts— added promptConfirmReport, replyTicketStatusapps/bot/src/utils/keyboards.ts— buildWelcomeKeyboard, cleaned up unused keyboardsapps/bot/src/utils/messages.ts— ATTACHMENT_PROMPT, simplified categorySelectedapps/bot/package.json— tsx watch mode