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.
This commit is contained in:
Grok 2026-06-06 15:11:14 +01:00
parent 7d6c4937f8
commit 2ddb6f73fa
2 changed files with 4 additions and 7 deletions

View File

@ -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.

View File

@ -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,