diff --git a/CHANGELOG.md b/CHANGELOG.md index 377a08d..2412d4b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] +## [0.9.0] - 2024-06-03 +### Added +- Jump by a month on calendar using shift + left/right arrow key + ## [0.8.1] - 2024-05-08 ### Fixed - Calendar control stopped working after introducing delete on worklog list @@ -113,7 +117,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ### Added - Initial release of gojira -[Unreleased]: https://github.com/jzyinq/gojira/compare/0.8.1...master +[Unreleased]: https://github.com/jzyinq/gojira/compare/0.9.0...master +[0.9.0]: https://github.com/jzyinq/gojira/compare/0.8.1...0.9.0 [0.8.1]: https://github.com/jzyinq/gojira/compare/0.8.0...0.8.1 [0.8.0]: https://github.com/jzyinq/gojira/compare/0.7.0...0.8.0 [0.7.0]: https://github.com/jzyinq/gojira/compare/0.6.0...0.7.0 diff --git a/README.md b/README.md index c20501f..a566012 100644 --- a/README.md +++ b/README.md @@ -69,7 +69,6 @@ Just remember to urldecode it. Save it and you should ready to go! ## [Changelog](./CHANGELOG.md) ## Todo list - - [ ] Refactor ShowError focus return - [ ] Open issue in modal if it's the only result? - [ ] Prompt `are you sure want to exit` on escape key @@ -83,6 +82,7 @@ Just remember to urldecode it. Save it and you should ready to go! - `gojira log -i TICKET -t 1h30m` - `gojira` -> `gojira recent` - `gojira` -> `gojira --help` +- [x] `shift+arrow` for jumping between months instead of days - [x] trigger ui updates after worklog change more efficiently - [x] unify workLogs and worklogsIssues structs - use one for both - [x] Reduce jira/tempo spaghetti and unnecessary structs and functions @@ -111,4 +111,4 @@ Just remember to urldecode it. Save it and you should ready to go! - [x] While deleting freshly set worklog, fetch it's data from jira to delete it properly - currently there is: ``` The worklog has either been deleted or you no longer have permission to view it - ``` \ No newline at end of file + ``` diff --git a/go.mod b/go.mod index 334e37d..175d847 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,7 @@ module gojira go 1.22 require ( + github.com/charmbracelet/bubbles v0.18.0 github.com/charmbracelet/huh v0.3.0 github.com/charmbracelet/huh/spinner v0.0.0-20240328185852-590ecabc34b9 github.com/gdamore/tcell/v2 v2.7.4 @@ -16,7 +17,6 @@ require ( github.com/atotto/clipboard v0.1.4 // indirect github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect github.com/catppuccin/go v0.2.0 // indirect - github.com/charmbracelet/bubbles v0.18.0 // indirect github.com/charmbracelet/bubbletea v0.25.0 // indirect github.com/charmbracelet/lipgloss v0.10.0 // indirect github.com/containerd/console v1.0.4 // indirect diff --git a/gojira/calendar.go b/gojira/calendar.go index 3d2172f..0dcfb6b 100644 --- a/gojira/calendar.go +++ b/gojira/calendar.go @@ -105,13 +105,32 @@ func (c *Calendar) setDays() { } func controlCalendar(event *tcell.EventKey) *tcell.EventKey { + select { + case loading := <-loadingWorklogs: + if loading { + return event // If loadingWorklogs has a true value, return early + } + default: + } + switch event.Key() { case tcell.KeyLeft, tcell.KeyRight: - timePeriod := -time.Hour * 24 - if event.Key() == tcell.KeyRight { - timePeriod = time.Hour * 24 + var newTime time.Time + if event.Modifiers() == tcell.ModShift { + var datePeriod int + if event.Key() == tcell.KeyRight { + datePeriod = 1 + } else { + datePeriod = -1 + } + newTime = app.time.AddDate(0, datePeriod, 1) + } else { + timePeriod := -time.Hour * 24 + if event.Key() == tcell.KeyRight { + timePeriod = time.Hour * 24 + } + newTime = app.time.Add(timePeriod) } - newTime := app.time.Add(timePeriod) logrus.Debug("Changing date to ", newTime) app.time = &newTime loadWorklogs()