dmitri.shuralyov.com/app/changes/...

component: display RenamedEvent.From with a line-through effect

Apply this change to make the change rename event easier to read.

Follows https://github.com/shurcooL/issuesapp/commit/a359f164dfa502a21cdc4cc3582a5b4221308d2a.
dmitshur committed 4 years ago commit f002181790ca201638a23665caeab1eebb015aaf
Collapse all
component/component.go
@@ -118,11 +118,17 @@ func (e Event) text() []*html.Node {
		}
		return ns
	case change.ReopenedEvent:
		return []*html.Node{htmlg.Text("reopened this")}
	case change.RenamedEvent:
		return []*html.Node{htmlg.Text("changed the title from "), htmlg.Strong(p.From), htmlg.Text(" to "), htmlg.Strong(p.To)}
		from := &html.Node{
			Type: html.ElementNode, Data: atom.Del.String(),
			Attr:       []html.Attribute{{Key: atom.Style.String(), Val: "font-weight: bold;"}},
			FirstChild: htmlg.Text(p.From),
		}
		to := htmlg.Strong(p.To)
		return []*html.Node{htmlg.Text("changed the title "), from, htmlg.Text(" "), to}
	case change.LabeledEvent:
		var ns []*html.Node
		ns = append(ns, htmlg.Text("added the "))
		ns = append(ns, issuescomponent.Label{Label: p.Label}.Render()...)
		ns = append(ns, htmlg.Text(" label"))