feat: ensure OpenClaw skills directory exists and add a clear button to the marketplace search input (#65)

This commit is contained in:
Felix
2026-02-12 16:54:56 +08:00
committed by GitHub
Unverified
parent 582287c74c
commit 541a85a5b0
3 changed files with 43 additions and 24 deletions

View File

@@ -640,11 +640,16 @@ export function Skills() {
// Handle marketplace search
const handleMarketplaceSearch = useCallback((e: React.FormEvent) => {
e.preventDefault();
if (marketplaceQuery.trim()) {
searchSkills(marketplaceQuery);
}
searchSkills(marketplaceQuery);
}, [marketplaceQuery, searchSkills]);
// Auto-reset when query is cleared
useEffect(() => {
if (activeTab === 'marketplace' && marketplaceQuery === '' && marketplaceDiscoveryAttemptedRef.current) {
searchSkills('');
}
}, [marketplaceQuery, activeTab, searchSkills]);
// Handle install
const handleInstall = useCallback(async (slug: string) => {
try {
@@ -908,10 +913,19 @@ export function Skills() {
placeholder={t('searchMarketplace')}
value={marketplaceQuery}
onChange={(e) => setMarketplaceQuery(e.target.value)}
className="pl-9"
className="pl-9 pr-9"
/>
{marketplaceQuery && (
<button
type="button"
className="absolute right-3 top-3 text-muted-foreground hover:text-foreground"
onClick={() => setMarketplaceQuery('')}
>
<X className="h-4 w-4" />
</button>
)}
</div>
<Button type="submit" disabled={searching || !marketplaceQuery.trim()} className="min-w-[100px]" asChild>
<Button type="submit" disabled={searching} className="min-w-[100px]" asChild>
<motion.button whileTap={{ scale: 0.98 }}>
<AnimatePresence mode="wait" initial={false}>
{searching ? (