feat(providers): add timestamp-based sorting for provider list

- Add createdAt timestamp field to Provider interface
- Implement sorting logic: old providers without timestamp first, then by creation time
- Providers without timestamps are sorted alphabetically by name
- New providers are automatically timestamped on creation
This commit is contained in:
Jason
2025-09-07 22:29:08 +08:00
parent fa2b11fcc2
commit 1482dc9e66
3 changed files with 25 additions and 2 deletions

View File

@@ -134,6 +134,7 @@ function App() {
const newProvider: Provider = {
...provider,
id: generateId(),
createdAt: Date.now(), // 添加创建时间戳
};
await window.api.addProvider(newProvider, activeApp);
await loadProviders();