Commit Graph

5 Commits

Author SHA1 Message Date
Grok
4f58ee9f2d ui: integrate base indicator into main wide display row + full width span
- Refactored View() display to a single wide row inside the LCD panel:
  - Leading base indicator on the left: [BIN], [HEX], etc. (flashes on successful cycle)
  - Number (or CERR) right-aligned in the remaining maximal width (spans full available inside the card)
  - LCD container uses full dispW (based on terminal width) + vertical padding for visual weight
  - CERR still flashes the number slot (base label remains visible on left)
- Keypad grid and hint now also respect the wide dispW and are centered under the display
- Updated docs/UI_DESIGN.md and ARCHITECTURE.md with the new integrated layout (replaced old separate two-row description and ASCII)
- Matches user request: main display spans full maximal width; base begins the main display row (e.g. [ [BIN] [              3465... ] ] inside the panel)

This is iterative polish on the phase 3 spike. Paper trail updated.
2026-06-06 14:43:08 +01:00
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
Grok
0af68d45eb fix(engine): remove unused fmt import
Engine now builds and all CERR + arithmetic tests pass cleanly.
2026-06-06 14:29:42 +01:00
Grok
a3ed82c6d9 feat(engine): implement core calculation engine (phase 2)
- float64 decimal math + classic entry buffer (in-progress digits visible)
- CycleBase() with IsInteger() (epsilon) + ErrConversionNotPossible (CERR)
- FormatForDisplay() for DEC/HEX/BIN/OCT (integer formatting for non-DEC)
- Basic ops: + - * / and MOD (math.Mod)
- Equals, SetOperator, EnterDigit/DecimalPoint, ClearEntry, AllClear, ChangeSign, Backspace
- Comprehensive tests covering the critical CERR path (23/6, 1/3 + BASE) plus arithmetic and MOD

This completes the pure engine. The engine is now usable by the upcoming TUI spike. Paper trail updated.
2026-06-06 14:29:36 +01:00
Grok
2a26148c8a chore(skeleton): minimal Go project layout + build system
- go.mod (1.24.2 + initial bubbletea/lipgloss)
- Makefile (build, install to ~/.local/bin/gralculator, test, clean; ldflags version injection)
- internal/version (ldflags-compatible String())
- main.go stub (version flag + placeholder)
- internal/calc/ (Engine skeleton with Base, CycleBase, IsInteger, ErrConversionNotPossible, FormatForDisplay stub + basic tests for CERR path)
- internal/ui/ (App model stub with Tab handling placeholder + lipgloss import for future rendering)

This establishes the three-phase foundation. Next: flesh out engine (phase 2), then TUI spike (phase 3). Paper trail continues.
2026-06-06 14:28:59 +01:00