Skip to content

feat(tui): settings menu, pressable bot buttons and Mac shortcut labels - #10

Merged
RealDoc06 merged 1 commit into
mainfrom
feat/tui-polish
Nov 20, 2026
Merged

RealDoc06 merged 1 commit into
mainfrom
feat/tui-polish

Conversation

@RealDoc06

@RealDoc06 RealDoc06 commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

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.

  • Bot buttons are drawn under their message, laid out like Telegram's, and pressed with a click. A callback goes to the bot through the new 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.
  • Rules set apart day dividers, the composer, and the hints line.
  • ctrl+c clears the composer (or cancels an edit) and quits only when it is empty.
  • Mac shortcuts: option and command show as ⌥ and ⌘, ctrl stays a word. Replies read ⌥↑↓, image paste ⌘V. tg often runs over SSH from a Mac, so it is a setting ("keys" in config.json) that defaults to the system tg runs on.
  • Settings menu: esc on the chat list opens it, like btop. Theme, spacing and shortcut style change at once and are saved to config.json, one field at a time over the file as it is then.

Screenshots

Before:

before-bot

After, with the buttons, the dividers and the rules:

after-bot

Clicking @build_demo_bot shows the bot's answer:

after-press

Clicking a link button copies it:

after-link

Settings menu, theme switched live to macchiato:

after-settings

Mac shortcut labels while typing (ctrl+c reads "clear"):

after-mac

After ctrl+c on a draft, the composer is empty and tg still runs:

after-ctrlc

Proof: go test ./..., go vet ./... and gofmt -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. The messages.getBotCallbackAnswer call and the inline keyboard conversion in internal/mtp were 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.

Delegate R1 R2 R3 R4 R5 R6 R7 R8
Claude Opus 9/10 9/10 9/10 not run 8/10 9/10 not run not run
GPT Sol 8/10 9/10 9/10 10/10 7/10 8/10 8/10 10/10
Muse Wonder unavailable (quota until 2026-11-23)

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

  • Adds a settings menu to the TUI (opened with Esc from the chat list) for theme, spacing, and shortcut-label style. Changes apply immediately and persist through a save callback that writes a new Keys field (mac, pc, or empty for system default) to the config file. See settings.go and config.go.
  • Adds inline bot button support: Telegram callback, URL, and copy-text buttons are rendered as width-constrained rows, callback presses call the new core.Backend.Press method, and answers display as a note (URLs are copied). MTProto treats BOT_RESPONSE_TIMEOUT as an empty answer. See core.go, convert.go, and backend.go.
  • Mac shortcut labels render alt+ and cmd+ as Option and Command symbols via model.keyName.
  • Ctrl+C now clears nonempty composer content (text, attachment, or active edit) before quitting. q quits only from the chat list.
  • Adds a rule above the status line and recalculates chat-list and conversation row bounds with model.bodyRows.
  • Risk: core.Backend gains a required Press method, so out-of-tree backend implementations must add it; the TUI also replaces the standalone spaced model field with a Look value, changing tui.Run and newModel signatures.

Macroscope summarized 953cbd2.

@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6784a058-098b-453b-89f2-0b80d9265cdd
Commits

Reviewing files that changed from the base of the PR and between 91205c9 and 953cbd2.

Files selected for processing: 13

  • README.md
  • internal/cli/cli.go
  • internal/config/config.go
  • internal/core/core.go
  • internal/core/guard.go
  • internal/core/guard_test.go
  • internal/demo/demo.go
  • internal/mtp/backend.go
  • internal/mtp/convert.go
  • internal/tui/settings.go
  • internal/tui/tui.go
  • internal/tui/tui_test.go
  • internal/tui/view.go
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Nov 20, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Approvability

Verdict: Approved at e51bb1a

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 953cbd2. Prior analysis still applies.

You can add or adjust custom eligibility rules. Learn more.

@macroscopeapp
macroscopeapp Bot dismissed their stale review November 20, 2026 19:45

Dismissing prior approval to re-evaluate 12c19ec

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Nov 20, 2026
@macroscopeapp
macroscopeapp Bot dismissed their stale review November 20, 2026 19:47

Dismissing prior approval to re-evaluate e51bb1a

@RealDoc06 RealDoc06 changed the title feat(tui): settings menu, bot buttons and Mac shortcut labels feat(tui): settings menu, pressable bot buttons and Mac shortcut labels Nov 20, 2026
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>
@RealDoc06
RealDoc06 merged commit 303b195 into main Nov 20, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant