Files
browser/openspec/changes/fix-env-profile-settings/tasks.md
T
2026-07-11 14:56:10 +08:00

3.3 KiB

1. Platform Env Bootstrap

  • 1.1 Add a small dotenv loader in platform/config that reads local .env files without overriding explicit process environment values.
  • 1.2 Add config tests for platform/.env MySQL settings, process env precedence, and missing DSN behavior through storage initialization.

2. Personal Settings Workspace

  • 2.1 Add a first-party personal settings route, page id, registry entry, and navigation entry point for authenticated users.
  • 2.2 Move profile, theme palette, background preset, uploaded background, and logout controls from the sidebar popover into the new page.
  • 2.3 Keep profile and theme saves wired to current-user APIs and show API vs local fallback persistence state.
  • 2.4 Add/update frontend tests for routing, shell account navigation, and profile/theme API calls.

3. Verification

  • 3.1 Run cd platform && go test ./config ./api ./service ./repo -count=1.
  • 3.2 Run cd platform_web && npm run typecheck && npm test && npm run build.
  • 3.3 Run scripts/check-structure.sh.
  • 3.4 Run openspec validate fix-env-profile-settings --strict.
  • 3.5 Perform a browser walkthrough for the personal settings page and record the result.

Verification Evidence

  • 2026-07-07: cd platform && go test ./config ./api ./service ./repo -count=1 passed.
  • 2026-07-07: cd platform_web && npm run typecheck passed.
  • 2026-07-07: cd platform_web && npm test passed with 11 files / 47 tests.
  • 2026-07-07: cd platform_web && npm run build passed and Vite produced dist/ assets.
  • 2026-07-07: scripts/check-structure.sh passed.
  • 2026-07-07: openspec validate fix-env-profile-settings --strict reported the change is valid; PostHog telemetry flush failed due restricted DNS and did not affect validation.
  • 2026-07-07: Started cd platform_web && npm run dev -- --port 5173; Vite served the app at http://127.0.0.1:5174/ because 5173 was occupied. Browser walkthrough could not be completed in this tool session because no in-app browser/Chrome control tool or local Playwright/Puppeteer dependency was exposed.
  • 2026-07-08: Rechecked task 3.5 before generating the next architecture-stream OpenSpec. The browser walkthrough remains explicitly blocked in this session: an in-app browser connection opened the auth page at http://127.0.0.1:5177/, but DOM snapshot capture failed with TypeError: o.incrementalAriaSnapshot is not a function; the fallback-enabled dev server then failed to bind requested localhost ports with listen EPERM for 127.0.0.1:5180, 127.0.0.1:5173, and 127.0.0.1:5177. The walkthrough is not accepted; it must be rerun manually or in a working browser/dev-server session before closing this change.
  • 2026-07-08: Browser walkthrough accepted after starting the platform API with file storage at 127.0.0.1:18080 and using the existing Vite dev server at 127.0.0.1:5173. Logged in with the seeded API-backed platform administrator operator.local@example.test, landed on #/home, opened #/profile, verified 个人设置 showed API 已连接, Operator, operator.local@example.test, active, and platform-admin navigation. Edited the contact note to api walkthrough verified 2026-07-08, clicked 保存资料, observed 个人资料已保存到数据库, reloaded #/profile, and confirmed the note value persisted through the API-backed session.