detached eaf57dd

fix(web): notify merge request views when issue states change

commit
eaf57dd7e0f4cbf90697cb5ee43f74d48d852c35
author
brice · · 2026-10-22 18:36 UTC
committer
brice · · 2026-10-22 18:41 UTC
parent
7474f50
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
2 files · +23 -0
M internal/adapters/web/fragments.go +9 -0
@@ -242,10 +242,19 @@ func (l *liveStream) repoPage(ctx context.Context, we ports.WatchEvent) ([]fragm
242242 case domain.IssueOpened:
243243 return l.issueNotice(ctx, ev.Issue.Number, "an issue was opened — reload")
244244 case domain.IssueResolved:
245+ if l.view == "mr" {
246+ return l.notice(ctx, "issues changed — reload", mrBase(l.repo)+"/"+l.n)
247+ }
245248 return l.issueNotice(ctx, ev.Issue.Number, "this issue was resolved — reload")
246249 case domain.IssueClosed:
250+ if l.view == "mr" {
251+ return l.notice(ctx, "issues changed — reload", mrBase(l.repo)+"/"+l.n)
252+ }
247253 return l.issueNotice(ctx, ev.Issue.Number, "this issue was closed — reload")
248254 case domain.IssueReopened:
255+ if l.view == "mr" {
256+ return l.notice(ctx, "issues changed — reload", mrBase(l.repo)+"/"+l.n)
257+ }
249258 return l.issueNotice(ctx, ev.Issue.Number, "this issue was reopened — reload")
250259 case domain.IssueCommented:
251260 return l.issueNotice(ctx, ev.Number, "a comment was added — reload")
@@ -242,10 +242,19 @@ func (l *liveStream) repoPage(ctx context.Context, we ports.WatchEvent) ([]fragm
242 case domain.IssueOpened:242 case domain.IssueOpened:
243 return l.issueNotice(ctx, ev.Issue.Number, "an issue was opened — reload")243 return l.issueNotice(ctx, ev.Issue.Number, "an issue was opened — reload")
244 case domain.IssueResolved:244 case domain.IssueResolved:
245+ if l.view == "mr" {
246+ return l.notice(ctx, "issues changed — reload", mrBase(l.repo)+"/"+l.n)
247+ }
245 return l.issueNotice(ctx, ev.Issue.Number, "this issue was resolved — reload")248 return l.issueNotice(ctx, ev.Issue.Number, "this issue was resolved — reload")
246 case domain.IssueClosed:249 case domain.IssueClosed:
250+ if l.view == "mr" {
251+ return l.notice(ctx, "issues changed — reload", mrBase(l.repo)+"/"+l.n)
252+ }
247 return l.issueNotice(ctx, ev.Issue.Number, "this issue was closed — reload")253 return l.issueNotice(ctx, ev.Issue.Number, "this issue was closed — reload")
248 case domain.IssueReopened:254 case domain.IssueReopened:
255+ if l.view == "mr" {
256+ return l.notice(ctx, "issues changed — reload", mrBase(l.repo)+"/"+l.n)
257+ }
249 return l.issueNotice(ctx, ev.Issue.Number, "this issue was reopened — reload")258 return l.issueNotice(ctx, ev.Issue.Number, "this issue was reopened — reload")
250 case domain.IssueCommented:259 case domain.IssueCommented:
251 return l.issueNotice(ctx, ev.Number, "a comment was added — reload")260 return l.issueNotice(ctx, ev.Number, "a comment was added — reload")
M internal/adapters/web/fragments_test.go +14 -0
@@ -119,3 +119,17 @@ func TestReleaseLiveUpdates(t *testing.T) {
119119 }
120120 }
121121 }
122+
123+func TestIssueTransitionsRefreshMRRail(t *testing.T) {
124+ for _, ev := range []domain.Event{domain.IssueClosed{}, domain.IssueReopened{}, domain.IssueResolved{}} {
125+ t.Run(ev.EventKind(), func(t *testing.T) {
126+ l := liveStream{repo: "demo", view: "mr", n: "7"}
127+ fs, err := l.repoPage(t.Context(), ports.WatchEvent{Event: ev})
128+ require.NoError(t, err)
129+ require.Len(t, fs, 1)
130+ assert.Equal(t, "mr-notice", fs[0].event)
131+ assert.Contains(t, fs[0].html, "issues changed — reload")
132+ assert.Contains(t, fs[0].html, `/demo/merge-requests/7`)
133+ })
134+ }
135+}
@@ -119,3 +119,17 @@ func TestReleaseLiveUpdates(t *testing.T) {
119 }119 }
120 }120 }
121 }121 }
122+
123+func TestIssueTransitionsRefreshMRRail(t *testing.T) {
124+ for _, ev := range []domain.Event{domain.IssueClosed{}, domain.IssueReopened{}, domain.IssueResolved{}} {
125+ t.Run(ev.EventKind(), func(t *testing.T) {
126+ l := liveStream{repo: "demo", view: "mr", n: "7"}
127+ fs, err := l.repoPage(t.Context(), ports.WatchEvent{Event: ev})
128+ require.NoError(t, err)
129+ require.Len(t, fs, 1)
130+ assert.Equal(t, "mr-notice", fs[0].event)
131+ assert.Contains(t, fs[0].html, "issues changed — reload")
132+ assert.Contains(t, fs[0].html, `/demo/merge-requests/7`)
133+ })
134+ }
135+}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 3

Tags 45

↑↓ moveenter openesc close