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 87b1849

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
+43 -0 cmd/note/interactive.go #
......@@ -0,0 +1,43 @@
1+// SPDX-FileCopyrightText: Amolith <amolith@secluded.site>
2+//
3+// SPDX-License-Identifier: AGPL-3.0-or-later
4+
5+package note
6+
7+import (
8+ "git.secluded.site/go-lunatask"
9+ "git.secluded.site/lune/internal/db"
10+ "github.com/charmbracelet/huh"
11+ "github.com/spf13/cobra"
12+)
13+
14+func runUpdateInteractive(cmd *cobra.Command, note *lunatask.Note, builder *lunatask.NoteUpdateBuilder) error {
15+ name := ""
16+ dbName, _ := db.EnrichTask(note.ID)
17+ if dbName != "" {
18+ name = dbName
19+ }
20+ if name == "" {
21+ name = "Unnamed Note"
22+ }
23+
24+ dateStr := ""
25+ if note.DateOn != nil {
26+ dateStr = note.DateOn.Time.Format("2006-01-02")
27+ }
28+
29+ form := huh.NewForm(
30+ huh.NewGroup(
31+ huh.NewInput().Title("Note Name").Value(&name),
32+ huh.NewInput().Title("Date (YYYY-MM-DD)").Value(&dateStr),
33+ ),
34+ )
35+
36+ if err := form.Run(); err != nil {
37+ return err
38+ }
39+
40+ builder.WithName(name)
41+
42+ return nil
43+}
+30 -15 cmd/note/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 note. Exported for potential use by shortcuts.
......@@ -53,32 +54,46 @@ func runUpdate(cmd *cobra.Command, args []string) error {
5354 return err
5455 }
5556
56- builder := apiClient.NewNoteUpdate(id)
57-
58- if err := applyUpdateName(cmd, builder); err != nil {
59- return err
60- }
61-
62- if err := applyUpdateNotebook(cmd, builder); err != nil {
57+ note, err := apiClient.GetNote(cmd.Context(), id)
58+ if err != nil {
6359 return err
6460 }
6561
66- if err := applyUpdateContent(cmd, builder); err != nil {
67- return err
68- }
62+ builder := apiClient.NewNoteUpdate(id)
6963
70- if err := applyUpdateDate(cmd, builder); err != nil {
71- return err
72- }
64+ // Check if any flag is set
65+ hasFlags := false
66+ cmd.Flags().Visit(func(f *pflag.Flag) {
67+ hasFlags = true
68+ })
7369
74- note, err := ui.Spin("Updating note…", func() (*lunatask.Note, error) {
70+ if !hasFlags {
71+ if err := runUpdateInteractive(cmd, note, builder); err != nil {
72+ return err
73+ }
74+ } else {
75+ if err := applyUpdateName(cmd, builder); err != nil {
76+ return err
77+ }
78+ if err := applyUpdateNotebook(cmd, builder); err != nil {
79+ return err
80+ }
81+ if err := applyUpdateContent(cmd, builder); err != nil {
82+ return err
83+ }
84+ if err := applyUpdateDate(cmd, builder); err != nil {
85+ return err
86+ }
87+ }
88+
89+ updatedNote, err := ui.Spin("Updating note…", func() (*lunatask.Note, error) {
7590 return builder.Update(cmd.Context())
7691 })
7792 if err != nil {
7893 return err
7994 }
8095
81- fmt.Fprintln(cmd.OutOrStdout(), ui.Success.Render("Updated note: "+note.ID))
96+ fmt.Fprintln(cmd.OutOrStdout(), ui.Success.Render("Updated note: "+updatedNote.ID))
8297
8398 return nil
8499 }
Back to top