res-code: proof-of-concept port from Bubble Tea to Limoni #32

Open
opened 2026-10-14 17:04:54 +00:00 by muse-lantern · 1 comment
Member

Goal

Proof-of-concept port of res-code from Bubble Tea + lipgloss to Limoni, following the res-edit PoC (residual/.agent#30, branch limoni-res-edit).

Scope

  • extra/internal/code (~3000 lines, 14 files): sidebar, tabbar, terminal pane, filepicker, statusbar, keys, mouse, theme, render.
  • extra/cmd/res-code: thin main — swap tea.NewProgram for limoni.Run.
  • The res-edit PoC established the patterns: cell.Style amber theme, limoni.KeyEvent dispatch (Ctrl via k.Ctrl), Draw(f, ev) functions, uitest verification. Reuse them.
  • Shared libs (core/lib/cmd/ui, core/lib/tui/overlay) are still bubbletea-based — res-code needs its own Limoni chrome (as res-edit did with its palette).
  • Note: extra/ pins a published core pseudo-version, so the build is insulated from limoni-res-edit branch API changes.
  • Preserve: amber palette, Ctrl-modkey contract (never Alt), slow-terminal handling.
  • Branch: limoni-res-code.

Acceptance

  • go build ./..., go vet ./..., go test ./... green in extra/.
  • CGO_ENABLED=0 static binary builds.
  • Headless uitest verification where feasible.
  • No new colors; no Alt bindings.

Out of scope

  • Merging to main.
## Goal Proof-of-concept port of res-code from Bubble Tea + lipgloss to Limoni, following the res-edit PoC (residual/.agent#30, branch `limoni-res-edit`). ## Scope - `extra/internal/code` (~3000 lines, 14 files): sidebar, tabbar, terminal pane, filepicker, statusbar, keys, mouse, theme, render. - `extra/cmd/res-code`: thin main — swap `tea.NewProgram` for `limoni.Run`. - The res-edit PoC established the patterns: `cell.Style` amber theme, `limoni.KeyEvent` dispatch (Ctrl via `k.Ctrl`), `Draw(f, ev)` functions, uitest verification. Reuse them. - Shared libs (`core/lib/cmd/ui`, `core/lib/tui/overlay`) are still bubbletea-based — res-code needs its own Limoni chrome (as res-edit did with its palette). - Note: `extra/` pins a published core pseudo-version, so the build is insulated from `limoni-res-edit` branch API changes. - Preserve: amber palette, Ctrl-modkey contract (never Alt), slow-terminal handling. - Branch: `limoni-res-code`. ## Acceptance - `go build ./...`, `go vet ./...`, `go test ./...` green in `extra/`. - `CGO_ENABLED=0` static binary builds. - Headless uitest verification where feasible. - No new colors; no Alt bindings. ## Out of scope - Merging to main.
Author
Member

PoC complete — limoni-res-code pushed

The port is done and verified on branch limoni-res-code (not merged, no PR opened).

Ported: extra/internal/code/ (~3000 lines, 14 files) + cmd/res-code/main.go to Limoni v0.12.0, following the res-edit PoC patterns. Single Draw(f, ev) on *Model; business logic (tabs, terminal emulation, filepicker, sidebar, commands, status bar) unchanged. New Limoni-native palette (palette.go) and menu bar (menubar.go) since shared lib/cmd/ui is still bubbletea-based. tabbar.go merged into render.go.

Key points:

  • Key dispatch on limoni.KeyEvent (Ctrl chords via k.Ctrl); F-keys via limoni/core/driver (same API gap as #30).
  • Terminal: PTY reader goroutine → channel → limoni.Wakeup(), drained in Draw (VT stays single-threaded).
  • replace core => ../core added (matches existing config replace pattern) so res-code gets the ported Limoni Editor.
  • Amber palette exact; Ctrl-only app bindings, no Alt. Alt+key in the terminal pane is forwarded as ESC+key to the PTY child (correct terminal behavior, not an app binding).
  • Slow-terminal branch uses limoni.WithoutMouse().

Verified: go build/go vet/go test green in extra/; CGO_ENABLED=0 → static ELF (~10MB); two new uitest tests (open/type/palette/quit, tab open/close) pass; headless dumps confirm menu/tab/editor/terminal/statusbar/filepicker render in amber.

Finds:

  • Latent bug fixed: tab-bar clicks were tested at msg.Y == 0 (the menu-bar row) instead of row 1.
  • Same F1–F12 re-export gap as #30 — worth one upstream issue covering both.
## PoC complete — `limoni-res-code` pushed The port is done and verified on branch `limoni-res-code` (not merged, no PR opened). **Ported:** `extra/internal/code/` (~3000 lines, 14 files) + `cmd/res-code/main.go` to Limoni v0.12.0, following the res-edit PoC patterns. Single `Draw(f, ev)` on `*Model`; business logic (tabs, terminal emulation, filepicker, sidebar, commands, status bar) unchanged. New Limoni-native palette (`palette.go`) and menu bar (`menubar.go`) since shared `lib/cmd/ui` is still bubbletea-based. `tabbar.go` merged into `render.go`. **Key points:** - Key dispatch on `limoni.KeyEvent` (Ctrl chords via `k.Ctrl`); F-keys via `limoni/core/driver` (same API gap as #30). - Terminal: PTY reader goroutine → channel → `limoni.Wakeup()`, drained in Draw (VT stays single-threaded). - `replace core => ../core` added (matches existing config replace pattern) so res-code gets the ported Limoni Editor. - Amber palette exact; Ctrl-only app bindings, no Alt. Alt+key in the terminal pane is forwarded as ESC+key to the PTY child (correct terminal behavior, not an app binding). - Slow-terminal branch uses `limoni.WithoutMouse()`. **Verified:** `go build`/`go vet`/`go test` green in `extra/`; `CGO_ENABLED=0` → static ELF (~10MB); two new uitest tests (open/type/palette/quit, tab open/close) pass; headless dumps confirm menu/tab/editor/terminal/statusbar/filepicker render in amber. **Finds:** - Latent bug fixed: tab-bar clicks were tested at `msg.Y == 0` (the menu-bar row) instead of row 1. - Same F1–F12 re-export gap as #30 — worth one upstream issue covering both.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
residual/.agent#32
No description provided.