3.7 KiB
3.7 KiB
id, title, status, wave, depends_on, plan, spec
| id | title | status | wave | depends_on | plan | spec |
|---|---|---|---|---|---|---|
| 01-correct-trigger-lifecycle | Correct entity-reference trigger lifecycle | completed | 1 | plan.md | ../../specs/ui/requirements/entity-reference-composer.md |
Task 01: Correct Entity-Reference Trigger Lifecycle
Acceptance
- Direct user entry of a valid
#opens the menu. Paste, drop, restored drafts, history recall, and programmatic updates do not open it. - Escape and popup outside-close exit the TipTap suggestion state. Continued input in the dismissed range does not reopen the menu.
- A bare
#followed by space becomes literal. Multi-word queries and Enter or Tab selection remain unchanged.
Verification
- If dependencies are absent, run
cd apps && pnpm install --frozen-lockfile. - RED: Run
cd apps/web && pnpm e2e:run tests/chat/entity-reference-composer.spec.ts -- --grep "pasted hash text" --retries=0before production changes. - Unit: Run
cd apps && pnpm --filter @kandev/web test -- components/task/chat/tiptap-suggestion.test.ts components/task/chat/use-entity-reference-composer.test.ts components/task/chat/use-tiptap-editor.test.ts. - Type check: Run
cd apps/web && pnpm run typecheck. - Desktop GREEN: Run
cd apps/web && pnpm e2e:run tests/chat/entity-reference-composer.spec.ts -- --grep "pasted hash text|dismissed entity reference" --retries=0. - Mobile regression: Run
cd apps/web && pnpm e2e:run --project mobile-chrome tests/chat/mobile-entity-reference-composer.spec.ts -- --retries=0. - Repository check: Run
git diff --checkfrom the repository root.
Verify that Playwright discovers the expected tests before you use either browser command as evidence. The managed runner builds and removes its isolated processes.
Files likely touched
apps/web/components/task/chat/tiptap-entity-reference-suggestion.tsapps/web/components/task/chat/use-entity-reference-composer.tsapps/web/components/task/chat/tiptap-input.tsxapps/web/components/task/chat/use-tiptap-editor.tsapps/web/components/task/chat/tiptap-suggestion.test.tsapps/web/components/task/chat/use-entity-reference-composer.test.tsapps/web/components/task/chat/use-tiptap-editor.test.tsapps/web/e2e/tests/chat/entity-reference-composer.spec.ts
Dependencies
None.
Parallelism
Sequential. The input gate, dismissal state, and browser regression form one TDD slice.
Inputs
- Behavioral contract:
docs/specs/ui/requirements/entity-reference-composer.md. - Root-cause trace and frontend design:
plan.md. - TipTap lifecycle code:
apps/web/components/task/chat/tiptap-entity-reference-suggestion.ts. - Editor input path:
apps/web/components/task/chat/use-tiptap-editor.ts. - Existing browser coverage:
apps/web/e2e/tests/chat/entity-reference-composer.spec.ts. - Mobile regression:
apps/web/e2e/tests/chat/mobile-entity-reference-composer.spec.ts.
Output contract
Report the RED result, implementation summary, changed files, exact test results, cleanup evidence, blockers, and risks. Update this task and plan.md.
Results
- RED unit run: the new input-gate assertions failed because the gate and suggestion-plugin exit path were not implemented yet.
- Unit: 41 tests passed across the three focused TipTap test files.
- Type check:
pnpm run typecheckpassed. - Lint:
pnpm run lintpassed with zero warnings. - Internationalization:
pnpm run i18n:checkpassed. - Desktop E2E: the pasted-hash and dismissed-menu regression passed.
- Mobile E2E: the existing entity-reference composer test passed.
- PR fixup: direct Backspace/Delete edits keep the active menu open, and a
direct
#before existing text remains eligible for a suggestion. - Repository check:
git diff --checkpassed.