Skip to content

Centralize appearance preview events (codex) - #2563

Merged
numnx merged 1 commit into
feature/CODUX-171-onboarding-light-modefrom
task/feature-codux-171-onboarding-light-mode-t01-codex-mragankr
Jul 7, 2026
Merged

Centralize appearance preview events (codex)#2563
numnx merged 1 commit into
feature/CODUX-171-onboarding-light-modefrom
task/feature-codux-171-onboarding-light-mode-t01-codex-mragankr

Conversation

@numnx

@numnx numnx commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

🧩 Task: Centralize appearance preview events

Automated task PR opened by Code UX for T01.

📋 Summary

Sprint: Sprint 171 · Onboarding light mode · Task: T01

Fix onboarding appearance so light mode and background choices render immediately inside the onboarding experience, with shared preview behavior, regression coverage, and updated docs.

🤖 Model & Provider

Provider Codex CLI
Model gpt-5.5

⏱️ Timing

Started 2026-07-07 09:32:43 UTC
Finished 2026-07-07 09:39:01 UTC
Duration 6m 18s

📊 Token Usage

Metric Value
Input tokens 209,378
Cached input tokens 747,776
Output tokens 6,430
Total tokens 963,584
Invocations 1
Tool calls 34
Active time 5m 31s

Included usage estimate (subscription/local login): $1.61

✅ QA Review

⏳ QA review runs after this PR is opened. Check the task card in the dashboard for the outcome once it lands.

📝 Full Task Prompt
## Objective
Add a small shared helper for the existing `codeux:appearance-preview` contract so Settings and Onboarding can publish unsaved appearance state consistently.

## Scope
- Create `dashboard/src/v2/lib/appearance-preview.ts`
- Create `dashboard/src/v2/lib/__tests__/appearance-preview.test.ts`
- Edit `dashboard/src/v2/hooks/use-settings-page-state.ts`
- Verify existing `tests/dashboard/v2/settings-page-state.test.tsx` preview behavior
- Relevant symbols: `codeux:appearance-preview`, `DashboardSettings["appearance"]`, `useSettingsPageState`

## Implementation Requirements
1. Add exported helpers such as `publishAppearancePreview(appearance: DashboardSettings["appearance"] | null): void` and, if useful, `clearAppearancePreview(): void`; helpers must no-op when `window` is unavailable.
2. Move direct `window.dispatchEvent(new CustomEvent("codeux:appearance-preview", ...))` usage in `use-settings-page-state.ts` to the new helper while preserving the existing event detail shape `{ appearance }`.
3. Add focused tests for publishing a non-null appearance payload, publishing `null`, and SSR/no-window safety if the test environment can exercise it without brittle globals.
4. Keep the existing settings-page preview lifecycle unchanged: editable appearance changes publish previews, and unmount publishes `appearance: null`.

## Constraints
- Do not change `codeux:settings-updated`; this task only touches unsaved appearance preview events.
- Do not alter settings save/load APIs or persisted schema.
- Preserve `tests/dashboard/v2/settings-page-state.test.tsx` expectations for preview event payloads and cleanup.
- Keep the helper free of Preact hooks so it can be used from components and hooks.

## Verification
- Run `pnpm exec vitest run dashboard/src/v2/lib/__tests__/appearance-preview.test.ts tests/dashboard/v2/settings-page-state.test.tsx`.
- Run `pnpm run typecheck:dashboard`.
- Success means the new helper emits the same event detail shape and existing Settings preview tests still pass.
🌿 Branch Info

Base: feature/CODUX-171-onboarding-light-mode
Head: task/feature-codux-171-onboarding-light-mode-t01-codex-mragankr


🤖 Generated by Code UX

@numnx
numnx merged commit 2e01933 into feature/CODUX-171-onboarding-light-mode Jul 7, 2026
6 checks passed
@numnx
numnx deleted the task/feature-codux-171-onboarding-light-mode-t01-codex-mragankr branch July 7, 2026 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant