feat: add project icon picker component and integrate with project management

- Implemented ProjectIconPicker component for selecting project icons.
- Created ProjectIcon component to display selected icons.
- Updated calendar page to remove unused PageHeading component.
- Modified growth page to enhance UI and improve text clarity.
- Refactored index page to include project icons and improve layout.
- Added mine page for user profile management with avatar selection.
- Introduced projects-sort page for managing project order with drag-and-drop functionality.
- Enhanced projects page to allow icon selection when adding or editing projects.
- Updated record page to streamline user experience and improve form actions.
- Adjusted practice service to support project icon management.
- Added tests for project saving functionality to ensure correct handling of icons.
- Updated global type definitions to support SVG and PNG imports.
This commit is contained in:
yuxuanhui
2026-09-29 18:40:25 +08:00
parent 9644a68d07
commit b0c62d461e
71 changed files with 1305 additions and 125 deletions
+19
View File
@@ -82,3 +82,22 @@ test('failed loads stay errors and only confirmed writes notify visible pages',
assert.equal(changes, 1)
stop()
})
test('project saves distinguish keeping, replacing and clearing an icon', async () => {
const payloads = []
const service = client(async request => {
if (request.url.endsWith('/session')) return session('token')
payloads.push({ method: request.method, data: JSON.parse(JSON.stringify(request.data)) })
return ok({ id: 'project-1', ...request.data })
})
await service.api.saveProject('小球核心', undefined, 'ball-core')
await service.api.saveProject('晚间练习', 'project-1')
await service.api.saveProject('晚间练习', 'project-1', 'breathing')
await service.api.saveProject('晚间练习', 'project-1', '')
assert.deepEqual(payloads, [
{ method: 'POST', data: { name: '小球核心', iconId: 'ball-core' } },
{ method: 'PUT', data: { name: '晚间练习' } },
{ method: 'PUT', data: { name: '晚间练习', iconId: 'breathing' } },
{ method: 'PUT', data: { name: '晚间练习', iconId: '' } },
])
})