From 54c791927b2851fb6739ed75897090c3c39ecca1 Mon Sep 17 00:00:00 2001 From: T Date: Fri, 8 Aug 2025 10:11:07 -0600 Subject: create forms for clients and projects --- internal/tui/commands.go | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'internal/tui/commands.go') diff --git a/internal/tui/commands.go b/internal/tui/commands.go index be5c8dc..ad3255f 100644 --- a/internal/tui/commands.go +++ b/internal/tui/commands.go @@ -13,12 +13,13 @@ type ( selectionMsg struct{ Forward bool } drillDownMsg struct{} drillUpMsg struct{} - searchActivated struct{} modalClosed struct{} openTimeEntryEditor struct{} openModalUnchanged struct{} openDeleteConfirmation struct{} recheckBounds struct{} + openCreateClientModal struct{} + openCreateProjectModal struct{} ) func navigate(forward bool) tea.Cmd { @@ -52,6 +53,10 @@ func punchInOnSelection(m AppModel) tea.Cmd { clientID, projectID, description, entryRate = m.historyBox.selection() } + if clientID == "" { + return nil + } + _, _ = actions.New(m.queries).PunchIn(context.Background(), clientID, projectID, description, entryRate) // TODO: use the returned TimerSession instead of re-querying everything return m.refreshCmd() @@ -70,10 +75,6 @@ func changeSelection(forward bool) tea.Cmd { return func() tea.Msg { return selectionMsg{forward} } } -func activateSearch() tea.Cmd { - return func() tea.Msg { return searchActivated{} } -} - func closeModal() tea.Cmd { return func() tea.Msg { return modalClosed{} } } @@ -89,3 +90,11 @@ func reOpenModal() tea.Cmd { func confirmDeleteEntry() tea.Cmd { return func() tea.Msg { return openDeleteConfirmation{} } } + +func createClientModal() tea.Cmd { + return func() tea.Msg { return openCreateClientModal{} } +} + +func createProjectModal() tea.Cmd { + return func() tea.Msg { return openCreateProjectModal{} } +} -- cgit v1.2.3