Skip to content

feat(frontend): T-219 TaskCreationWizard 3-step Radix Dialog + n shortcut (closes #87)#113

Merged
mpiton merged 2 commits into
mainfrom
feat/i-87-t-219-task-creation-wizard
May 13, 2026
Merged

feat(frontend): T-219 TaskCreationWizard 3-step Radix Dialog + n shortcut (closes #87)#113
mpiton merged 2 commits into
mainfrom
feat/i-87-t-219-task-creation-wizard

Conversation

@mpiton
Copy link
Copy Markdown
Owner

@mpiton mpiton commented May 13, 2026

Summary

  • 3-step Radix Dialog wizard (TaskCreationWizard.tsx) for creating tasks, wired to the Backlog + Add task button and a global n keyboard shortcut.
  • Submission via invokeTasksCreate -> useTaskStore.upsertTask -> close, with submit-token race guards and background-success reconciliation so closing the dialog mid-flight no longer drops a backend-created task.
  • Full i18n parity (en/fr), a11y announcements, and 15 new vitest cases covering every AC plus reviewer-flagged edge cases.

Closes #87 (T-219).

Why

Sprint 2 §21 (T-219, story points 5) gates task creation UX. Backlog column shipped in T-216 with a non-wired + Add task button and App.tsx already advertises the n shortcut hint — this PR closes both gaps and unblocks any subsequent task-editing work.

Changes

New files

  • src/features/kanban/components/TaskCreationWizard.tsx — 3-step Radix Dialog: title (autoFocus, inline validation, maxLength=200), body (plain <textarea>, maxLength=65535, helper line notes CodeMirror lands in F-066/F-086), review summary with project name resolution. useTaskCreationForm hook owns form state + submission orchestration; module-level stepAdvance/stepBack/finalizeSubmit/applySubmitSuccess/applySubmitFailure/reconcileBackgroundSuccess keep the hook under max-statements: 10. useFormSubmitRefs memoizes the ref bundle so useResetFormOnClose's useEffect deps are actually stable. The submitTokenRef + submittingRef pattern (T-215 precedent) keeps races safe; closing while in flight bumps the token, late result.ok lands via reconcileBackgroundSuccess -> upsertTask + info toast.
  • src/features/kanban/components/TaskCreationWizard.test.tsx — 12 cases: initial render + autofocus, empty/cleared title validation, full 3-step walk, Back/Next state preservation, submission payload + upsertTask + close, empty-body -> null mapping, IPC rejection -> error + error toast + dialog stays, ESC closes, no-project disables Create + shows hint, background success reconciliation via a deferTaskCreation() deferred-promise helper.

Modified

  • src/features/kanban/components/KanbanBoard.tsx — lifts wizard state, attaches document keydown listener (n, no modifiers, target not in INPUT/TEXTAREA/SELECT/contentEditable, project selected), passes onAddTask only to Backlog column, mounts <TaskCreationWizard> inside DndContext.
  • src/features/kanban/components/KanbanColumn.tsx — optional onAddTask?: () => void prop wired to the existing Backlog + Add task button.
  • src/features/kanban/components/KanbanBoard.test.tsx — +5 cases (n opens / n-in-input no-op / Ctrl+n no-op / no-project no-op / Backlog button opens). Wizard describe placed AFTER snapshots so the dnd-kit global id counter doesn't drift the existing snapshot files.
  • src/features/kanban/components/KanbanColumn.test.tsx — +1 case asserting the Backlog button calls onAddTask.
  • src/shared/i18n/locales/{en,fr}.jsonkanban.wizard.* keys mirrored byte-identical (title, description, step_label, step_title.{label,placeholder,error_empty,error_too_long}, step_body.{label,placeholder,helper}, step_review.{label,no_project,no_body,title_label,body_label,project_label}, button.{back,next,create,cancel}, error.create_failed, toast.{create_failed_title,background_created_title}).
  • CHANGELOG.md[Unreleased] / Added entry with full implementation rationale and adversarial-review resolution log.

A11y

  • DialogTitle + DialogDescription announce on mount.
  • Added <p aria-live=\"polite\" aria-atomic=\"true\" className=\"sr-only\"> echoing the step label so screen readers announce step transitions (DialogDescription only fires on initial mount).
  • role=\"alert\" on validation/error messages (wizard-title-error, wizard-review-error — disambiguated per adversarial review).
  • aria-describedby + aria-invalid on the title input.
  • aria-busy={submitting} on the form during in-flight IPC.
  • Radix focus trap + ESC + backdrop close inherited from the shared Dialog primitive.

Test plan

  • CI: pnpm exec vitest run 272/272 pass (was 257 pre-T-219, +15 cases).
  • CI: pnpm exec oxlint . --max-warnings=0 clean.
  • CI: pnpm exec tsc -b clean.
  • CI: pnpm exec oxfmt --check . clean.
  • CI: pnpm exec knip clean.
  • Manual: cargo unaffected (no Rust changes).
  • Manual: open the app, select a project, press n -> wizard opens; type a title + body -> Create -> card appears in Backlog.
  • Manual: open wizard, click + Add task on Backlog -> wizard opens.
  • Manual: empty title + Next -> inline error visible.
  • Manual: ESC closes wizard; reopen -> form is fresh.
  • Manual: press n while typing in another <input> -> wizard does NOT open.

Adversarial review resolutions

Multi-agent code review (security / logic / clean-code+a11y+perf) flagged 13 items; 10 resolved in this PR, 1 rejected (the JSON.parse(\"null\") workaround is required — unicorn/no-null is active via oxlint's style: warn category gated by CI --max-warnings=0), 2 deferred as subjective (function naming + SubmitArgs composition vs inheritance). Full log in CHANGELOG.md.

Out of scope

  • No CodeMirror 6 editor for the body step (deferred to F-066 / F-086 per issue scope).
  • No markdown preview on body / review steps (review renders raw text only).
  • No draft persistence across dialog closes (closing wipes state by design).
  • No keyboard shortcut customisation (single hardcoded n; F-086 may revisit).

Summary by CodeRabbit

  • New Features

    • Multi-step Task Creation wizard (title → description → review) with validation.
    • Open wizard via keyboard: press "n" (only when not focused in an input); Shift+N also opens. Backlog "Add task" opens the wizard.
  • Bug Fixes

    • Submissions that complete after closing still add the new task and show a notification.
  • Tests

    • Expanded integration and unit tests covering wizard flows and keyboard behavior.
  • Documentation

    • Added English and French wizard translations.

Review Change Stack

…tcut (closes #87)

3-step modal wiring the Backlog "+ Add task" button and global `n` keydown
to `invokeTasksCreate` -> `useTaskStore.upsertTask` with submit-token race
guards, mid-flight close adoption, and per-step a11y live announcements.

Wizard: title (autofocus, inline validation, maxLength 200) -> body
(plain textarea, maxLength 65535) -> review (project/title/body summary)
-> Create. ESC + backdrop + close button reset the form; Back is disabled
during in-flight submit. Closing mid-flight reconciles a late
backend-success via upsertTask + info toast (no orphan tasks).

Global `n` listener guards INPUT/TEXTAREA/SELECT/contentEditable + modifier
keys and bails when no project is selected. KanbanColumn gains an optional
`onAddTask` prop only the Backlog phase consumes.

i18n keys mirrored en/fr under `kanban.wizard.*`. 15 new vitest cases cover
all 3 steps, validation, IPC success + rejection, ESC, no-project gate,
background-success reconciliation, the `n` shortcut paths, and the
Backlog-button wiring.
@qodo-code-review
Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 13, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a4b87e36-ad5f-467e-9bc9-abab36c7e386

📥 Commits

Reviewing files that changed from the base of the PR and between 7508d2f and b18e833.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • src/features/kanban/components/KanbanBoard.test.tsx
  • src/features/kanban/components/KanbanBoard.tsx
✅ Files skipped from review due to trivial changes (1)
  • CHANGELOG.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/features/kanban/components/KanbanBoard.test.tsx
  • src/features/kanban/components/KanbanBoard.tsx

📝 Walkthrough

Walkthrough

This PR introduces a multi-step TaskCreationWizard component for creating Kanban tasks. The wizard is opened via keyboard shortcut (n key) or Backlog button, guides users through title/body/review steps with validation and error handling, and submits task creation via IPC with proper store updates and toast notifications. KanbanBoard and KanbanColumn are extended to support this flow, with comprehensive test coverage and i18n localization.

Changes

Kanban Task Creation Wizard

Layer / File(s) Summary
TaskCreationWizard component and form logic
src/features/kanban/components/TaskCreationWizard.tsx
Implements multi-step dialog (title → body → review) with form state management, title validation, IPC-based task submission, and background completion handling. Uses token-based deduplication to reconcile concurrent submissions and ensures task upsert and toasts even if dialog closes during submission.
TaskCreationWizard test suite
src/features/kanban/components/TaskCreationWizard.test.tsx
Comprehensive test coverage for dialog rendering, step navigation with state preservation, form validation (empty/length), successful and failed submission with IPC assertion, error UI/toasts, ESC dismissal, background completion after close, and no-project-selected edge case.
KanbanBoard keyboard shortcut and wizard wiring
src/features/kanban/components/KanbanBoard.tsx
Adds n-key shortcut (when focus is not in editable target) to open wizard via useEffect-based keydown handler. Renders TaskCreationWizard alongside board and wires Backlog column's onAddTask callback to trigger wizard opening.
KanbanBoard integration tests
src/features/kanban/components/KanbanBoard.test.tsx
Tests keyboard shortcut behavior (open on n, ignore when typing, ignore Ctrl+n, respect project selection) and adds a DEMO_PROJECT fixture plus shared task/project store resets.
KanbanColumn onAddTask callback & tests
src/features/kanban/components/KanbanColumn.tsx, src/features/kanban/components/KanbanColumn.test.tsx
Updates KanbanColumnProps with optional onAddTask and wires it to Backlog add-task button onClick; adds Backlog test asserting callback invocation and updates render helper to accept the callback.
Internationalization for wizard UI
src/shared/i18n/locales/en.json, src/shared/i18n/locales/fr.json
Adds wizard-specific i18n strings for both English and French, covering wizard title, step labels, form fields, validation messages, button text, error messages, and toast notifications.
Release notes documentation
CHANGELOG.md
Updates unreleased section with comprehensive description of Sprint 2 task-creation wizard work and related improvements.

Sequence Diagram

sequenceDiagram
  participant User
  participant KanbanBoard
  participant TaskCreationWizard
  participant invokeTasksCreate as IPC_invokeTasksCreate
  participant useTaskStore
  participant useToastStore
  User->>KanbanBoard: press "n" or click Backlog "+ Add task"
  KanbanBoard->>TaskCreationWizard: open dialog (open prop)
  User->>TaskCreationWizard: enter title/body and click Create
  TaskCreationWizard->>IPC_invokeTasksCreate: send create request
  IPC_invokeTasksCreate-->>TaskCreationWizard: return result
  TaskCreationWizard->>useTaskStore: upsert created task
  TaskCreationWizard->>useToastStore: show toast (success/error/info)
  TaskCreationWizard->>KanbanBoard: close dialog (on success)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • mpiton/forgent#110: Extends the KanbanBoard/KanbanColumn components introduced in this PR by adding Backlog onAddTask wiring and keyboard-triggered TaskCreationWizard.
  • mpiton/forgent#108: Related changes to Zustand stores (useProjectStore/useTaskStore) that the wizard integration and upsert flows rely on.

Poem

🐰 I hopped to add a wizard, steps tidy and bright,
Press "n" or click Backlog to summon the light.
Title, body, review — then IPC sings,
Tasks land in the board with toasts and some bling.
A small rabbit cheer for developer delight!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title accurately and specifically describes the main feature implemented: a 3-step TaskCreationWizard with Radix Dialog and keyboard shortcut, directly matching the primary changes across KanbanBoard, KanbanColumn, and the new wizard component.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/i-87-t-219-task-creation-wizard

Comment @coderabbitai help to get the list of available commands and usage tips.

@codspeed-hq
Copy link
Copy Markdown
Contributor

codspeed-hq Bot commented May 13, 2026

Merging this PR will not alter performance

✅ 7 untouched benchmarks


Comparing feat/i-87-t-219-task-creation-wizard (b18e833) with main (86bd534)

Open in CodSpeed

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/features/kanban/components/KanbanBoard.tsx`:
- Around line 32-39: The shortcut check in shouldOpenWizard currently compares
event.key (and SHORTCUT_KEY), which fails under Caps Lock or Shift; change the
primary key check to use the physical key via event.code === "KeyN" (keep the
existing modifier checks for ctrl/meta/alt and the editable-target guard
isEditableTarget(event.target)) and remove or deprecate the
event.key/SHORTCUT_KEY comparison so the n shortcut consistently triggers
regardless of case.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6280fe74-8070-4c28-9c1a-dd495b0085eb

📥 Commits

Reviewing files that changed from the base of the PR and between 86bd534 and 7508d2f.

📒 Files selected for processing (9)
  • CHANGELOG.md
  • src/features/kanban/components/KanbanBoard.test.tsx
  • src/features/kanban/components/KanbanBoard.tsx
  • src/features/kanban/components/KanbanColumn.test.tsx
  • src/features/kanban/components/KanbanColumn.tsx
  • src/features/kanban/components/TaskCreationWizard.test.tsx
  • src/features/kanban/components/TaskCreationWizard.tsx
  • src/shared/i18n/locales/en.json
  • src/shared/i18n/locales/fr.json

Comment thread src/features/kanban/components/KanbanBoard.tsx
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7508d2f361

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/features/kanban/components/KanbanBoard.tsx Outdated
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 9 files

…iew)

CodeRabbit + Codex independently flagged `event.key !== "n"` as missing
the Caps-Lock-on (`"N"`) and Shift-held (`"N"`) cases. Compare against
`event.key.toLowerCase()` so the shortcut keeps firing.

`toLowerCase()` preferred over `event.code === "KeyN"` to stay correct
under non-QWERTY layouts (Dvorak / AZERTY users typing `n` still emit
`event.key === "n"` regardless of physical position).

Regression test pins the uppercase-N path; existing Ctrl+n no-op test
stays green because the modifier check runs after the key check.
@mpiton mpiton merged commit 21d3920 into main May 13, 2026
14 checks passed
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.

T-219: TaskCreationWizard — 3-step Radix Dialog modal v1

1 participant