Skip to content

feat(dashboard): add retry to skill and slash picker load-failure notices - #22662

Merged
iamwhatever merged 1 commit into
mainfrom
kc-wt-11405
Oct 30, 2026
Merged

iamwhatever merged 1 commit into
mainfrom
kc-wt-11405

Conversation

@dodgeblaster

@dodgeblaster dodgeblaster commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Let a user retry a failed skill-picker or slash-command load without closing and reopening the menu.

When the $skill picker or the /command menu could not load its list, it showed a "Couldn't load…" notice and left the user stuck — the only way to try again was to close the composer menu and reopen it. Four sibling pickers (the @-mention file search, Project picker, Workspace picker, Folder panel) already got a Retry control for the same failure in #7068; these two menus were the gap, tracked as the deferred finding #11405.

Why it matters

A transient gateway hiccup turns a one-keystroke action into a dead end: the menu tells the user it failed but offers no way forward. The retry affordance already exists and is expected everywhere else, so its absence here is an inconsistency a user runs into exactly when something is already going wrong.

Not a goal

  • No new copy or new failure wording — the existing notice text is unchanged.
  • No change to the keyboard release/announce behaviour, the loading state, or the non-failure empty states ("No matching skills/commands").
  • No shared RetryControl component — this reuses the established inline-retry pattern, matching the sibling pickers.

What changed (motivation → approach → change)

Both menus (SkillPickerMenu.tsx and SlashCommandMenu.tsx) load their list through TanStack Query, so recovery is a re-ask of that same query. Each failure notice now carries a Retry button beside it that calls the query's refetch(); on success the menu re-renders from the fresh data with no error, so the notice clears itself with no separate dismiss. While the re-ask is in flight the button is inert-but-focusable (aria-disabled plus an in-handler guard, flipping its label to "Retrying…"), the same contract the sibling pickers use so a second press starts nothing and keyboard focus is never dropped (the button also prevents its mousedown default so clicking it never pulls focus off the composer). A dedicated busy flag drives that state, because a refetch after an error flips React Query back to its pending shape and would otherwise show the first-load "Loading…" copy instead of the retry affordance.

Keyboard users reach the same control. The menu floats in an overlay with zero rows on a failed load, so the shared list-keyboard hook (useListKeyboardNav) used to close it on Tab, and Retry was never reachable without a mouse. The hook takes an optional emptyActionRef: with zero rows and that control mounted, Tab from the composer moves focus to Retry and keeps the menu open. On Retry, Enter or Space activates it, Tab/Shift+Tab return to the composer, and Escape returns focus and closes. Activating Retry returns focus to the composer first, and if the button disappears while it holds focus for any other reason (a re-ask already in flight landing), the hook returns focus to the composer after that render, so focus never drops to the page; focus the user moved elsewhere is left alone. Enter from the composer still releases to Enter-to-send exactly as before, the announcements are unchanged, and every other caller of the hook leaves the option unset and behaves as before.

Because a load failure is an error surface, the notice now renders through the shared ErrorNotice component (the errors-use-error-notice rule) rather than the old plain role="status" text — so it gains the standard danger styling and the warning icon the sibling pickers' failure notices carry.

One new string is added: commands_load_failed ("Couldn't load commands", no send-key suffix) for the slash menu, which the skill menu already had as skills_load_failed. The slash menu now shows this plain variant while the re-ask is in flight — Enter is held then, so the pre-existing "… — Enter sends the message" variant would have promised a key the composer is not accepting. Every other failure/empty string is unchanged.

The control is offered only in the load-FAILED empty state. A genuine zero-match ("No matching skills/commands") has nothing to re-ask, so it keeps its plain notice.

The button's label reuses the existing "Retry"/"Retrying…" strings the sibling pickers ship, added under each menu's own namespace in every src/i18n/locales catalog — English in en.manual.json, each non-English locale reusing its own existing translation, pseudolocale regenerated.

Backwards compatibility

Compatible: this adds a control to one previously-dead failure state and adds i18n keys; no existing key, prop, or behaviour is renamed, removed, or tightened.

Tests

  • website/src/test/SkillPickerMenu.retry.test.tsx and website/src/test/SlashCommandMenu.retry.test.tsx lock in: the Retry control appears on a failed load; pressing it re-issues the load and the notice clears when it lands; it is an inert "Retrying…" while the re-ask is out and a second press sends nothing; it keeps the notice and returns to "Retry" when the re-ask fails again; and no Retry is offered on a genuine zero-match (negative control). They also cover the keyboard path: Tab reaches Retry without closing the menu, Enter on Retry is not taken by the list, and activating it re-asks and returns focus to the composer.
  • website/src/hooks/useListKeyboardNav.imeGuard.test.tsx covers the hook option directly: Tab jumps to the control, Tab/Shift+Tab on it return focus, Escape restores focus and closes, Enter on it is left to the button, the control unmounting while focused returns focus (and does not steal it when focus is elsewhere), and without the option Tab still closes the empty list.
  • Without the hook and menu change the new tests fail; with it they pass. The unmount-while-focused cases (a Tab during an in-flight retry, then the retry landing with rows or with zero rows) fail 7 of 59 against the hook without the post-render restore.
  • Determinism: the three files ran 5 times with --sequence.shuffle (seeds 7919, 15838, 23757, 31676, 39595), 59/59 each run. Related suites (170 files that reference the hook or its callers) pass, 2461/2461.

Manual verification

Rendered both menus in their load-failure state (picker source made to reject) and the mid-retry state (the re-ask held open), and confirmed the Retry control appears, is styled like the sibling pickers' ErrorNotice, and dims to an inert "Retrying…" while the re-ask is out — see Screenshots.

Screenshots

Skill picker, load failed:

Skill picker load-failure notice with Retry

Slash-command menu, load failed:

Slash-command menu load-failure notice with Retry

Skill picker, mid-retry (inert "Retrying…"):

Skill picker retrying state

Slash-command menu, mid-retry (inert "Retrying…"):

Slash-command menu retrying state

Issue link

Fixes #11405

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 21, 2026
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of d605a24b08a4a95511fef11f0c7c918b1f8196b1 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: the retry is the same in-place query re-fetch the sibling pickers use, and the hook change only applies when a caller passes emptyActionRef, so other callers behave as before.

Notes

  • Both menus now carry nearly identical copies of the retrying/retryInFlight state and the Retry button markup. A small usePickerRetry(refetch, isFetching) hook would keep the two from drifting apart. Building a shared component is not this PR's job.

[DESIGN-REVIEWED] d605a24

Description read

[DESCRIPTION-READ] a27053d5367385d9575114bd3dadfb42b27e47c2bb088739bea5f5839578ea97

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of d605a24b08a4a95511fef11f0c7c918b1f8196b1 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks: every item traces to #11405 and its hook option has two real callers.

What this change ships

Inventory (7 items) — 7 justified

Intent: let a user retry a failed $skill or /command list load in place, without closing and reopening the menu. This is a FIX for the dead-end state reported in #11405.

  1. A Retry button appears beside the skill picker's "Couldn't load skills" notice — justified
  2. A Retry button appears beside the slash menu's "Couldn't load commands" notice — justified
  3. While the reload is running, the button shows an inert "Retrying…" and a second press starts nothing — justified
  4. The failure notice now renders as a danger-styled alert with an icon (ErrorNotice) instead of plain status text — justified
  5. During the slash-menu reload, the notice shows "Couldn't load commands" without the "Enter sends" suffix, through a new string key — justified
  6. With an empty list, Tab moves to Retry and the menu stays open (emptyActionRef, 2 callers); Tab or Escape on Retry returns focus to the composer — justified
  7. If Retry disappears while it has focus, focus goes back to the composer rather than to the page body — justified

[FIRST-PRINCIPLES-REVIEWED] d605a24

Description read

[DESCRIPTION-READ] 18cd8774182a15f99792e225131db6ac93406ef5d55123e772bd26adede5bffa

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of d605a24b08a4a95511fef11f0c7c918b1f8196b1 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

Nothing blocks. The blind reader correctly identified Retry and "Retrying…" in all four screenshots, and both of the states this PR adds are shown.

Notes

  • Moving the copy into ErrorNotice turns "— Enter sends the message" red, and the reader took it as "part of the error and not like reassurance". Render that clause in muted text, separate from the danger-coloured failure text.

[UX-REVIEWED] d605a24

Description read

[DESCRIPTION-READ] 69a1b007eff8b526a4b739582de3bbc22cd14e88eae6b0783a52ab842750b7eb

That sha256 names everything this verdict read: the PR description, plus the 7 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of d605a24b08a4a95511fef11f0c7c918b1f8196b1 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] d605a24

False positive or not applicable? A repository writer can comment:
/ai-review override gpt d605a24b08a4a95511fef11f0c7c918b1f8196b1 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed d605a24b08a4a95511fef11f0c7c918b1f8196b1 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] d605a24

Verdict parsed from the review's SHA-scoped output markers for commit d605a24b08a4a95511fef11f0c7c918b1f8196b1.

False positive or not applicable? A repository writer can comment:
/ai-review override fable d605a24b08a4a95511fef11f0c7c918b1f8196b1 false-positive: <reason, 20 to 500 characters>

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running and removed readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention labels Oct 21, 2026
@dodgeblaster
dodgeblaster force-pushed the kc-wt-11405 branch 2 times, most recently from aa409fe to fccc968 Compare October 21, 2026 05:06
@dodgeblaster

Copy link
Copy Markdown
Contributor Author

Copy change recorded (Design/UX clears-when). This PR adds exactly one new catalog string, components.slashCommandMenu.commands_load_failed = "Couldn't load commands" (no send-key suffix), across all 13 locales. It is the slash-menu parallel of the skills_load_failed string the skill picker already shipped.

Behaviour it drives: while a Retry is in flight the keyboard-release gate holds Enter (releaseKeysWhenEmpty = !isFetching && … is false), so the slash menu now shows this plain variant instead of the pre-existing "Couldn't load commands — Enter sends the message" — which would otherwise promise a key the composer is not accepting in that window. This mirrors how SkillPickerMenu already builds its emptyKey, and it was the fix for the Opus finding that the copy contradicted the held key.

The mid-retry screenshots in the PR description have been re-captured from this revision and now show the plain "Couldn't load skills" / "Couldn't load commands" text in the Retrying state, matching the code.

The frozen "Not a goal" bullet ("No new copy or new failure wording") predates this reviewer-driven correctness fix; I have not edited the frozen goal sections. The single added string and its behaviour are documented here and in the "What changed" section instead.

@dodgeblaster

Copy link
Copy Markdown
Contributor Author

self-added: no

  • Mixed copy in the error notice (span=b4b5c64383d9)

needs-a-decision: a product-copy call the maintainer owns. The error colour is not a free choice — the blocking errors-use-error-notice rule requires the load failure to render through ErrorNotice (GPT+Opus BLOCKed the earlier head for bypassing it), so the keyboard tip sits in a danger surface by rule, not by this PR's design. Rewording or splitting the *_load_failed[_enter_sends] strings is new copy across all shipped locales, which the frozen Goal (add a Retry control to the two notices) did not settle. UX graded this moderate friction, not a failure, and flagged it as follow-up on the prior head. Keeping the existing wording; the maintainer owns any copy rewrite.

@dodgeblaster

Copy link
Copy Markdown
Contributor Author

self-added: no

  • *Reword the _load_failed_enter_sends messages so the outcome comes first (span=d23b482ef945)

needs-a-decision: the same product-copy call as the Watch item, owned by the maintainer. The suggestion re-authors the failure strings ("Couldn't load skills. Press Enter to send your message as typed.") — new wording across every shipped locale, outside this PR's frozen Goal (add a Retry control, no copy rewrite). Deferring the wording to the maintainer; this PR keeps the existing strings.

@dodgeblaster

Copy link
Copy Markdown
Contributor Author

self-added: no

  • A repeated failure gives no new signal (span=e3ebd3ff748c)

needs-a-decision: this asks for a NEW capability the frozen Goal did not include — a distinct "retry failed again" state (a counter, or a "Still couldn't load" variant). The Goal is to add the Retry affordance the four sibling pickers already carry (#7068), and those pickers show the same notice unchanged on a repeated failure too, so this PR matches the established pattern rather than inventing a richer failure model for two menus alone. UX graded this low. A distinct re-fail signal is a product decision + new copy the maintainer owns; out of scope here.

@dodgeblaster

Copy link
Copy Markdown
Contributor Author

self-added: no

  • After a retry fails, add a "Still couldn't load" variant or count the attempts (span=20b51c9ed7df)

needs-a-decision: a new feature (attempt counting, or a second failure-copy variant) beyond the frozen Goal of adding a Retry control, and it is new copy across all locales. The sibling pickers from #7068 do not count attempts either, so adding it to these two menus alone would diverge from the shared pattern. The maintainer owns whether to introduce a distinct re-fail signal and its wording; deferring, this PR keeps parity with the established pickers.

@dodgeblaster

Copy link
Copy Markdown
Contributor Author

Frontend Tests (1) is red on this head (3eb45dd) in src/test/kiroUsageRefetchInterval.test.ts > maps an explicit unavailable answer to a terminal sentinel (expected 'none' to be 'api-key'). This PR does not touch that test or website/src/api/kiroUsage.ts; both are byte-identical to origin/main. It is main's red, tracked in #25941, with the fix in #25944. Main's own push CI does not catch it because that run only executes the test files related to the push's diff.

@dodgeblaster
dodgeblaster force-pushed the kc-wt-11405 branch 2 times, most recently from 49b1ccc to d4537c2 Compare October 29, 2026 23:58
@dodgeblaster

dodgeblaster commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor Author

self-added: no
mechanism: opt-in empty-state focus target on useListKeyboardNav

  • span=317d33963fa8 Empty-list keyboard handling makes both Retry buttons unreachable

fixed in d4537c2: useListKeyboardNav takes an optional emptyActionRef; with zero rows and that control mounted, Tab moves focus to it instead of closing the menu.
On the control, Enter/Space stay native (the button activates; the hook neither closes nor chooses), Tab/Shift+Tab return focus to the composer, Escape returns focus and closes.
Retry's onClick returns focus to the composer before the re-ask, so a successful retry that unmounts the button does not drop focus to body.
Enter from the composer keeps the release-to-send path; callers that leave the option unset (ProjectPicker, CommandPalette, FilePickerMenu, SettingsSearch) are unchanged.
Both menus wire it. Regression tests in both retry suites and the hook suite fail without the change (14/52) and pass with it.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 30, 2026
…ices

The skill picker and slash-command menus render a load-failure notice when
their bounded fetch fails but offered no way to recover, unlike four sibling
pickers that already carry a retry control (#7068). Add the same affordance:
a Retry button beside each notice that re-issues the query; on success the
menu re-renders with no error, so the notice clears itself. The control is
inert-but-focusable while the re-ask is in flight (aria-disabled + an
in-handler guard, flipping to Retrying...), matching the sibling pickers.
Copy reuses the existing Retry/Retrying strings under each menu's own i18n
namespace across all locales.

Fixes #11405
@dodgeblaster

Copy link
Copy Markdown
Contributor Author

self-added: yes
mechanism: post-render focus restore when the empty-state action unmounts while focused

  • span=0e742243d50b Retry can unmount while focused and drop focus to body

fixed in d605a24: useListKeyboardNav runs a layout effect after each commit. When forward Tab saved a return target and the empty action is now gone (or the surface closed), it restores focus to that target if focus fell to body, and only clears the target otherwise.
Covers both settle outcomes the finding names: rows replacing the empty state, and zero rows switching to the "No matching" status. Focus the user moved elsewhere is never taken back.
Callers without emptyActionRef never set a return target, so the effect returns at its first check for them.
Regression tests in both retry suites (Tab during an in-flight retry, then the retry lands with rows / with zero rows) and the hook suite (unmount while focused restores; unmount with focus elsewhere does not steal) fail 7/59 without the effect and pass with it.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 30, 2026
@dodgeblaster
dodgeblaster marked this pull request as ready for review October 30, 2026 01:21
@dodgeblaster
dodgeblaster requested review from a team and KiroCrewCaptain as code owners October 30, 2026 01:21
@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Oct 30, 2026

@buluoray buluoray left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 Kiro Crew Auto-Pipeline [operator: buluoray]:

Approving at d605a24.

A failed $skill or /command load now has a Retry that the keyboard can reach, so the user no longer has to close and reopen the composer menu. This matches the four sibling pickers.

What I checked:

  • The new emptyActionRef option on useListKeyboardNav is inert for every caller that does not set it, because forward Tab only saves a return target when the action is mounted. The post-commit restore only moves focus that has dropped to <body>.
  • The keyboard path is pinned. Disabling the forward-Tab-to-action branch fails 12 tests in the "useListKeyboardNav empty action" suite. The three new files are 59/59 on this head.

Follow-up, not blocking: "is an inert 'Retrying…' while the re-ask is out, and a second press sends nothing" does not pin the guard it describes. Removing if (isFetching) return from the slash menu's retryLoad leaves all 59 tests green. The call count is asserted synchronously right after the second click, before the load could have been called. Awaiting a tick (or a waitFor that the count stays unchanged) before the assertion would make the test fail without the guard. The SkillPicker test likely has the same shape.

Note for readers: the slash menu's failure notice now renders as an ErrorNotice alert instead of a muted status line. This is deliberate under the error-notice rule and matches the siblings.

@iamwhatever iamwhatever left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve at d605a24.

Both menus now show a Retry beside their load-failure notice. It re-asks the same query, and it stays inert while that re-ask is out. The useListKeyboardNav change is opt-in. Forward Tab moves to the empty action only when a caller passes emptyActionRef and the list is empty (useListKeyboardNav.ts#L239). The post-commit restore only moves focus that fell to <body> (useListKeyboardNav.ts#L151), so the other callers keep their behaviour. Earlier GPT and Opus findings have fixed dispositions that match the diff. All checks are green, and the branch is clean against main.

AI findings judged non-blocking:

  • UX note, the 'Enter sends the message' clause turns red inside ErrorNotice: a copy call the author put to the maintainer, and the ErrorNotice surface is required by errors-use-error-notice.
  • Design note, the two menus duplicate the retry state: a refactor suggestion the lane itself scopes out of this PR (SlashCommandMenu.tsx#L179).

Small test note, agreeing with the earlier approval: the 'second press sends nothing' test checks the call count right after the click, so it would pass without the if (isFetching) return guard. Waiting a tick before that assertion would make it pin the guard.

— crew-pr-reviewer (r137)

@iamwhatever
iamwhatever enabled auto-merge (squash) October 30, 2026 23:51
@iamwhatever
iamwhatever merged commit fa78946 into main Oct 30, 2026
98 checks passed
@iamwhatever
iamwhatever deleted the kc-wt-11405 branch October 30, 2026 23:52
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add RetryControl to SkillPickerMenu and SlashCommandMenu load-failure notices

3 participants