lune

created pr with 124.1 on 2026-04-22T02:46:44Z · by 613b58b7
changed status to closed on 2026-06-21T16:45:31Z · by 66ddd677
Closing as superceded by 126
cmds
checkout latest patchset:
ssh pr.pico.sh print 124 | git am -3
checkout any patchset in a patch request:
ssh pr.pico.sh print 124.[rev] | git am -3
add changes to patch request:
git format-patch main --stdout | ssh pr.pico.sh pr add 124
set PR to open (enables RSS notifications):
ssh pr.pico.sh pr open 124
set PR to draft (stops RSS notifications):
ssh pr.pico.sh pr draft 124

Patchset 124.1 on 2026-04-22T02:46:44Z · commit 280a9f0

listing real name of tasks
juan 2026-04-21T03:21:16Z
construction of db for management of decrypted names of tasks
juan 2026-04-21T05:43:09Z
fix UTF8 chracteres
juan 2026-04-21T21:13:24Z
filter by status and coloring types of status
juan 2026-04-21T21:18:53Z
update help
juan 2026-04-21T21:21:36Z
list areas names
juan 2026-04-21T21:44:53Z
adjust table tasks to truncate name and list area
juan 2026-04-21T21:56:40Z
partial implementation of listing tasks by areas
juan 2026-04-21T22:05:20Z
final implementation of listing tasks by areas with UTF-8 chracteres
juan 2026-04-21T22:10:20Z
sort on task list to show first do now
juan 2026-04-21T22:33:29Z
update with 8 char of id and db.go
juan 2026-04-21T23:27:54Z
partial implementation of TUI menu on task update
juan 2026-04-21T23:35:35Z
task name correcion on TUI menu of Update task
juan 2026-04-21T23:38:19Z
TUI menu for update task with others flags
juan 2026-04-21T23:43:02Z
helper for TUI update task
juan 2026-04-21T23:49:56Z
search by first 8 char of note id for editing it
juan 2026-04-22T00:00:17Z
partial implementation on note TUI menu for update
juan 2026-04-22T00:05:46Z
TUI menu notebook just with tags
juan 2026-04-22T00:20:55Z
Note update now let you insert only the first 8 char of notebook id in update
juan 2026-04-22T00:25:53Z
implementation of (lune note notebook-list) for listing all notebooks and its ID
juan 2026-04-22T01:10:51Z
partial implementation of lune note show-content ID
juan 2026-04-22T02:01:11Z
convert \n in new line and \ in space for lune note show-content ID
juan 2026-04-22T02:18:42Z
+57 -0 cmd/task/interactive.go #
......@@ -0,0 +1,57 @@
1+// SPDX-FileCopyrightText: Amolith <amolith@secluded.site>
2+//
3+// SPDX-License-Identifier: AGPL-3.0-or-later
4+
5+package task
6+
7+import (
8+ "git.secluded.site/go-lunatask"
9+ "github.com/charmbracelet/huh"
10+ "github.com/spf13/cobra"
11+)
12+
13+func runUpdateInteractive(cmd *cobra.Command, task *lunatask.Task, builder *lunatask.TaskUpdateBuilder) error {
14+ name := ""
15+ if task.Name != nil {
16+ name = *task.Name
17+ }
18+ if name == "" {
19+ name = "Unnamed Task"
20+ }
21+
22+ newStatus := ""
23+ if task.Status != nil {
24+ newStatus = string(*task.Status)
25+ }
26+
27+ form := huh.NewForm(
28+ huh.NewGroup(
29+ huh.NewInput().
30+ Title("Task Name").
31+ Value(&name),
32+ huh.NewSelect[string]().
33+ Title("Status").
34+ Options(
35+ huh.NewOption("Later", "later"),
36+ huh.NewOption("Next", "next"),
37+ huh.NewOption("In Progress", "in-progress"),
38+ huh.NewOption("Waiting", "waiting"),
39+ huh.NewOption("Completed", "completed"),
40+ ).
41+ Value(&newStatus),
42+ ),
43+ )
44+
45+ if err := form.Run(); err != nil {
46+ return err
47+ }
48+
49+ builder.Name(name)
50+
51+ if newStatus != "" {
52+ status := lunatask.TaskStatus(newStatus)
53+ builder.WithStatus(status)
54+ }
55+
56+ return nil
57+}
+29 -11 cmd/task/update.go #
......@@ -16,6 +16,7 @@ import (
1616 "git.secluded.site/lune/internal/ui"
1717 "git.secluded.site/lune/internal/validate"
1818 "github.com/spf13/cobra"
19+ "github.com/spf13/pflag"
1920 )
2021
2122 // UpdateCmd updates a task. Exported for potential use by shortcuts.
......@@ -66,29 +67,46 @@ func runUpdate(cmd *cobra.Command, args []string) error {
6667 return err
6768 }
6869
69- builder := apiClient.NewTaskUpdate(id)
70-
71- if err := applyUpdateName(cmd, builder); err != nil {
72- return err
73- }
74-
75- area, err := applyUpdateAreaAndGoal(cmd, builder)
70+ task, err := apiClient.GetTask(cmd.Context(), id)
7671 if err != nil {
7772 return err
7873 }
7974
80- if err := applyUpdateFlags(cmd, builder, area); err != nil {
81- return err
75+ builder := apiClient.NewTaskUpdate(id)
76+
77+ // Check if any flag is set
78+ hasFlags := false
79+ cmd.Flags().Visit(func(f *pflag.Flag) {
80+ hasFlags = true
81+ })
82+
83+ if !hasFlags {
84+ if err := runUpdateInteractive(cmd, task, builder); err != nil {
85+ return err
86+ }
87+ } else {
88+ if err := applyUpdateName(cmd, builder); err != nil {
89+ return err
90+ }
91+
92+ area, err := applyUpdateAreaAndGoal(cmd, builder)
93+ if err != nil {
94+ return err
95+ }
96+
97+ if err := applyUpdateFlags(cmd, builder, area); err != nil {
98+ return err
99+ }
82100 }
83101
84- task, err := ui.Spin("Updating task…", func() (*lunatask.Task, error) {
102+ updatedTask, err := ui.Spin("Updating task…", func() (*lunatask.Task, error) {
85103 return builder.Update(cmd.Context())
86104 })
87105 if err != nil {
88106 return err
89107 }
90108
91- fmt.Fprintln(cmd.OutOrStdout(), ui.Success.Render("Updated task: "+task.ID))
109+ fmt.Fprintln(cmd.OutOrStdout(), ui.Success.Render("Updated task: "+updatedTask.ID))
92110
93111 return nil
94112 }
Back to top