feat: improve save/load interface with custom names and metadata (#128)

* feat: improve save/load interface with custom names and metadata

- Add custom save name support with input validation
- Extend save metadata with avatar counts, protagonist info, and event count
- Add quick save button alongside named save option
- Enhance save list display with richer information
- Add sanitize_save_name and find_protagonist_name helpers
- Update API endpoints to support new features
- Add i18n translations for new UI elements

Closes #95

* test: add comprehensive tests for save custom name feature

- Add 37 tests for sanitize_save_name, find_protagonist_name
- Add tests for custom name API endpoints
- Add tests for enhanced metadata
- Fix unused NIcon import in SaveLoadPanel
- Add zh-TW translations for new save_load keys

* test(frontend): add SaveLoadPanel component tests

- Add 21 tests for SaveLoadPanel component
- Cover save mode, load mode, display, validation
- Mock naive-ui components, stores, and API
This commit is contained in:
Zihao Xu
2026-02-06 06:03:41 -08:00
committed by GitHub
parent ef926594c7
commit 67b559ac5a
10 changed files with 1607 additions and 73 deletions

View File

@@ -19,8 +19,11 @@ export const systemApi = {
return httpClient.get<{ saves: SaveFileDTO[] }>('/api/saves');
},
saveGame(filename?: string) {
return httpClient.post<{ status: string; filename: string }>('/api/game/save', { filename });
saveGame(customName?: string) {
return httpClient.post<{ status: string; filename: string }>(
'/api/game/save',
{ custom_name: customName }
);
},
loadGame(filename: string) {