diff options
author | T <t@tjp.lol> | 2025-08-08 10:11:07 -0600 |
---|---|---|
committer | T <t@tjp.lol> | 2025-08-08 10:11:19 -0600 |
commit | 54c791927b2851fb6739ed75897090c3c39ecca1 (patch) | |
tree | 8f97b3509ccffed1351fe3d101e70c1cf0d861a9 /internal/tui/commands.go | |
parent | a7ee7f7280d593481501446008acc05e32abcd22 (diff) |
create forms for clients and projects
Diffstat (limited to 'internal/tui/commands.go')
-rw-r--r-- | internal/tui/commands.go | 19 |
1 files changed, 14 insertions, 5 deletions
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{} } +} |