This commit is contained in:
Timothy Jaeryang Baek
2026-04-17 14:18:45 +09:00
parent 8acce144f9
commit c5276f62d0
@@ -56,15 +56,6 @@
const allTools = Object.keys(toolLabels); const allTools = Object.keys(toolLabels);
export let builtinTools: Record<string, boolean> = {}; export let builtinTools: Record<string, boolean> = {};
// Initialize missing keys to true (default enabled)
$: {
for (const tool of allTools) {
if (!(tool in builtinTools)) {
builtinTools[tool] = true;
}
}
}
</script> </script>
<div> <div>
@@ -77,10 +68,12 @@
<Checkbox <Checkbox
state={builtinTools[tool] !== false ? 'checked' : 'unchecked'} state={builtinTools[tool] !== false ? 'checked' : 'unchecked'}
on:change={(e) => { on:change={(e) => {
builtinTools = { if (e.detail === 'checked') {
...builtinTools, delete builtinTools[tool];
[tool]: e.detail === 'checked' } else {
}; builtinTools[tool] = false;
}
builtinTools = builtinTools;
}} }}
/> />