From 57e433ade2e450ebaab1efeef34bd0f02823f2e9 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 28 Jun 2025 14:22:57 +0300 Subject: feat: add project field support to TaskSamurai MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add comprehensive project field support including: - Project column in table view with automatic width calculation - 'J' hotkey to edit project in both table and detail views - Project field in task detail view (between Start and Entry) - Search functionality includes project names - Enter key on project column allows inline editing The project field integrates seamlessly with Taskwarrior's native project support and follows the same UI patterns as other editable fields in the application. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- internal/ui/taskdetail.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'internal/ui/taskdetail.go') diff --git a/internal/ui/taskdetail.go b/internal/ui/taskdetail.go index 70c06a0..c7a5b89 100644 --- a/internal/ui/taskdetail.go +++ b/internal/ui/taskdetail.go @@ -17,6 +17,7 @@ const ( fieldTags fieldDue fieldStart + fieldProject fieldEntry fieldRecur fieldDescription @@ -119,6 +120,24 @@ func (m *Model) renderTaskDetail() string { currentField++ lines = append(lines, m.renderTaskFieldWithIndex("Start", m.formatTaskDate(t.Start), labelStyle, valueStyle, currentField)) currentField++ + + // Project + if m.projEditing && m.projID == t.ID { + // Show project editing UI without prompt + originalPrompt := m.projInput.Prompt + m.projInput.Prompt = "" + projView := m.projInput.View() + m.projInput.Prompt = originalPrompt + lines = append(lines, m.renderEditingField("Project", projView, labelStyle, currentField)) + } else { + projectValue := t.Project + if projectValue == "" { + projectValue = "-" + } + lines = append(lines, m.renderTaskFieldWithIndex("Project", projectValue, labelStyle, valueStyle, currentField)) + } + currentField++ + lines = append(lines, m.renderTaskFieldWithIndex("Entry", m.formatTaskDate(t.Entry), labelStyle, valueStyle, currentField)) currentField++ -- cgit v1.2.3