From: Christian Heller Date: Tue, 21 Oct 2025 13:03:15 +0000 (+0200) Subject: Update status line on any logs, not just those of other windows. X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/static/%7B%7Bdb.prefix%7D%7D/%7B%7Btodo.comment%7D%7D?a=commitdiff_plain;h=HEAD;p=ircplom Update status line on any logs, not just those of other windows. --- diff --git a/src/ircplom/tui_base.py b/src/ircplom/tui_base.py index a936e87..27eea95 100644 --- a/src/ircplom/tui_base.py +++ b/src/ircplom/tui_base.py @@ -579,8 +579,7 @@ class BaseTui(QueueMixin): affected_win_indices += [win.idx] win.ensure_date(today) win.log(msg) - if win != self.window: - self._status_line.taint() + self._status_line.taint() return tuple(affected_win_indices), msg def _new_window(self, win_class=Window, **kwargs) -> Window: diff --git a/src/tests/tui_draw.test b/src/tests/tui_draw.test index bbec77d..2eba2f7 100644 --- a/src/tests/tui_draw.test +++ b/src/tests/tui_draw.test @@ -19,13 +19,13 @@ repeat lines-empty-4 +12 | lines-empty-16-out repeat lines-empty-4 +16 repeat lines-empty-2 +20 -| status-prompt-empty-in +| status-[0]-prompt-empty-in line 22 on_black,bright_white :start)=====================================================================([0]§§ | prompt-empty-in line 23 on_black,bright_white > § §§ line 23 on_black,bright_white,reverse §§ § | prompt-empty-out -| status-prompt-empty-out +| status-[0]-prompt-empty-out | empty-init-out # nothing happening on empty command input @@ -52,7 +52,7 @@ line 20 on_black,bright_white 20§§-§§-§§ §§ line 21 on_black,bright_red,bold #!. §§:§§:§§ invalid prompt command: not prefixed by / §§ | history-lines-0:1:2-out | history-lines-0:0:2-out -repeat status-prompt-empty +repeat status-[0]-prompt-empty | with-only-2-lines-history-out # check scrolling on history merely 2 lines long won't do anything either @@ -72,7 +72,7 @@ repeat history-lines-0:0:2 +19 | history-lines-0:2:3-in line 21 on_black,bright_red,bold #!. §§:§§:§§ invalid prompt command: /foo unknown §§ | history-lines-0:2:3-out -repeat status-prompt-empty +repeat status-[0]-prompt-empty | before-first-scroll-out # check scrolling up does something on history 3 lines long @@ -83,7 +83,7 @@ repeat lines-empty-4 +16 repeat history-lines-0:0:1 +20 | topmost-scroll-out line 21 on_black,bright_white,reverse vvv [2] vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv§§ -repeat status-prompt-empty +repeat status-[0]-prompt-empty # check scrolling down on 3-lines history > /window.history.scroll down @@ -103,7 +103,7 @@ repeat before-first-scroll > /window.history.scroll up repeat topmost-scroll +0 line 21 on_black,bright_white,reverse vvv [2] vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv§§ -repeat status-prompt-empty +repeat status-[0]-prompt-empty > /help log 0 #.. commands available in this window: log 0 #.. /connect HOST_PORT [NICKNAME_PW] [REALNAME_USERNAME] @@ -120,7 +120,10 @@ log 0 #.. /window.prompt.scroll DIRECTION | before-scrolldown-not-to-bottom-in repeat topmost-scroll line 21 on_black,bright_white,reverse vvv [14] vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv§§ -repeat status-prompt-empty +| status-[0:12]-prompt-in +line 22 on_black,bright_white :start)================================================================([(0:12)]§§ +repeat prompt-empty +| status-[0:12]-prompt-out | before-scrolldown-not-to-bottom-out # check scroll-down on newer history longer than half a screen width does not fully land at bottom @@ -156,7 +159,7 @@ line 20 on_black,bright_cyan #.. §§:§§:§§ /window.paste | history-lines-0:10:12-out | history-lines-0:8:12-out line 21 on_black,bright_white,reverse vvv [3] vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv§§ -repeat status-prompt-empty +repeat status-[0:12]-prompt | after-scrolldown-not-to-bottom-out # check previous scroll-down not hitting bottom be fully reversible @@ -179,7 +182,7 @@ line 20 on_black,bright_cyan #.. §§:§§:§§ /window.prompt.move_cursor DIR | history-lines-0:14:15-in line 21 on_black,bright_cyan #.. §§:§§:§§ /window.prompt.scroll DIRECTION§§ | history-lines-0:14:15-out -repeat status-prompt-empty +repeat status-[0:12]-prompt > /0 log 0 #!. invalid prompt command: /0 unknown > /1 @@ -223,7 +226,7 @@ line 20 on_black,bright_red,bold #!. §§:§§:§§ invalid prompt command: /6 u | history-lines-0:22:23-in line 21 on_black,bright_red,bold #!. §§:§§:§§ invalid prompt command: /7 unknown§§ | history-lines-0:22:23-out -repeat status-prompt-empty +repeat status-[0]-prompt-empty | at-bottom-before-wrapped-out # check scroll-down even with long history does nothing @@ -237,7 +240,7 @@ repeat lines-empty-1 +8 repeat history-lines-0:0:8 +9 repeat history-lines-0:8:12 +17 line 21 on_black,bright_white,reverse vvv [11] vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv§§ -repeat status-prompt-empty +repeat status-[0]-prompt-empty > /window.history.scroll down repeat at-bottom-before-wrapped @@ -259,7 +262,7 @@ line 19 on_black,bright_red,bold #!. §§:§§:§§ invalid prompt command: /foo line 20 on_black,bright_red,bold #!. §§:§§:§§ invalid prompt command: /foo_0123456789_0123456789_012345678§§ line 21 on_black,bright_red,bold unknown§§ | history-lines-0:24:26-out -repeat status-prompt-empty +repeat status-[0]-prompt-empty | at-bottom-after-wrapped-out # check scroll-up over wrapped moves up less history lines than screen lines @@ -273,7 +276,7 @@ repeat history-lines-0:12:14 +18 repeat history-lines-0:14:15 +20 | scrollup-after-wrapped-out line 21 on_black,bright_white,reverse vvv [10] vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv§§ -repeat status-prompt-empty +repeat status-[0]-prompt-empty # check scroll-down fully reversible even if over wrapped > /window.history.scroll down @@ -281,14 +284,17 @@ repeat at-bottom-after-wrapped > /window.history.scroll up repeat scrollup-after-wrapped line 21 on_black,bright_white,reverse vvv [10] vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv§§ -repeat status-prompt-empty +repeat status-[0]-prompt-empty # check wrapped input only increases below-scroll count by one > /bar_0123456789_0123456789_012345678 log 0 #!. invalid prompt command: /bar_0123456789_0123456789_012345678 unknown repeat scrollup-after-wrapped line 21 on_black,bright_white,reverse vvv [11] vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv§§ -repeat status-prompt-empty +| status-[0:1]-prompt-in +line 22 on_black,bright_white :start)=================================================================([(0:1)]§§ +repeat prompt-empty +| status-[0:1]-prompt-out # check scroll-down over wrapped will snap down to bottom of wrapped > /window.history.scroll down @@ -303,24 +309,24 @@ repeat history-lines-0:23:24 +18 | history-lines-0:16:24-out repeat history-lines-0:24:26 +19 line 21 on_black,bright_white,reverse vvv [1] vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv§§ -repeat status-prompt-empty +repeat status-[0:1]-prompt # # check scrolls-up over longer history until top > /window.history.scroll up repeat scrollup-after-wrapped line 21 on_black,bright_white,reverse vvv [11] vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv§§ -repeat status-prompt-empty +repeat status-[0:1]-prompt > /window.history.scroll up repeat lines-empty-16 +0 repeat lines-empty-1 +16 repeat history-lines-0:0:2 +17 repeat history-lines-0:2:4 +19 line 21 on_black,bright_white,reverse vvv [22] vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv§§ -repeat status-prompt-empty +repeat status-[0:1]-prompt > /window.history.scroll up repeat topmost-scroll line 21 on_black,bright_white,reverse vvv [25] vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv§§ -repeat status-prompt-empty +repeat status-[0:1]-prompt # check that triggering creation of new window with new lines adds it to status, with unread-lines count > /connect foo.bar.baz foo bar:baz @@ -405,11 +411,10 @@ repeat prompt-empty > /window 0 repeat topmost-scroll line 21 on_black,bright_white,reverse vvv [25] vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv§§ -repeat status-prompt-after-first-return -| status-prompt-after-first-return-in +| status-[0:1]-1-prompt-in line 22 on_black,bright_white :start)===============================================================([(0:1)] 1§§ repeat prompt-empty -| status-prompt-after-first-return-out +| status-[0:1]-1-prompt-out # check that on full scroll-down, we now have a bookmark above the newest lines not previously scrolled into > /window.history.scroll down @@ -418,7 +423,7 @@ repeat lines-empty-1 +8 repeat history-lines-0:0:8 +9 repeat history-lines-0:8:12 +17 line 21 on_black,bright_white,reverse vvv [14] vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv§§ -repeat status-prompt-after-first-return +repeat status-[0:1]-1-prompt > /window.history.scroll down | before-first-sight-of-bookmark-in repeat history-lines-0:2:4 +0 @@ -428,7 +433,7 @@ repeat history-lines-0:16:20 +14 repeat history-lines-0:20:22 +18 repeat history-lines-0:22:23 +20 line 21 on_black,bright_white,reverse vvv [3] vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv§§ -repeat status-prompt-after-first-return +repeat status-[0:1]-1-prompt | before-first-sight-of-bookmark-out > /window.history.scroll down | first-sight-of-bookmark-in @@ -443,7 +448,7 @@ line 19 on_black,bright_white -------------------------------------------------- line 20 on_black,bright_red,bold #!. §§:§§:§§ invalid prompt command: /bar_0123456789_0123456789_012345678§§ line 21 on_black,bright_red,bold unknown§§ | history-lines-0:26:28-out -repeat status-prompt-after-first-return +repeat status-[0:1]-1-prompt | first-sight-of-bookmark-out # check that scrolling non-bottom bookmark out of sight, then scrolling it back into view again does not by itself move its position in the log history @@ -454,7 +459,7 @@ repeat history-lines-0:0:8 +3 repeat history-lines-0:8:16 +11 repeat history-lines-0:16:18 +19 line 21 on_black,bright_white,reverse vvv [8] vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv§§ -repeat status-prompt-after-first-return +repeat status-[0:1]-1-prompt > /window.history.scroll down repeat first-sight-of-bookmark @@ -465,10 +470,10 @@ repeat history-lines-1:0:16 +2 repeat history-lines-1:16:18 +18 repeat history-lines-1:18:19 +20 repeat bookmark +21 -| status-prompt-both-empty-in +| status-0-[1]-prompt-in line 22 on_black,bright_white foo.bar.baz:debug)========================================================(0 [1]§§ repeat prompt-empty -| status-prompt-both-empty-out +| status-0-[1]-prompt-out # check second switch-back places bookmark at bottom there too, since the newest lines previously succeeding it have now been read by us > /window 0 @@ -480,8 +485,10 @@ repeat history-lines-0:24:26 +17 repeat history-lines-0:26:28 +19 | history-lines-0:24:28-out repeat bookmark +21 +| status-[0]-1-prompt-in line 22 on_black,bright_white :start)===================================================================([0] 1§§ repeat prompt-empty +| status-[0]-1-prompt-out # check new lines push bookmark up > /list @@ -502,8 +509,7 @@ line 20 on_black,bright_cyan #.. §§:§§:§§ 0) :start§§ line 21 on_black,bright_cyan #.. §§:§§:§§ 1) foo.bar.baz:debug§§ | history-lines-0:30:31-out | before-first-server-responses-out -line 22 on_black,bright_white :start)===================================================================([0] 1§§ -repeat prompt-empty +repeat status-[0]-1-prompt # check new lines growing in other window, one of which long enough to wrap, to be re-start count in status (with wrapped only as single) loggedservermsg 0 1 <.. PING :? @@ -533,7 +539,7 @@ line 20 on_black,bright_green >.. §§:§§:§§ PONG :123456789 123456789 12345 | history-lines-1:24:25-in line 21 on_black,bright_green 123456789 123456789§§ | history-lines-1:24:25-out -repeat status-prompt-both-empty +repeat status-0-[1]-prompt # check that growth below scroll does not by itself re-position bookmark in history > /window.history.scroll up @@ -548,7 +554,10 @@ repeat history-lines-1:12:14 +18 repeat history-lines-1:14:15 +20 | early-win1-upscroll-out line 21 on_black,bright_white,reverse vvv [10] vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv§§ -repeat status-prompt-both-empty +| status-0-[1:2]-prompt-in +line 22 on_black,bright_white foo.bar.baz:debug)====================================================(0 [(1:2)]§§ +repeat prompt-empty +| status-0-[1:2]-prompt-out > /window.history.scroll down repeat history-lines-1:5:6 +0 repeat history-lines-1:6:8 +1 @@ -560,7 +569,7 @@ repeat history-lines-1:19:20 +15 repeat history-lines-1:20:24 +16 repeat history-lines-1:24:25 +20 line 21 on_black,bright_white,reverse vvv [2] vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv§§ -repeat status-prompt-both-empty +repeat status-0-[1:2]-prompt # check that with new lines left unread, switch away and back into window moves bookmark below newest read line, counts unread lines in status > /window 0 @@ -590,8 +599,7 @@ repeat history-lines-1:24:25 +19 repeat bookmark +20 | keep-bookmark-on-outside-growth-test-out line 21 on_black,bright_white,reverse vvv [2] vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv§§ -line 22 on_black,bright_white foo.bar.baz:debug)====================================================(0 [(1:2)]§§ -repeat prompt-empty +repeat status-0-[1:2]-prompt # check that growing lines below scroll in other preserves non-bottom bookmark (left in sight on previous window leave) > /window 0 @@ -603,16 +611,16 @@ repeat prompt-empty > /window 1 repeat keep-bookmark-on-outside-growth-test line 21 on_black,bright_white,reverse vvv [4] vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv§§ -| status-prompt-on-win1-4-unread-in +| status-0-[1:4]-prompt-in line 22 on_black,bright_white foo.bar.baz:debug)====================================================(0 [(1:4)]§§ repeat prompt-empty -| status-prompt-on-win1-4-unread-out +| status-0-[1:4]-prompt-out # check same applies when leaving affected window with bookmark out-of-sight > /window.history.scroll up repeat early-win1-upscroll line 21 on_black,bright_white,reverse vvv [12] vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv§§ -repeat status-prompt-on-win1-4-unread +repeat status-0-[1:4]-prompt > /window 0 loggedservermsg 0 1 <.. PING :baz log 1 >.. PONG :baz @@ -622,8 +630,10 @@ repeat prompt-empty > /window 1 repeat early-win1-upscroll line 21 on_black,bright_white,reverse vvv [14] vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv§§ +| status-0-[1:6]-prompt-in line 22 on_black,bright_white foo.bar.baz:debug)====================================================(0 [(1:6)]§§ repeat prompt-empty +| status-0-[1:6]-prompt-out > /window.history.scroll down repeat history-lines-1:5:6 +0 repeat history-lines-1:6:8 +1 @@ -632,8 +642,7 @@ repeat history-lines-1:16:24 +11 repeat history-lines-1:24:25 +19 repeat bookmark +20 line 21 on_black,bright_white,reverse vvv [6] vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv§§ -line 22 on_black,bright_white foo.bar.baz:debug)====================================================(0 [(1:6)]§§ -repeat prompt-empty +repeat status-0-[1:6]-prompt > /window.history.scroll down repeat history-lines-1:10:12 +0 repeat history-lines-1:12:16 +2 @@ -646,8 +655,7 @@ line 18 on_black,bright_white <.. §§:§§:§§ PING :bar line 19 on_black,bright_green >.. §§:§§:§§ PONG :bar line 20 on_black,bright_white <.. §§:§§:§§ PING :baz line 21 on_black,bright_green >.. §§:§§:§§ PONG :baz -line 22 on_black,bright_white foo.bar.baz:debug)====================================================(0 [(1:6)]§§ -repeat prompt-empty +repeat status-0-[1:6]-prompt > /quit log 0 <..