superpowers

This commit is contained in:
2026-07-20 08:02:20 +08:00
parent 0f2cbcb9ee
commit 3669e23085
25 changed files with 13451 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
# Task 1 Report: Login Page And App-Level Session
## What Changed
- Replaced the server-only form with the complete `ServerLogin` page.
- Added server address, account, and password inputs with accessible labels.
- Added server address normalization to `http://` when no protocol is supplied.
- Added account/password validation with the required error message.
- Added the `login` callback payload: `{ apiBase, account }`.
- Updated `App.svelte` to read and persist `localStorage['apiBase']`, render the login page until login, and render the required logged-in workbench placeholder afterward.
## Tests
- `npm test -- --run src/features/auth/ServerLogin.test.ts`: 1 test file, 3 tests passed.
- `npm test -- --run`: 3 test files, 5 tests passed.
- `npm run build`: passed.
- `git diff --check`: passed.
## TDD Evidence
1. Added `ServerLogin.test.ts` before changing production code.
2. Ran the focused test and observed the expected RED result: all 3 tests failed because the old component did not expose the required English fields, login button, or callback.
3. Implemented the brief's component and app-level session behavior.
4. Re-ran the focused test and observed GREEN: all 3 tests passed.
5. Ran the full Web test suite and production build successfully.
## Files Changed
- `apps/web/src/features/auth/ServerLogin.svelte`
- `apps/web/src/features/auth/ServerLogin.test.ts`
- `apps/web/src/app/App.svelte`
## Self-Review
- The implementation is limited to the files named in the task brief, plus this report file.
- No React or shadcn/ui dependency was added.
- The component callback and app state fields match the brief exactly.
- Server address persistence occurs only after a valid login submission.
- Empty account/password input is rejected without invoking the login callback.
- The logged-in placeholder is intentionally temporary and is scoped for Task 3 replacement.
## Concerns
- Login is frontend-only for this task: credentials are validated for presence but no backend authentication request or token session is implemented yet.
- Vite reports the existing repository warning that no Svelte config was found; tests and build still pass.
- The new login markup uses the existing global CSS controls; dedicated login-page styling is not part of the task brief.