- Hint now exactly: "Tab:BASE m:MOD BackSpace:C Del:AC"
- Removed all operator keys, numbers, equals, q:quit etc. from the hint per request.
- Remapped:
- backspace key -> ClearEntry (flashes the visual 'C' button)
- delete/del key -> AllClear (flashes the visual 'AC' button)
- Removed the old 'c','C' and 'ac','ctrl+l' handlers to match the new keymap.
- Updated docs/UI_DESIGN.md example to the new minimal hint.
The visual 'C' and 'AC' buttons remain in the grid for reference; their functions are now on Backspace and Del.
- BASE is now Tab-only (still fully functional, with clear hint: 'Tab:BASE').
- Deleted the special baseRow / fullRowWidth centering logic and the single-button bottom row.
- The keypad grid is now a clean, regular 4-row block of keys.
- This eliminates the persistent bottom-border alignment bug on the BASE key (chopped + shifted).
- Updated Tab handler to use the 'base' flash on the display label instead of trying to highlight a non-existent button.
- Cleaned up unused baseKey style and related comments.
- Updated docs/UI_DESIGN.md to document that BASE is keyboard-only via Tab.
As the user noted: with a good hint, the visual key was unnecessary and was causing layout friction. The keypad now looks much more balanced.
Per user request: eliminate the enclosing dark panel (bg 234 + NormalBorder)
around the entire key grid. Only the individual key styling remains
(bordered mini-panels with per-type colors, Height(2), pressed flash inversion).
- The rawGrid is now centered directly under the display using
Width(dispW).Align(Center).
- BASE button still appears nicely centered on its row thanks to the
uniform row width padding we added earlier.
- Keys sit directly on the main card background.
- Updated docs/UI_DESIGN.md to match.
Much cleaner and closer to a pure 'tactile keys only' look.
Root cause: rowBase was much narrower than the other rows. When we did
Width(dispW).Align(Center).Render(rawGrid) the vertical join produced
a non-rectangular block, so the panel's bottom border was drawn around
the centered narrow line (chopped + shifted under BASE) and the bg 234
had large empty side regions on the bottom row.
Fix:
- Compute fullRowWidth from a complete row.
- Render the BASE key centered inside a string of that exact width.
- Now rawGrid is a true rectangle (all 5 rows same width).
- Render the backing panel *tightly* to rawGrid first (no forced width).
- Then center the resulting compact panel under the display with
Width(dispW).Align(Center).
Result:
- Clean, straight bottom border under the BASE button.
- The black keypad background now exactly matches the bounding box
of the actual keys (including the centered BASE row).
- No more dangling empty black space on the sides at the bottom.
The rest of the tactile key styles, per-key pressed flash, and wide
integrated display row are unchanged.
- Individual keys now use bordered mini-panels (NormalBorder 238) + dedicated bg/fg per type:
- Numbers: neutral dark
- Operators: 63 accent
- Clears (C/AC): red-tinted warning
- MOD: orange highlight
- BASE: 63 border + bold (stands out)
- Height(2) + padding for chunkier physical-button presence.
- Pressed state inverts to flashStyle (bright 63 bg + white bold) for 140ms on every key action — direct 'click' feedback.
- Gaps between keys + full-width backing panel (bg 234 + border) create a 'faceplate' effect so keys look like they sit on a real calculator keyboard.
- Updated per-key tracking (pressedKey) in model + Update so flash is applied to the correct button.
- Documented the new tactile decoration in docs/UI_DESIGN.md (replaced old plain-text description).
- Matches the wide integrated display row from previous iteration.
The keypad now feels much more tactile and calculator-like while staying true to the lipgloss + gostations patterns.
- 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.
- 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.
- 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.