feat: Add subfolder support for model specs (#9165)

- Add optional `folder` field to TModelSpec type and schema
- Create ModelSpecFolder component for hierarchical display
- Implement expand/collapse functionality for folders
- Update search results to show folder context
- Sort folders alphabetically and specs by order/label
- Maintain backward compatibility (specs without folders appear at root)

This enhancement allows organizing model specs into categories/folders
for better organization and improved user experience when dealing with
many model configurations.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
constanttime 2025-08-24 23:37:53 +05:30
parent 543b617e1c
commit 4fe600990c
7 changed files with 439 additions and 3 deletions

View file

@ -19,6 +19,7 @@ export type TModelSpec = {
showIconInHeader?: boolean;
iconURL?: string | EModelEndpoint; // Allow using project-included icons
authType?: AuthType;
folder?: string; // Optional folder/category for grouping model specs
};
export const tModelSpecSchema = z.object({
@ -32,6 +33,7 @@ export const tModelSpecSchema = z.object({
showIconInHeader: z.boolean().optional(),
iconURL: z.union([z.string(), eModelEndpointSchema]).optional(),
authType: authTypeSchema.optional(),
folder: z.string().optional(),
});
export const specsConfigSchema = z.object({