4.2 KiB
4.2 KiB
id, title, status, wave, depends_on, plan, spec
| id | title | status | wave | depends_on | plan | spec | |
|---|---|---|---|---|---|---|---|
| 02-placement-setting | Portable placement setting | completed | 2 |
|
plan.md | ../../specs/platform/requirements/lsp-file-intelligence.md |
Task 02: Portable Placement Setting
Acceptance
lsp_status_locationround-trips through the existing backend user-settings JSON, DTO, PATCH, event, and boot-state paths; missing values default totoolbarand invalid PATCH values fail.- Settings > Editors exposes
toolbarandstatus_bar, participates in the route save coordinator, and explains the application-status-bar/fine-pointer fallback. - One pure helper resolves effective toolbar versus status-bar placement without mutating the saved preference.
TDD sequence
- Add failing backend tests for default, round-trip, validation, DTO, event, and boot mapping.
- Implement the backend contract and run its focused Go packages.
- Add failing frontend hydration, WS, dirty-state, and placement-resolution tests.
- Implement store/API/settings wiring and the placement choice.
Verification
cd apps/backend && go test -run 'Test.*LspStatusLocation' ./internal/user/dto ./internal/user/service ./internal/user/store ./internal/backendapp
cd apps && pnpm --filter @kandev/web test -- --run lib/ssr/user-settings.test.ts lib/ws/handlers/users.test.ts components/settings/settings-dirty.test.ts lib/lsp/lsp-status-placement.test.ts
cd apps/web && pnpm run typecheck
cd apps/web && pnpm exec eslint components/settings lib/ssr/user-settings.ts lib/ws/handlers/users.ts lib/lsp/lsp-status-placement.ts hooks/use-user-display-settings.ts
Files likely touched
apps/backend/internal/user/models/models.goapps/backend/internal/user/dto/dto.goapps/backend/internal/user/dto/dto_test.goapps/backend/internal/user/service/service.goapps/backend/internal/user/service/service_test.goapps/backend/internal/user/store/sqlite.goapps/backend/internal/user/store/sqlite_test.goapps/backend/internal/backendapp/boot_state_routes.goapps/backend/internal/backendapp/boot_state_user_settings_test.goapps/web/lib/types/http-user-settings.tsapps/web/lib/types/backend.tsapps/web/lib/state/slices/settings/types.tsapps/web/lib/state/slices/settings/settings-slice.tsapps/web/lib/ssr/user-settings.tsapps/web/lib/ssr/user-settings.test.tsapps/web/lib/ws/handlers/users.tsapps/web/lib/ws/handlers/users.test.tsapps/web/hooks/use-user-display-settings.tsapps/web/components/settings/editors-settings-state.tsxapps/web/components/settings/editors-settings.tsxapps/web/components/settings/settings-dirty.tsapps/web/components/settings/settings-dirty.test.tsapps/web/lib/lsp/lsp-status-placement.tsapps/web/lib/lsp/lsp-status-placement.test.ts
Dependencies
Task 01 supplies the shared status language used in the placement UI.
Parallelism
Sequential. Backend and frontend share one portable wire contract.
Inputs
- Spec User settings and placement scenarios.
- ADR 0041 for backend-owned portable settings.
- ADR 0046 and
EditorsSettingsfor coordinated save behavior.
Output contract
Record RED/GREEN evidence, wire/default values, files changed, exact commands, and update this task plus plan.md.
Result
- RED backend: the focused Go command failed because the model, DTO, validation, persistence, event, and boot-state contracts did not expose
lsp_status_location. - GREEN backend: focused tests pass across DTO, service, store, controller, and boot-state packages. The backend-owned JSON value accepts
toolbarandstatus_bar, defaults missing or unknown stored values totoolbar, and rejects invalid PATCH values. - RED frontend: the four focused Vitest files failed on missing hydration, live-update, dirty-state, and placement behavior.
- GREEN frontend: 47 focused tests, the full web typecheck, and focused ESLint pass without warnings.
- Settings > Editors now saves the portable preference through the route save coordinator. A pure resolver keeps
status_baronly when the application status bar and a fine pointer are available, falls back totoolbarwithout rewriting the preference, and excludes the phone viewer.