diff --git a/pkg/web/assets/js/issue-list-dblclick.js b/pkg/web/assets/js/issue-list-dblclick.js new file mode 100644 index 0000000..e4b4a1c --- /dev/null +++ b/pkg/web/assets/js/issue-list-dblclick.js @@ -0,0 +1,19 @@ +/** + * Open edit-issue modal when double-clicking a row in the issue list (list view). + * Uses event delegation and preventDefault so double-click doesn't select text. + */ +(function () { + document.addEventListener("dblclick", function (e) { + var row = e.target.closest("tr[data-issue-id]"); + if (!row) return; + e.preventDefault(); + var id = row.getAttribute("data-issue-id"); + if (!id) return; + if (typeof htmx !== "undefined") { + htmx.ajax("GET", "/issues/" + id + "/edit", { + target: "#modal-container", + swap: "innerHTML", + }); + } + }); +})(); diff --git a/pkg/web/routes/dashboard.templ b/pkg/web/routes/dashboard.templ index fc09df2..4ad5c02 100644 --- a/pkg/web/routes/dashboard.templ +++ b/pkg/web/routes/dashboard.templ @@ -135,20 +135,13 @@ templ DashboardIssueRows(issues []*models.Issue, selectedID string) { }} - { issue.ID } { issue.Title } diff --git a/pkg/web/routes/dashboard_templ.go b/pkg/web/routes/dashboard_templ.go index 269ddca..7676a46 100644 --- a/pkg/web/routes/dashboard_templ.go +++ b/pkg/web/routes/dashboard_templ.go @@ -278,12 +278,12 @@ func DashboardIssueRows(issues []*models.Issue, selectedID string) templ.Compone if selectedID == issue.ID { active = "bg-primary/10" } - var templ_7745c5c3_Var9 = []any{"hover cursor-pointer min-h-full w-full", active} + var templ_7745c5c3_Var9 = []any{"hover cursor-pointer min-h-full w-full select-none", active} templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var9...) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } var templ_7745c5c3_Var14 string - templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(issue.ID) + templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(issue.Title) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/web/routes/dashboard.templ`, Line: 152, Col: 43} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/web/routes/dashboard.templ`, Line: 146, Col: 46} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var15 string - templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(issue.Title) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/web/routes/dashboard.templ`, Line: 153, Col: 46} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -369,7 +356,7 @@ func DashboardIssueRows(issues []*models.Issue, selectedID string) templ.Compone if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -377,7 +364,7 @@ func DashboardIssueRows(issues []*models.Issue, selectedID string) templ.Compone if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -385,7 +372,7 @@ func DashboardIssueRows(issues []*models.Issue, selectedID string) templ.Compone if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/pkg/web/routes/layout.templ b/pkg/web/routes/layout.templ index cf1596a..caa7a8d 100644 --- a/pkg/web/routes/layout.templ +++ b/pkg/web/routes/layout.templ @@ -15,6 +15,7 @@ var baseLayout = components.LayoutProps{ {Src: "/assets/js/htmx.min.js", Defer: true}, {Src: "/assets/js/alpine.min.js", Defer: true}, {Src: "/assets/js/board-drag-drop.js", Defer: true}, + {Src: "/assets/js/issue-list-dblclick.js", Defer: true}, }, }, Routes: []components.NavRoutes{ diff --git a/pkg/web/routes/layout_templ.go b/pkg/web/routes/layout_templ.go index 88f4554..a47058e 100644 --- a/pkg/web/routes/layout_templ.go +++ b/pkg/web/routes/layout_templ.go @@ -23,6 +23,7 @@ var baseLayout = components.LayoutProps{ {Src: "/assets/js/htmx.min.js", Defer: true}, {Src: "/assets/js/alpine.min.js", Defer: true}, {Src: "/assets/js/board-drag-drop.js", Defer: true}, + {Src: "/assets/js/issue-list-dblclick.js", Defer: true}, }, }, Routes: []components.NavRoutes{