From 2ddb6f73fa397c0d8481ef846dc42696b756646d Mon Sep 17 00:00:00 2001 From: Grok Date: Sat, 6 Jun 2026 15:11:14 +0100 Subject: [PATCH] ui: simplify hint and remap clear keys - 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. --- docs/UI_DESIGN.md | 2 +- internal/ui/ui.go | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/docs/UI_DESIGN.md b/docs/UI_DESIGN.md index 5ac5717..b840532 100644 --- a/docs/UI_DESIGN.md +++ b/docs/UI_DESIGN.md @@ -62,7 +62,7 @@ This decoration keeps the UI lightweight while making the keypad feel far more " - `lipgloss.Place(width, height, lipgloss.Center, lipgloss.Center, card)` - No stretching to full terminal width (important lesson from gostations player polish). - Subtle inner borders on panels where depth helps. -- Minimal non-wrapping hint row at bottom of window (lipgloss bar with key badges in 63 bg, like final gostations player): e.g. "Tab:BASE q:quit etc." +- Minimal non-wrapping hint row at bottom of window (lipgloss bar with key badges in 63 bg, like final gostations player): e.g. "Tab:BASE m:MOD BackSpace:C Del:AC" - Resize handling: card recenters; display and grid adapt gracefully (minimum sensible width enforced with a message if too narrow). - Consistent dark theme, green LCD accents, flash feedback. diff --git a/internal/ui/ui.go b/internal/ui/ui.go index bfb4d27..5e6f897 100644 --- a/internal/ui/ui.go +++ b/internal/ui/ui.go @@ -84,15 +84,12 @@ func (a *App) Update(msg tea.Msg) (tea.Model, tea.Cmd) { // The "base" flash will highlight the base label in the display row. return a, tick(140*time.Millisecond, "base") - case "c", "C": + case "backspace": a.engine.ClearEntry() a.flash = "clear" a.pressedKey = "C" return a, tick(140*time.Millisecond, "key") - case "backspace": - a.engine.Backspace() - case ".": a.engine.EnterDecimalPoint() a.pressedKey = "." @@ -121,7 +118,7 @@ func (a *App) Update(msg tea.Msg) (tea.Model, tea.Cmd) { a.pressedKey = msg.String() return a, tick(140*time.Millisecond, "key") - case "ac", "ctrl+l": // All Clear + case "delete", "del": // All Clear a.engine.AllClear() a.flash = "clear" a.pressedKey = "AC" @@ -265,7 +262,7 @@ func (a *App) View() string { Render(rawGrid) // Hint (minimal, non-wrapping, like gostations final player) - hint := lipgloss.NewStyle().Faint(true).Render("Tab:BASE 0-9 . = + - * / m:MOD c:C ac:AC q:quit") + hint := lipgloss.NewStyle().Faint(true).Render("Tab:BASE m:MOD BackSpace:C Del:AC") centeredHint := lipgloss.NewStyle().Width(dispW).Align(lipgloss.Center).Render(hint) inner := lipgloss.JoinVertical(lipgloss.Left,