From: Brian Masney <masneyb@kernel.org>
To: "Kernel.org Tools" <tools@kernel.org>
Cc: Konstantin Ryabitsev <konstantin@linuxfoundation.org>,
Jerome Brunet <jbrunet@baylibre.com>,
Brian Masney <masneyb@kernel.org>
Subject: [PATCH b4 2/4] review-tui: let ApplyStateModal update other patch fields
Date: Wed, 14 Oct 2026 20:03:39 -0400 [thread overview]
Message-ID: <20261014-pw-delegate-v1-2-a393ae92152a@kernel.org> (raw)
In-Reply-To: <20261014-pw-delegate-v1-0-a393ae92152a@kernel.org>
ApplyStateModal is the progress dialog for PATCHing Patchwork patches
one at a time, with Esc to stop and a result that says which patches
were done. The only thing tying it to state changes is the title and
the fields it sends. Move those into _title() and _payload(), so a
subclass can reuse the rest to change a different field, such as the
delegate. There is no change in behavior.
Assisted-by: LLM
Signed-off-by: Brian Masney <masneyb@kernel.org>
---
src/b4/review_tui/_modals.py | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/src/b4/review_tui/_modals.py b/src/b4/review_tui/_modals.py
index d1b878870b92..bcdbba2250cc 100644
--- a/src/b4/review_tui/_modals.py
+++ b/src/b4/review_tui/_modals.py
@@ -2758,6 +2758,9 @@ class ApplyStateModal(ModalScreen[ApplyStateResult]):
Esc stops the run after the request that is in flight. The result
lists the patch ids that were updated, so the caller can tell which
series were finished and which were not.
+
+ Subclasses can change other patch fields by overriding :meth:`_title`
+ and :meth:`_payload`.
"""
BINDINGS = [
@@ -2813,9 +2816,15 @@ class ApplyStateModal(ModalScreen[ApplyStateResult]):
self._error = ''
self._cancelled = False
+ def _title(self) -> str:
+ return f'Setting state to: {self._new_state}'
+
+ def _payload(self) -> Dict[str, Any]:
+ return {'state': self._new_state, 'archived': self._archived}
+
def compose(self) -> ComposeResult:
with Vertical(id='apply-dialog'):
- yield Label(f'Setting state to: {self._new_state}', id='apply-title')
+ yield Label(self._title(), id='apply-title', markup=False)
yield Label(self._series_name, id='apply-series', markup=False)
yield Label(
f'Processing 0/{len(self._patch_ids)} patches...', id='apply-status'
@@ -2858,10 +2867,7 @@ class ApplyStateModal(ModalScreen[ApplyStateResult]):
if self._cancelled or worker_cancelled():
break
patchid_url = '/'.join((patches_url, str(patch_id), ''))
- data = {
- 'state': self._new_state,
- 'archived': self._archived,
- }
+ data = self._payload()
try:
rsp = pses.patch(
patchid_url,
--
2.55.0
next prev parent reply other threads:[~2026-10-15 0:04 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-15 0:03 [PATCH b4 0/4] review-tui: add support for setting the delegate in patchwork Brian Masney
2026-10-15 0:03 ` [PATCH b4 1/4] review-tui: show why a Patchwork update failed Brian Masney
2026-10-15 0:03 ` Brian Masney [this message]
2026-10-15 0:03 ` [PATCH b4 3/4] review: add pw_fetch_maintainers() Brian Masney
2026-10-15 0:03 ` [PATCH b4 4/4] review-tui: change the Patchwork delegate from the pw browser Brian Masney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261014-pw-delegate-v1-2-a393ae92152a@kernel.org \
--to=masneyb@kernel.org \
--cc=jbrunet@baylibre.com \
--cc=konstantin@linuxfoundation.org \
--cc=tools@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox