Skip to content

feat(bot): UX improvements — inline welcome keyboard, consistent language, fixed stale keyboard bug#39

Merged
masmuss merged 8 commits into
mainfrom
feat/bot-ux-improvements
Jun 15, 2026
Merged

feat(bot): UX improvements — inline welcome keyboard, consistent language, fixed stale keyboard bug#39
masmuss merged 8 commits into
mainfrom
feat/bot-ux-improvements

Conversation

@masmuss

@masmuss masmuss commented Jun 15, 2026

Copy link
Copy Markdown
Owner

Changes

UX Flow

  • Welcome screen: replaced slash command text list with inline action buttons (📝 Buat laporan baru, ❓ Bantuan)
  • Consistent language: all prompts use Indonesian "Selesai" instead of "/done"
  • Quick status check: added 🔍 Cek status button with embedded ticket code in post-submit actions
  • Category keyboard: removed redundant Lewati and ❌ Batal buttons (simplified to just category names)
  • Attachment step: removed redundant "Lewati lampiran" inline button — doneKeyboard handles everything
  • Separated prompts: category confirmation (short) + attachment prompt (focused) in distinct messages

Bug Fixes

  • Stale reply keyboard: fixed bug where doneKeyboard persisted after skip_attachment or confirm_report, causing empty confirmations on stale button clicks
  • Category selection feedback: now shows "✅ Kategori dipilih: {name}" with clear next steps

Refactors

  • Extracted promptConfirmReport() shared helper (eliminated duplication between hears handler and callback)
  • Cleaned up unused buildSkipAttachmentKeyboard, cancelKeyboard remnants, skip_category/cancel_category callbacks
  • Enabled tsx watch for auto-restart in dev

Files Changed

  • apps/bot/src/bot.ts — guard for empty session, use promptConfirmReport
  • apps/bot/src/handlers/callbacks.ts — simplified category select, removed skip/cancel_category
  • apps/bot/src/handlers/commands.ts — use buildWelcomeKeyboard, replyTicketStatus
  • apps/bot/src/conversations/invite.ts — use buildWelcomeKeyboard
  • apps/bot/src/utils/helpers.ts — added promptConfirmReport, replyTicketStatus
  • apps/bot/src/utils/keyboards.ts — buildWelcomeKeyboard, cleaned up unused keyboards
  • apps/bot/src/utils/messages.ts — ATTACHMENT_PROMPT, simplified categorySelected
  • apps/bot/package.json — tsx watch mode

masmuss added 8 commits June 16, 2026 01:02
… 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
@masmuss masmuss merged commit 3b1a853 into main Jun 15, 2026
2 checks passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.3.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant