From 22306bd949cdaeee8b96d4682e38dcd664bb52d2 Mon Sep 17 00:00:00 2001 From: Amolith Date: Sat, 18 Oct 2025 12:14:24 -0600 Subject: [PATCH] feat(web/bugs): show previous title in changes Title change events now display both the old title (strikethrough) and new title (underline) using semantic HTML tags ( and ), providing better context for how bug titles have evolved over time. Implements: bug-ef59d5b Co-authored-by: Crush --- pkg/web/templates/bug.html | 2 +- pkg/web/webui_bugs.go | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/pkg/web/templates/bug.html b/pkg/web/templates/bug.html index 5a015d3e989d87d5bacda4051bdc29c2b7061e31..749ce77ec7994f184cf600dd15600cb69a19a9ad 100644 --- a/pkg/web/templates/bug.html +++ b/pkg/web/templates/bug.html @@ -58,7 +58,7 @@ {{else if eq .Type "title"}}
-

{{if .AuthorAvatar}}{{end}}{{.Author}} changed the title to {{.Title}}

+

{{if .AuthorAvatar}}{{end}}{{.Author}} changed the title from {{.PreviousTitle}} to {{.Title}}

{{else if eq .Type "status"}} diff --git a/pkg/web/webui_bugs.go b/pkg/web/webui_bugs.go index 1a9554cbf0b76bf413fd3c0fd23ee2d52e338176..58d8d68b8437c51d4ca3619bb79647e013560644 100644 --- a/pkg/web/webui_bugs.go +++ b/pkg/web/webui_bugs.go @@ -68,6 +68,7 @@ type TimelineItem struct { Message template.HTML Title string + PreviousTitle string Status string AddedLabels []Label RemovedLabels []Label @@ -237,12 +238,13 @@ func buildTimelineItems(snap *bug.Snapshot) []TimelineItem { case *bug.SetTitleTimelineItem: items = append(items, TimelineItem{ - Type: "title", - ID: op.CombinedId().String(), - Author: op.Author.DisplayName(), - AuthorAvatar: op.Author.AvatarUrl(), - Timestamp: op.UnixTime.Time(), - Title: op.Title, + Type: "title", + ID: op.CombinedId().String(), + Author: op.Author.DisplayName(), + AuthorAvatar: op.Author.AvatarUrl(), + Timestamp: op.UnixTime.Time(), + Title: op.Title, + PreviousTitle: op.Was, }) case *bug.SetStatusTimelineItem: