lune
created pr with
124.1
changed status to
closed
Closing as superceded by 126
cmds
checkout latest patchset:
ssh pr.pico.sh print 124 | git am -3checkout any patchset in a patch request:
ssh pr.pico.sh print 124.[rev] | git am -3add changes to patch request:
git format-patch main --stdout | ssh pr.pico.sh pr add 124set PR to open (enables RSS notifications):
ssh pr.pico.sh pr open 124set PR to draft (stops RSS notifications):
ssh pr.pico.sh pr draft 124
Patchset
124.1
listing real name of tasks
juan
construction of db for management of decrypted names of tasks
2026-04-21T03:21:16Zjuan
fix UTF8 chracteres
2026-04-21T05:43:09Zjuan
filter by status and coloring types of status
2026-04-21T21:13:24Zjuan
update help
2026-04-21T21:18:53Zjuan
list areas names
2026-04-21T21:21:36Zjuan
adjust table tasks to truncate name and list area
2026-04-21T21:44:53Zjuan
partial implementation of listing tasks by areas
2026-04-21T21:56:40Zjuan
final implementation of listing tasks by areas with UTF-8 chracteres
2026-04-21T22:05:20Zjuan
sort on task list to show first do now
2026-04-21T22:10:20Zjuan
update with 8 char of id and db.go
2026-04-21T22:33:29Zjuan
partial implementation of TUI menu on task update
2026-04-21T23:27:54Zjuan
task name correcion on TUI menu of Update task
2026-04-21T23:35:35Zjuan
TUI menu for update task with others flags
2026-04-21T23:38:19Zjuan
helper for TUI update task
2026-04-21T23:43:02Zjuan
search by first 8 char of note id for editing it
2026-04-21T23:49:56Zjuan
→ partial implementation on note TUI menu for update
2026-04-22T00:00:17Zjuan
TUI menu notebook just with tags
2026-04-22T00:05:46Zjuan
Note update now let you insert only the first 8 char of notebook id in update
2026-04-22T00:20:55Zjuan
implementation of (lune note notebook-list) for listing all notebooks and its ID
2026-04-22T00:25:53Zjuan
partial implementation of lune note show-content ID
2026-04-22T01:10:51Zjuan
convert \n in new line and \ in space for lune note show-content ID
2026-04-22T02:01:11Zjuan
2026-04-22T02:18:42Z
partial implementation on note TUI menu for update
juan
2026-04-22T00:05:46ZSemantic diff summary
1 added,
2 modified,
0 signature changed,
0 removed
across 2 analyzed files
+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
#
| ... | ... | @@ -53,32 +54,46 @@ func runUpdate(cmd *cobra.Command, args []string) error { | |
| 53 | 54 | return err | |
| 54 | 55 | } | |
| 55 | 56 | ||
| 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 { | |
| 63 | 59 | return err | |
| 64 | 60 | } | |
| 65 | 61 | ||
| 66 | - | if err := applyUpdateContent(cmd, builder); err != nil { | |
| 67 | - | return err | |
| 68 | - | } | |
| 62 | + | builder := apiClient.NewNoteUpdate(id) | |
| 69 | 63 | ||
| 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 | + | }) | |
| 73 | 69 | ||
| 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) { | |
| 75 | 90 | return builder.Update(cmd.Context()) | |
| 76 | 91 | }) | |
| 77 | 92 | if err != nil { | |
| 78 | 93 | return err | |
| 79 | 94 | } | |
| 80 | 95 | ||
| 81 | - | fmt.Fprintln(cmd.OutOrStdout(), ui.Success.Render("Updated note: "+note.ID)) | |
| 96 | + | fmt.Fprintln(cmd.OutOrStdout(), ui.Success.Render("Updated note: "+updatedNote.ID)) | |
| 82 | 97 | ||
| 83 | 98 | return nil | |
| 84 | 99 | } |