Add timestamp editor
This commit is contained in:
@ -10,7 +10,7 @@ import (
|
||||
type MainPage struct {
|
||||
common *common.Common
|
||||
activePage common.Component
|
||||
|
||||
|
||||
taskPage common.Component
|
||||
timePage common.Component
|
||||
}
|
||||
@ -22,7 +22,7 @@ func NewMainPage(common *common.Common) *MainPage {
|
||||
|
||||
m.taskPage = NewReportPage(common, common.TW.GetReport(common.TW.GetConfig().Get("uda.tasksquire.report.default")))
|
||||
m.timePage = NewTimePage(common)
|
||||
|
||||
|
||||
m.activePage = m.taskPage
|
||||
|
||||
return m
|
||||
@ -39,7 +39,8 @@ func (m *MainPage) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||
case tea.WindowSizeMsg:
|
||||
m.common.SetSize(msg.Width, msg.Height)
|
||||
case tea.KeyMsg:
|
||||
if key.Matches(msg, m.common.Keymap.Next) {
|
||||
// Only handle tab key for page switching when at the top level (no subpages active)
|
||||
if key.Matches(msg, m.common.Keymap.Next) && !m.common.HasSubpages() {
|
||||
if m.activePage == m.taskPage {
|
||||
m.activePage = m.timePage
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user