Private
Public Access
1
0

Add category management tools to AI chat (list, create, delete)

Three new tools: list_categories shows all categories with type and
parent, create_category adds a new one with optional parent nesting,
delete_category removes non-system categories by name. Frontend renders
category tables, success alerts for creation, and warning alerts for
deletion.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Catherine Renelle
2026-02-09 23:51:18 -05:00
parent 713f2bfadc
commit 26fb3dc1e1
2 changed files with 162 additions and 1 deletions
@@ -120,6 +120,44 @@
from "{{ data.oldCategory }}" to "{{ data.newCategory }}"
</v-alert>
</div>
<!-- Categories List -->
<div v-else-if="type === 'categories' && Array.isArray(data)">
<v-table density="compact" class="text-caption rounded-lg mb-2">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Parent</th>
</tr>
</thead>
<tbody>
<tr v-for="cat in data" :key="cat.id">
<td>{{ cat.name }}</td>
<td>
<v-chip size="x-small" :color="cat.type === 'Income' ? 'success' : cat.type === 'Expense' ? 'error' : 'info'" variant="tonal">
{{ cat.type }}
</v-chip>
</td>
<td class="text-medium-emphasis">{{ cat.parentName || '-' }}</td>
</tr>
</tbody>
</v-table>
</div>
<!-- Category Created -->
<div v-else-if="type === 'category_created'">
<v-alert type="success" variant="tonal" density="compact" class="mb-2 text-caption">
Created {{ data.type }} category "{{ data.name }}"{{ data.parentName ? ` under "${data.parentName}"` : '' }}
</v-alert>
</div>
<!-- Category Deleted -->
<div v-else-if="type === 'category_deleted'">
<v-alert type="warning" variant="tonal" density="compact" class="mb-2 text-caption">
Deleted {{ data.type }} category "{{ data.name }}"
</v-alert>
</div>
</template>
<script setup lang="ts">