feat(plugins): show a running state on a plugin command's toolbar button (#2371)

A plugin command that takes seconds (an LLM call that fills the commit message) gave no
sign at the button that the click was taken, and a second click started a second run.

Actions may now set `indicatesRunning`: the action runner counts their in-flight runs
and an IconButton bound to such an action shows a spinner, sets aria-busy and ignores
clicks until the run settles. Plugin commands set it, so every toolbar slot that draws
them (editor.title, mainToolbar, commit.message) is covered without a plugin API change
and without features importing each other. The button stays focusable (aria-disabled,
not disabled). Spinner moves to its own module so Button can use it without a cycle
with Feedback, which re-exports it.

Refs #2254

Co-authored-by: NguyenBang <nguyenbang@Mac.lan>
This commit is contained in:
ntbang0901
2026-11-09 22:43:53 +08:00
committed by GitHub
co-authored by NguyenBang
parent 68dd88993b
commit 16bf9b53a2
11 changed files with 222 additions and 67 deletions
+3
View File
@@ -98,6 +98,9 @@
opacity: 0.4;
cursor: default;
}
.iconButton[aria-busy="true"] {
cursor: progress;
}
.iconButton[aria-pressed="true"] {
background: var(--bg-toolbar-selected, var(--bg-tree-selected));
color: var(--fg-strong);