diff --git a/CHANGELOG.md b/CHANGELOG.md index 2bc16a1..3ad9a81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Add support for JIRA Cloud installation - Allow shifting timestamps for worklog entries using h/j/k/l/J/K - Show time spent on unsynced worklog entries + +### Changed + +- Save UTC timestamps in the database +- Allow going back views instead of quitting directly - Improved error handling - Upgrade to go 1.23.4 - Dependency upgrades diff --git a/README.md b/README.md index ce2f79c..840ed96 100644 --- a/README.md +++ b/README.md @@ -130,7 +130,9 @@ General 3 Switch to Synced Worklog List View Go to next view/form entry Go to previous view/form entry - ? Show help view + q/ Go back/reset filtering/quit + Cancel form/quit + ? Show help view General List Controls diff --git a/internal/ui/handle.go b/internal/ui/handle.go index ac58284..abdc7cf 100644 --- a/internal/ui/handle.go +++ b/internal/ui/handle.go @@ -117,8 +117,18 @@ func (m *Model) getCmdToSaveOrUpdateWL() tea.Cmd { return cmd } -func (m *Model) handleEscape() { +func (m *Model) handleEscape() bool { + var quit bool + switch m.activeView { + case issueListView: + quit = true + case wLView: + quit = true + case syncedWLView: + quit = true + case helpView: + quit = true case editActiveWLView: m.activeView = issueListView case saveActiveWLView: @@ -135,6 +145,8 @@ func (m *Model) handleEscape() { m.trackingInputs[i].SetValue("") } } + + return quit } func (m *Model) getCmdToGoForwardsInViews() tea.Cmd { @@ -232,8 +244,10 @@ func (m *Model) handleRequestToGoBackOrQuit() bool { if fs == list.Filtering || fs == list.FilterApplied { m.worklogList.ResetFilter() } else { - quit = true + m.activeView = issueListView } + case syncedWLView: + m.activeView = wLView case helpView: m.activeView = m.lastView default: diff --git a/internal/ui/help.go b/internal/ui/help.go index 4b12262..727b19e 100644 --- a/internal/ui/help.go +++ b/internal/ui/help.go @@ -40,7 +40,9 @@ var helpText = fmt.Sprintf(` 3 Switch to Synced Worklog List View Go to next view/form entry Go to previous view/form entry - ? Show help view + q/ Go back/reset filtering/quit + Cancel form/quit + ? Show help view `), helpHeaderStyle.Render("General List Controls"), helpSectionStyle.Render(` diff --git a/internal/ui/update.go b/internal/ui/update.go index 299cc33..aadf098 100644 --- a/internal/ui/update.go +++ b/internal/ui/update.go @@ -45,7 +45,10 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { return m, tea.Batch(cmds...) } case "esc": - m.handleEscape() + quit := m.handleEscape() + if quit { + return m, tea.Quit + } case "tab": viewSwitchCmd := m.getCmdToGoForwardsInViews() if viewSwitchCmd != nil {