feat(model): improve model list UI and add disabled models management (#11036)

*  feat(model): improve model list UI and add disabled models management

- Enhanced DisabledModels component with better UI/UX
- Updated ModelList layout and interactions
- Added repository methods for disabled model management
- Improved AI model service and router functionality
- Added tests for new functionality

*  feat(DisabledModels): enhance loading and rendering logic for disabled models

- Implemented pagination and dynamic loading for disabled models
- Improved state management for visible models and loading conditions
- Ensured unique model entries in the displayed list
- Updated component to handle provider changes effectively

Signed-off-by: Innei <tukon479@gmail.com>

* fix(DisabledModels): handle edge case for last page in pagination logic

- Added a check to ensure lastPage is defined before evaluating pagination end conditions
- Improved robustness of loading state management in DisabledModels component

Signed-off-by: Innei <tukon479@gmail.com>

* lint

* lint

* lint

---------

Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
Innei
2025-12-30 16:49:12 +08:00
committed by GitHub
parent 381cf51ec0
commit 4faa65c6af
10 changed files with 290 additions and 63 deletions

View File

@@ -57,7 +57,7 @@ const { spawnMock } = vi.hoisted(() => ({
}));
vi.mock('node:child_process', () => ({
spawn: (...args: any[]) => spawnMock(...args),
spawn: (...args: any[]) => spawnMock.call(null, ...args),
}));
// Mock electron
@@ -229,7 +229,9 @@ describe('SystemController', () => {
await invokeIpc('system.openFullDiskAccessSettings');
expect(shell.openExternal).toHaveBeenCalledWith('com.apple.settings:Privacy&path=FullDiskAccess');
expect(shell.openExternal).toHaveBeenCalledWith(
'com.apple.settings:Privacy&path=FullDiskAccess',
);
expect(shell.openExternal).toHaveBeenCalledWith(
'x-apple.systempreferences:com.apple.preference.security?Privacy_AllFiles',
);