feat: 自动更新

This commit is contained in:
npc0-hue
2026-07-15 19:43:06 +08:00
parent f64eb0831f
commit f3b14b7945
54 changed files with 3207 additions and 589 deletions
@@ -0,0 +1,17 @@
## Why
Profile settings correctly render an uploaded custom background, but the page header metric and background preset controls still label the built-in preset as the current background. This makes users think the uploaded background was ignored when the built-in preset is actually only the fallback after upload removal.
## What Changes
- Show an uploaded custom background as the active background in profile settings summary metrics.
- Treat the selected built-in background preset as a fallback while a custom background is active.
- Label the fallback preset explicitly and avoid marking it as the pressed/active visible background.
- Keep uploaded background precedence and existing theme visual direction unchanged.
## Impact
- Affected root: `platform_web/`.
- Expected files: `platform_web/pages/ProfileSettingsPage.tsx`, `platform_web/theme/base.css`, and focused page rendering tests.
- No platform API, persistence schema, authentication, plugin, run, or server management behavior changes.
- Verification: focused frontend tests, `scripts/check-structure.sh`, and `openspec validate fix-custom-background-status --strict`.
@@ -0,0 +1,19 @@
## ADDED Requirements
### Requirement: Profile settings distinguish active custom backgrounds from fallback presets
The platform_web profile settings page SHALL report an uploaded custom background as the active workspace background while preserving the selected built-in preset only as the fallback after upload removal.
#### Scenario: Uploaded background is active
- **WHEN** a user has configured an uploaded custom background
- **AND** a built-in background preset is also selected
- **THEN** the profile settings summary MUST label the active background as custom rather than naming the built-in preset as current
- **AND** the selected built-in preset MUST be visibly identified as a fallback that appears after the uploaded background is removed
- **AND** the uploaded background MUST remain the workspace desktop
#### Scenario: Uploaded background is removed
- **WHEN** a user removes the uploaded custom background
- **THEN** the previously selected built-in preset becomes the visible active background again
- **AND** the profile settings summary MAY name that built-in preset as current
@@ -0,0 +1,22 @@
## 1. Custom Background Status
- [x] 1.1 Show uploaded custom backgrounds as the active background in the profile settings header metric.
- [x] 1.2 Render the selected built-in preset as a clearly labeled fallback while an uploaded background is active.
- [x] 1.3 Preserve fallback preset selection so removing the uploaded background restores the selected built-in desktop.
## 2. Verification
- [x] 2.1 Add focused rendering coverage for uploaded-background labeling.
- [x] 2.2 Run focused frontend tests.
- [x] 2.3 Run `scripts/check-structure.sh`.
- [x] 2.4 Run `openspec validate fix-custom-background-status --strict`.
## Evidence
- `npm test -- pages/ConsolePages.test.tsx` passed 10 tests.
- `npm test` passed 13 files / 68 tests.
- `npm run typecheck` passed.
- `npm run build` passed.
- `scripts/check-structure.sh` passed.
- `openspec validate fix-custom-background-status --strict` passed; the command printed a PostHog network flush warning after validation because the sandbox cannot resolve `edge.openspec.dev`.
- Runtime UI check on `http://127.0.0.1:5173/#/profile` confirmed `data-custom-background="true"`, summary `背景 自定义背景`, fallback chip `机甲格纳库 备用`, and theme switch black mecha -> magical-girl preserved the uploaded background.