summaryrefslogtreecommitdiff
path: root/internal/ui/table.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-04-08 16:01:38 +0300
committerPaul Buetow <paul@buetow.org>2026-04-08 16:15:04 +0300
commitd13795080cb8a177d93e593ce91ba3a30b64c5ad (patch)
treeff2266af07b3186b502c3e69c658030e07213773 /internal/ui/table.go
parent8ce0a453f355dd3f9239ee33bf4a426f6951ac9f (diff)
Refactor UI input handlers for task 1
Diffstat (limited to 'internal/ui/table.go')
-rw-r--r--internal/ui/table.go64
1 files changed, 0 insertions, 64 deletions
diff --git a/internal/ui/table.go b/internal/ui/table.go
index 20928fd..464b29f 100644
--- a/internal/ui/table.go
+++ b/internal/ui/table.go
@@ -572,70 +572,6 @@ func (m *Model) handleWindowResize(msg tea.WindowSizeMsg) (tea.Model, tea.Cmd) {
return m, nil
}
-// handleEditDone handles completion of external editor
-func (m *Model) handleEditDone(msg editDoneMsg) (tea.Model, tea.Cmd) {
- if msg.err != nil {
- m.showError(fmt.Errorf("editor: %w", msg.err))
- }
- if m.showUltra {
- m.ultraFocusedID = m.editID
- }
- if !m.reloadAndReport() {
- m.editID = 0
- return m, nil
- }
- cmd := m.startBlink(m.editID, false)
- m.editID = 0
- return m, cmd
-}
-
-// handleDescEditDone handles the completion of description editing
-func (m *Model) handleDescEditDone(msg descEditDoneMsg) (tea.Model, tea.Cmd) {
- m.detailDescEditing = false
- if msg.tempFile != "" {
- defer func() { _ = os.Remove(msg.tempFile) }()
- }
-
- if msg.err != nil {
- m.statusMsg = fmt.Sprintf("Edit error: %v", msg.err)
- cmd := tea.Tick(2*time.Second, func(time.Time) tea.Msg {
- return struct{ clearStatus bool }{true}
- })
- return m, cmd
- }
-
- // Read the edited content
- content, err := os.ReadFile(msg.tempFile)
- if err != nil {
- m.statusMsg = fmt.Sprintf("Error reading file: %v", err)
- cmd := tea.Tick(2*time.Second, func(time.Time) tea.Msg {
- return struct{ clearStatus bool }{true}
- })
- return m, cmd
- }
-
- // Update the description
- newDesc := strings.TrimSpace(string(content))
- if m.currentTaskDetail != nil {
- err = task.SetDescription(m.currentTaskDetail.ID, newDesc)
- if err != nil {
- m.statusMsg = fmt.Sprintf("Error updating description: %v", err)
- cmd := tea.Tick(2*time.Second, func(time.Time) tea.Msg {
- return struct{ clearStatus bool }{true}
- })
- return m, cmd
- }
-
- // Reload and start blinking
- if !m.reloadAndReport() {
- return m, nil
- }
- return m, m.startDetailBlink(m.detailDescriptionFieldIndex())
- }
-
- return m, nil
-}
-
// handleBlinkMsg handles the blinking animation timer
func (m *Model) handleBlinkMsg() (tea.Model, tea.Cmd) {
// Handle detail view blinking