fix(webui): refresh skill suggestions when opening the picker

Refresh the shared skill list when a dollar-reference picker opens so skills installed by the agent appear without reloading the page. Coalesce in-flight requests and preserve the last known list on transient failures.

Cover post-load discovery, Tab completion, removals, request deduplication, cleanup, and retry behavior with regression tests.
This commit is contained in:
Xubin Ren committed 2026-09-09 13:36:50 +08:00
1 parent b5d2a3fb8e
commit 27518ca9fd
4 files changed
+120 -3

No files matched your search

+6
View File
@@ -1,6 +1,12 @@
import type { SkillsPayload } from "@/lib/types";
export const SKILLS_CHANGED_EVENT = "nanobot:skills-changed";
export const SKILLS_REFRESH_EVENT = "nanobot:skills-refresh";
export function requestSkillsRefresh(): void {
if (typeof window === "undefined") return;
window.dispatchEvent(new Event(SKILLS_REFRESH_EVENT));
}
export function isSkillsPayload(value: unknown): value is SkillsPayload {
return (