gralculator/main.go
Grok 316ce708ac feat(tui): focused rendering spike for galculator-inspired two-row display + single BASE (phase 3)
- internal/ui/ui.go: full Bubble Tea App
  - Large tall LCD-style number area + small current-base row (only the active label highlighted)
  - CERR flash (~600ms color 63) on BASE when value is non-integer (exact policy from spec)
  - 140ms key action flashes (same style as gostations volume/skip/stop)
  - Minimal usable keypad grid (digits, + - * / = . +/- MOD C AC, prominent BASE button)
  - Tab (and button) drives engine.CycleBase()
  - Content-sized centered card (lipgloss.Place + rounded 63 border), subtle 238 inners
  - Minimal non-wrapping hint row
  - Reuses gostations lipgloss idioms (Join*, Width/Align/Center, flashStyle, NormalBorder, etc.)
- main.go: now actually launches tea.NewProgram (with AltScreen)
- Binary: build/gralculator is runnable
- Demonstrates: enter 23/6 = (or 1/3), press Tab → CERR blink, base stays DEC; integer values cycle cleanly and reformat (HEX etc.)

All three phases complete. Architecture + design notes live in docs/. Full commit history for backtracking.
2026-06-06 14:30:08 +01:00

33 lines
563 B
Go

package main
import (
"flag"
"fmt"
"os"
"github.com/gmgauthier/gralculator/internal/ui"
"github.com/gmgauthier/gralculator/internal/version"
)
var versionFlag bool
func init() {
flag.BoolVar(&versionFlag, "v", false, "print version and exit")
flag.BoolVar(&versionFlag, "version", false, "print version and exit")
}
func main() {
flag.Parse()
if versionFlag {
fmt.Println(version.String())
return
}
// Phase 3 spike: launch the real TUI.
if err := ui.Run(); err != nil {
fmt.Fprintf(os.Stderr, "gralculator: %v\n", err)
os.Exit(1)
}
}