Link the flash message's note title to its series
Assisted-by: Claude Opus 4.7 (1M context) via Claude Code
change vnvtxwvuxrwznkpxsqrokvmumpwmqlpn
commit 1e777851ae1ec0c3c551ea76d9a92d8ad034d942
author Alpha Chen <alpha@kejadlen.dev>
date
parent lzkqlmwn
diff --git a/lib/ketchup/views/layout.rb b/lib/ketchup/views/layout.rb
index 8b0940a..8d9e785 100644
--- a/lib/ketchup/views/layout.rb
+++ b/lib/ketchup/views/layout.rb
@@ -70,10 +70,23 @@ module Ketchup
 
       def render_flash
         undo_path = @flash["undo_path"]
+        title = @flash["title"]
+        path = @flash["path"]
 
         div(class: "flash-bar", data: { undo_path: undo_path }.compact) do
           button(class: "flash-undo-btn", hidden: !undo_path) { "Undo" }
-          span(class: "flash-message") { @flash["message"] }
+          span(class: "flash-message") do
+            plain @flash["message"]
+            if title
+              plain " \u201c"
+              if path
+                a(href: path, class: "flash-link") { title }
+              else
+                plain title
+              end
+              plain "\u201d"
+            end
+          end
           button(class: "flash-close-btn", **{ "aria-label": "Dismiss" }) { "\u00d7" }
           script { raw safe(flash_script) }
         end
diff --git a/lib/ketchup/web.rb b/lib/ketchup/web.rb
index 95236c8..1a94e4d 100644
--- a/lib/ketchup/web.rb
+++ b/lib/ketchup/web.rb
@@ -105,7 +105,12 @@ module Ketchup
 
               note_title = @series.note.lines.first&.strip || @series.note
               archive_path = "/series/#{series_id}/archive"
-              session["flash"] = { "message" => "Archived \u201c#{note_title}\u201d", "undo_path" => archive_path }
+              session["flash"] = {
+                "message" => "Archived",
+                "title" => note_title,
+                "path" => "/series/#{series_id}",
+                "undo_path" => archive_path
+              }
               r.redirect "/"
             end
 
@@ -163,7 +168,12 @@ module Ketchup
 
                 note_title = @series.note.lines.first&.strip || @series.note
                 complete_path = "/series/#{series_id}/tasks/#{@task.id}/complete"
-                session["flash"] = { "message" => "Completed \u201c#{note_title}\u201d", "undo_path" => complete_path }
+                session["flash"] = {
+                  "message" => "Completed",
+                  "title" => note_title,
+                  "path" => "/series/#{series_id}",
+                  "undo_path" => complete_path
+                }
 
                 return_to = r.params["return_to"]
                 if return_to && return_to.start_with?("/")