From 1ed4f690653b9fdbfc6aa1efeabfe860e029fa51 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Thu, 22 Jan 2026 09:09:45 -0800 Subject: [PATCH] bin/pick: When the main widget is replaced, trigger a redraw The docs clearly say this, and though it used to just work that seems to have been a coincidence rather than being correct. CC: mesa-stable Part-of: (cherry picked from commit 0380c1228eb5f8c3ad0942b87d5a450fa15e10a0) --- .pick_status.json | 2 +- bin/pick/ui.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index 9b4fd0951c5..3ac571c7fe1 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -3524,7 +3524,7 @@ "description": "bin/pick: When the main widget is replaced, trigger a redraw", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/bin/pick/ui.py b/bin/pick/ui.py index e666e829624..7af0a461a14 100644 --- a/bin/pick/ui.py +++ b/bin/pick/ui.py @@ -224,6 +224,7 @@ class UI: if commit.nominated and commit.resolution is core.Resolution.UNRESOLVED: b = urwid.AttrMap(CommitWidget(self, commit), None, focus_map='reversed') self.commit_list.append(b) + self.mainloop.draw_screen() self.save() async def feedback(self, text: str) -> None: @@ -236,6 +237,7 @@ class UI: if c.base_widget is commit: del self.commit_list[i] break + self.mainloop.draw_screen() def save(self): core.save(itertools.chain(self.new_commits, self.previous_commits)) @@ -246,6 +248,7 @@ class UI: def reset_cb(_) -> None: self.mainloop.widget = o + self.mainloop.draw_screen() async def apply_cb(edit: urwid.Edit) -> None: text: str = edit.get_edit_text() @@ -263,6 +266,7 @@ class UI: raise RuntimeError(f"Couldn't find {sha}") await commit.apply(self) + self.mainloop.draw_screen() q = urwid.Edit("Commit sha\n") ok_btn = urwid.Button('Ok') @@ -279,12 +283,14 @@ class UI: self.mainloop.widget = urwid.Overlay( urwid.Filler(box), o, 'center', ('relative', 50), 'middle', ('relative', 50) ) + self.mainloop.draw_screen() def chp_failed(self, commit: 'CommitWidget', err: str) -> None: o = self.mainloop.widget def reset_cb(_) -> None: self.mainloop.widget = o + self.mainloop.draw_screen() t = urwid.Text(textwrap.dedent(f""" Failed to apply {commit.commit.sha} {commit.commit.description} with the following error: @@ -313,3 +319,4 @@ class UI: self.mainloop.widget = urwid.Overlay( urwid.Filler(box), o, 'center', ('relative', 50), 'middle', ('relative', 50) ) + self.mainloop.draw_screen()