summaryrefslogtreecommitdiff
path: root/internal/tui/timer_box.go
diff options
context:
space:
mode:
authorT <t@tjp.lol>2025-08-06 16:00:05 -0600
committerT <t@tjp.lol>2025-08-06 16:26:00 -0600
commitc53e8c4e41aa88566b101431bcd104ebf7b34312 (patch)
tree614e1c911fae328cfdb1a35050bf94658d9253f8 /internal/tui/timer_box.go
parent65e2ed65775d64afbc6065a3b4ac1069020093ca (diff)
TUI fixes, and WIP modal dialog rendering
Diffstat (limited to 'internal/tui/timer_box.go')
-rw-r--r--internal/tui/timer_box.go25
1 files changed, 20 insertions, 5 deletions
diff --git a/internal/tui/timer_box.go b/internal/tui/timer_box.go
index 408c3b5..1a88870 100644
--- a/internal/tui/timer_box.go
+++ b/internal/tui/timer_box.go
@@ -50,7 +50,9 @@ type TimerBoxModel struct {
// NewTimerBoxModel creates a new timer box model
func NewTimerBoxModel() TimerBoxModel {
- return TimerBoxModel{}
+ return TimerBoxModel{
+ currentTime: time.Now(),
+ }
}
// View renders the timer box
@@ -114,10 +116,23 @@ func (m TimerBoxModel) renderActiveTimer() string {
func (m TimerBoxModel) renderInactiveTimer() string {
content := "⚪ Last Timer (Inactive)\n\n"
- content += "No active timer\n\n"
- content += "Ready to start tracking time.\n"
- content += "Use 'p' to punch in, or select\n"
- content += "a client/project from the left."
+ timerLine := fmt.Sprintf("Duration: %s", FormatDuration(m.timerInfo.Duration))
+ content += inactiveTimerStyle.Render(timerLine) + "\n\n"
+
+ if m.timerInfo.ProjectName != "" {
+ content += inactiveTimerStyle.Render(fmt.Sprintf("Project: %s / %s", m.timerInfo.ClientName, m.timerInfo.ProjectName)) + "\n"
+ } else {
+ content += inactiveTimerStyle.Render(fmt.Sprintf("Client: %s", m.timerInfo.ClientName)) + "\n"
+ }
+
+ content += inactiveTimerStyle.Render(fmt.Sprintf("Started: %s", m.timerInfo.StartTime.Local().Format("3:04 PM"))) + "\n"
+
+ if m.timerInfo.Description != nil {
+ content += "\n" + inactiveTimerStyle.Render(fmt.Sprintf("Description: %s", *m.timerInfo.Description)) + "\n"
+ }
+ if m.timerInfo.BillableRate != nil {
+ content += inactiveTimerStyle.Render(fmt.Sprintf("Rate: $%.2f/hr", *m.timerInfo.BillableRate)) + "\n"
+ }
return content
}