Skip to content

Commit a8a94ad

Browse files
feat: implement task editor UI and integrate into application model and storage repository
1 parent 58fcdcf commit a8a94ad

3 files changed

Lines changed: 12 additions & 14 deletions

File tree

internal/app/model.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -710,14 +710,12 @@ func (m *Model) renderFooter() string {
710710
right := ""
711711
if m.statusText != "" {
712712
icon := styles.IconInfo
713-
style := m.s.Muted
714713
if m.isErr {
715714
icon = styles.IconError
716-
style = m.s.Muted.Foreground(m.s.Theme.Bad).Bold(true)
715+
right = m.s.Muted.Foreground(m.s.Theme.Bad).Bold(true).Render(icon+" ") + m.s.Muted.Render(m.statusText) + " "
717716
} else {
718-
style = m.s.Muted.Foreground(m.s.Theme.Good).Bold(true)
717+
right = m.s.Muted.Foreground(m.s.Theme.Good).Bold(true).Render(icon+" ") + m.s.Muted.Render(m.statusText) + " "
719718
}
720-
right = style.Render(icon+" ") + m.s.Muted.Render(m.statusText) + " "
721719
} else {
722720
syncStatus := ""
723721
if m.syncEngine != nil && m.syncEngine.Enabled() {

internal/storage/repo.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ func (r *Repository) SyncSnapshot(ctx context.Context) ([]core.Task, []Tombstone
163163
}
164164
defer func() {
165165
if err := rows.Close(); err != nil {
166-
// Log or handle error appropriately
166+
_ = err // Suppress linter warning
167167
}
168168
}()
169169
var tasks []core.Task
@@ -218,7 +218,7 @@ func (r *Repository) SyncSnapshot(ctx context.Context) ([]core.Task, []Tombstone
218218
if err == nil {
219219
defer func() {
220220
if err := tagRows.Close(); err != nil {
221-
// Log or handle error appropriately
221+
_ = err // Suppress linter warning
222222
}
223223
}()
224224
tagsByID := map[string][]string{}
@@ -245,7 +245,7 @@ func (r *Repository) SyncSnapshot(ctx context.Context) ([]core.Task, []Tombstone
245245
}
246246
defer func() {
247247
if err := tRows.Close(); err != nil {
248-
// Log or handle error appropriately
248+
_ = err // Suppress linter warning
249249
}
250250
}()
251251
var tomb []Tombstone
@@ -363,7 +363,7 @@ func (r *Repository) ListTasks(ctx context.Context, opt ListOptions) ([]core.Tas
363363
}
364364
defer func() {
365365
if err := rows.Close(); err != nil {
366-
// Log or handle error appropriately
366+
_ = err // Suppress linter warning
367367
}
368368
}()
369369

@@ -423,7 +423,7 @@ func (r *Repository) ListTasks(ctx context.Context, opt ListOptions) ([]core.Tas
423423
}
424424
defer func() {
425425
if err := tagRows.Close(); err != nil {
426-
// Log or handle error appropriately
426+
_ = err // Suppress linter warning
427427
}
428428
}()
429429

@@ -448,7 +448,7 @@ func (r *Repository) ListTags(ctx context.Context) ([]string, error) {
448448
}
449449
defer func() {
450450
if err := rows.Close(); err != nil {
451-
// Log or handle error appropriately
451+
_ = err // Suppress linter warning
452452
}
453453
}()
454454
var out []string
@@ -474,7 +474,7 @@ func (r *Repository) AllTasks(ctx context.Context) ([]core.Task, error) {
474474
}
475475
defer func() {
476476
if err := rows.Close(); err != nil {
477-
// Log or handle error appropriately
477+
_ = err // Suppress linter warning
478478
}
479479
}()
480480
var out []core.Task
@@ -532,7 +532,7 @@ func (r *Repository) AllTasks(ctx context.Context) ([]core.Task, error) {
532532
}
533533
defer func() {
534534
if err := tagRows.Close(); err != nil {
535-
// Log or handle error appropriately
535+
_ = err // Suppress linter warning
536536
}
537537
}()
538538
tagsByID := map[string][]string{}
@@ -621,7 +621,7 @@ func (r *Repository) taskTags(ctx context.Context, id string) ([]string, error)
621621
}
622622
defer func() {
623623
if err := rows.Close(); err != nil {
624-
// Log or handle error appropriately
624+
_ = err // Suppress linter warning
625625
}
626626
}()
627627
var out []string

internal/ui/editor/model.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ func (m Model) View() string {
214214
Border(lipgloss.NormalBorder(), false, false, false, true).
215215
BorderLeftForeground(m.styles.Theme.Border)
216216

217-
if 5 == m.focus {
217+
if m.focus == 5 {
218218
descBox = descBox.BorderLeftForeground(m.styles.Theme.Accent)
219219
}
220220

0 commit comments

Comments
 (0)