Files
tai/research/tui-framework-design/bubbletea-chat-example.md
T
2026-10-12 00:53:52 +02:00

2.3 KiB

bubbletea examples/chat — viewport plus textarea chat example

Metadata

Field Value
Institute Molodetz Institute — Research & Retrieval Division
Subject tui-framework-design
Document type Source Dossier
Tier 1
Source title bubbletea examples/chat/main.go — chat example (no sidebar)
Source URL https://raw.githubusercontent.com/charmbracelet/bubbletea/main/examples/chat/main.go
Source publisher / author Charm (bubbletea project)
Source type repository
Source date (published) Unknown — not stated
Date researched 2026-10-11
Researched by tai (agent), model: Muse Spark, on behalf of retoor
Research method direct page fetch
Confidence Medium
Status Active

Summary

Charm's own minimal chat example: a full-width transcript viewport over a 3-row textarea with a 280-character limit, resizing both to the window on WindowSizeMsg, jumping to the bottom on send and resize, with Enter to send and Esc/Ctrl+C to quit. Notably sidebar-free.

Key findings

  • Layout is a transcript viewport plus a 3-row textarea (placeholder Send a message..., CharLimit 280, box-glyph prompt); there is no sidebar or chat list.
  • WindowSizeMsg resizes both components to full width with viewport height set to window height minus textarea height; sends and resizes trigger GotoBottom.
  • Enter sends; Esc or Ctrl+C quits.

Pros / strengths

  • Authoritative minimal precedent from the framework authors: the viewport-resize math and send-then-bottom pattern are directly reusable.
  • Shows the no-sidebar endpoint of the design space, bounding tai's choice.

Cons / limitations / caveats

  • An example, not a shipped client: no chat list, no status bar, no history, no per-message state — tai needs the fuller clients for those.
  • Full-width single-pane layout is rejected for tai, which needs a conversation list.

Relevance to tai

  • Contributes the viewport height math (window minus input) and send-then-bottom behavior to the messaging-layout conclusion; its sidebar-free shape is recorded there as a considered and rejected alternative.

Changelog

Date Change
2026-10-11 Initial dossier created from 2026-10-11 research-pass evidence (body opened via web_fetch by researching agent).