Repository navigation
feat(tui): settings menu, pressable bot buttons and Mac shortcut labels - #10
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 20 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Adds saved appearance settings, clearer shortcut hints, and clickable bot buttons. Bot actions retain account restrictions, links are copied rather than opened, and settings changes preserve existing account configuration. No code changes detected at You can add or adjust custom eligibility rules. Learn more. |
Dismissing prior approval to re-evaluate 12c19ec
12c19ec to
e51bb1a
Compare
Dismissing prior approval to re-evaluate e51bb1a
Esc on the chat list opens a settings menu (theme, spacing, how shortcuts are written), saved to config.json one field at a time. Bots' inline keyboards are drawn under their messages and pressed with a click: a callback goes to the bot through Backend.Press, guarded like sending, and its answer shows in the status line; links and copy buttons copy. Day dividers, the composer and the hints get rules. ctrl+c clears the composer before it quits. On a Mac, option and command show as ⌥ and ⌘, replies use option+arrows and image paste cmd+v. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
e51bb1a to
953cbd2
Compare
Bot messages hid their buttons, day changes and the composer blended into the conversation, ctrl+c quit with a half-written message, and a Mac user was told to press ctrl+arrows (which switch desktops) with no way to change settings from the TUI.
Backend.Press(guarded like sending) and its answer shows at the bottom. Link and copy buttons copy, since tg often runs over SSH. Games, payments and password-protected buttons say they need Telegram's own apps.⌥and⌘, ctrl stays a word. Replies read⌥↑↓, image paste⌘V. tg often runs over SSH from a Mac, so it is a setting ("keys"inconfig.json) that defaults to the system tg runs on.escon the chat list opens it, like btop. Theme, spacing and shortcut style change at once and are saved toconfig.json, one field at a time over the file as it is then.Screenshots
Before:
After, with the buttons, the dividers and the rules:
Clicking
@build_demo_botshows the bot's answer:Clicking a link button copies it:
Settings menu, theme switched live to macchiato:
Mac shortcut labels while typing (ctrl+c reads "clear"):
After ctrl+c on a draft, the composer is empty and tg still runs:
Proof:
go test ./...,go vet ./...andgofmt -l .are clean, with focused tests for ctrl+c, saving settings, button layout, pressing and stale answers, the guard, and Mac labels. Screenshots come from real kitty on demo data, the clicks made with xdotool. Themessages.getBotCallbackAnswercall and the inline keyboard conversion ininternal/mtpwere not tried against a live account.Follow-ups: pressing buttons from the keyboard; stripping terminal escape sequences from message and button text (message text has never been sanitized); friendlier messages for raw errors like
DATA_INVALID.Council review
Rounds: 8. Rounds 1 to 4 reviewed the first version, 5 to 8 pressable buttons and the new Mac labels. Later rounds only went to reviewers with open items.
Created with Claude Opus 5.5 in Claude Code (T3 Code). Reviewed by Claude Opus 5.5 and GPT-6.2 Sol.
🤖 Generated with Claude Code
Note
Add TUI settings menu, pressable bot buttons, and Mac shortcut labels
Keysfield (mac,pc, or empty for system default) to the config file. See settings.go and config.go.core.Backend.Pressmethod, and answers display as a note (URLs are copied). MTProto treatsBOT_RESPONSE_TIMEOUTas an empty answer. See core.go, convert.go, and backend.go.alt+andcmd+as Option and Command symbols viamodel.keyName.qquits only from the chat list.model.bodyRows.core.Backendgains a requiredPressmethod, so out-of-tree backend implementations must add it; the TUI also replaces the standalonespacedmodel field with aLookvalue, changingtui.RunandnewModelsignatures.Macroscope summarized 953cbd2.