Redraw the status bar when a line arrives in another window (closes #232)
check / check (push) Canceled after 0s
check / check (push) Canceled after 0s
A line that arrives in a window that is not shown is counted as unread, but refreshStatusBar did nothing, so the window joined the status bar's unread list only at the next SetStatus. UI now keeps the nick, target and connection state last passed to SetStatus, and refreshStatusBar redraws the status bar with them. Model: opus-5-5
This commit was merged in pull request #243.
This commit is contained in:
@@ -752,6 +752,31 @@ func TestStatusBar(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// TestUnreadLine checks that a line added to a window that is not
|
||||
// shown puts that window in the status bar's unread list at once,
|
||||
// and that the status bar keeps the nick, target and connection
|
||||
// state last set.
|
||||
func TestUnreadLine(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
ui := NewUI()
|
||||
runUI(t, ui)
|
||||
|
||||
// Window 1, the one shown, is the channel's. The line goes to
|
||||
// window 2 after SetStatus, so only AddLine can show it in the
|
||||
// status bar.
|
||||
ui.SwitchToBuffer(testChannel)
|
||||
ui.SetStatus(testNick, testChannel, "connected")
|
||||
ui.AddLine(testOtherNick, testText)
|
||||
|
||||
const want = " [connected] erin [1:#chan] #chan [Act: 2:bob(1)]"
|
||||
|
||||
got := statusBarText(ui)
|
||||
if got != want {
|
||||
t.Fatalf("status bar is %q, want %q", got, want)
|
||||
}
|
||||
}
|
||||
|
||||
// TestOwnEventFromOtherClient checks that a message, notice,
|
||||
// join or part that the user's session makes from another
|
||||
// client shows as one line in the buffer it belongs to.
|
||||
|
||||
Reference in New Issue
Block a user