Skip to content

feat: tog ui — interactive Calendar View TUI#54

Merged
toddhainsworth merged 13 commits into
mainfrom
feature/46_tog-ui-calendar-view
May 13, 2026
Merged

feat: tog ui — interactive Calendar View TUI#54
toddhainsworth merged 13 commits into
mainfrom
feature/46_tog-ui-calendar-view

Conversation

@toddhainsworth

Copy link
Copy Markdown
Owner

Implements all vertical slices for #46.

Slices

Closes #47
Closes #48
Closes #49
Closes #50
Closes #51
Closes #52
Closes #53

… and interface

Implements the API client methods and TogglClient interface additions needed
by the Calendar View TUI. Also adds parseLocalHHMM for HH:MM local→UTC
conversion, and updates CONTEXT.md and ADR-0006 with Calendar View domain
terminology.

Fixes #47
Wires `tog ui` as a new top-level subcommand. Implements a Bubbletea
model with Day view: 2-line entry rows, live 1-second ticker for running
entry elapsed time, day navigation with re-fetch, status bar, help bar.
Promotes bubbletea and lipgloss to direct dependencies.

Fixes #48
Adds Tab-toggled Week view: 7 ISO-week columns (Mon–Sun), 2-line entry
rows trimmed with …, fixed column height with +N more overflow row,
column/row navigation, and Tab return to Day view anchored to the
selected column.

Fixes #49
Adds global 's' keybinding in both Day and Week view. Calls StopTimeEntry
via an async command; updates the entry in-place on success. Shows a
transient status bar message when no timer is running. Extends TogglFetcher
interface with StopTimeEntry and passes workspaceID into the model.

Fixes #50
Adds Enter-triggered edit modal (huh form) with description, start/end
(HH:MM local, cross-midnight rollover), project and task selects
populated from disk cache. End time locked for running entries. Saves
via UpdateTimeEntry; updates entry in-place on success. Esc cancels.

Fixes #51
Adds 'n' keybinding to open Edit modal in create mode (empty fields,
end time required). Saves via CreateTimeEntry; appends new entry to the
correct day bucket in both Day and Week view. Fixes timezone consistency
in groupEntriesByDay and createResultMsg by normalising to local midnight.

Fixes #52
Adds 'd' keybinding that opens a huh.Confirm overlay showing the entry
description and "This cannot be undone." Confirming calls DeleteTimeEntry
and removes the entry from Day and Week view immediately. Esc or Cancel
closes the modal with no side effects.

Fixes #53
- Day view help bar was missing the Tab keybinding (US39)
- s in Day view now uses m.runningEntry so it can stop a timer
  running on a different day than the one currently viewed (US29)
- Project and task names now resolved from a cache fetch at startup
  instead of rendering raw IDs (US6)
Extract StripANSI, Width, Pad, and Truncate into internal/ui/display
with direct unit tests (Fixes #58).

Address code review findings:
- Remove blocking ListProjects/ListWorkspaceTasks calls from Update loop;
  store project/task slices on Model via fetchNames cmd instead
- Fix overflow label off-by-one: show +N+1 to count the displaced slot
- weekFetchResultMsg now clears fetchErr on success (mirrors fetchResultMsg)
- Remove dead targetDay field from createResultMsg, deleteResultMsg, and
  deleteConfirmModal
- Remove dead groupEntriesByDay function and its test
- Remove unused _ int parameter from renderWeekRow
When the project/task fetch fails, pressing n or enter no longer
silently no-ops with a status-bar message. The modal opens in a
degraded state (no project selector) with the fetch error shown as
an inline banner above the form.

Fixes #59
- StripANSI: handle full CSI terminator range [@-~], not only SGR 'm'
- fetchNames: document why task errors are intentionally discarded
- DayHandler 's': note cross-day running-entry limitation
- DayHandler 'tab': document that week view anchors to today, not m.date
- Remove untracked docs/ui-mockup.md planning artefact
@toddhainsworth toddhainsworth merged commit 81cde89 into main May 13, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment