Skip to content

Commit

Permalink
fix: closing task details pane moves to next page
Browse files Browse the repository at this point in the history
  • Loading branch information
dhth committed Jul 15, 2024
1 parent c09deed commit bff020c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ G go to the end
tab move between views
c update context for a task
C toggle showing context
d show task details in a full screen pane
d toggle Task Details pane
v toggle between compact and spacious view
h/l move backwards/forwards when in the task details view
q/esc/ctrl+c go back/quit
Expand Down
2 changes: 1 addition & 1 deletion internal/ui/help.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ G go to the end
tab move between views
c update context for a task
C toggle showing context
d show task details in a full screen pane
d toggle Task Details pane
v toggle between compact and spacious view
h/l move backwards/forwards when in the task details view
q/esc/ctrl+c go back/quit
Expand Down
7 changes: 6 additions & 1 deletion internal/ui/initial.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,13 @@ func InitialModel(db *sql.DB, config Config) model {
taskList.SetFilteringEnabled(false)
taskList.SetShowHelp(false)
taskList.DisableQuitKeybindings()
taskList.KeyMap.PrevPage.SetKeys("left", "h", "pgup")
taskList.KeyMap.NextPage.SetKeys("right", "l", "pgdown")

taskList.Styles.Title = taskList.Styles.Title.
Foreground(lipgloss.Color(defaultBackgroundColor)).
Background(lipgloss.Color(config.TaskListColor)).
Bold(true)

taskListTitleStyle := titleStyle.Background(lipgloss.Color(config.TaskListColor))

atlSelItemStyle := lipgloss.NewStyle().Foreground(lipgloss.Color(config.ArchivedTaskListColor))
Expand All @@ -53,6 +55,9 @@ func InitialModel(db *sql.DB, config Config) model {
archivedTaskList.SetFilteringEnabled(false)
archivedTaskList.SetShowHelp(false)
archivedTaskList.DisableQuitKeybindings()
archivedTaskList.KeyMap.PrevPage.SetKeys("left", "h", "pgup")
archivedTaskList.KeyMap.NextPage.SetKeys("right", "l", "pgdown")

archivedTaskList.Styles.Title = archivedTaskList.Styles.Title.
Foreground(lipgloss.Color(defaultBackgroundColor)).
Background(lipgloss.Color(config.ArchivedTaskListColor)).
Expand Down
6 changes: 6 additions & 0 deletions internal/ui/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -528,13 +528,19 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
taskList.SetShowHelp(false)
taskList.DisableQuitKeybindings()
taskList.Styles.Title = m.taskList.Styles.Title
taskList.KeyMap.PrevPage.SetKeys("left", "h", "pgup")
taskList.KeyMap.NextPage.SetKeys("right", "l", "pgdown")

m.taskList = taskList
m.taskList.Select(tlIndex)

archivedTaskList.SetShowTitle(false)
archivedTaskList.SetFilteringEnabled(false)
archivedTaskList.SetShowHelp(false)
archivedTaskList.DisableQuitKeybindings()
archivedTaskList.KeyMap.PrevPage.SetKeys("left", "h", "pgup")
archivedTaskList.KeyMap.NextPage.SetKeys("right", "l", "pgdown")

m.archivedTaskList = archivedTaskList
m.archivedTaskList.Select(atlIndex)

Expand Down

0 comments on commit bff020c

Please sign in to comment.