Skip to content

feat(work-items): replace direction toggle with sentence builder dependency UX#137

Merged
steilerDev merged 3 commits into
betafrom
feat/dependency-sentence-builder
Feb 19, 2026
Merged

feat(work-items): replace direction toggle with sentence builder dependency UX#137
steilerDev merged 3 commits into
betafrom
feat/dependency-sentence-builder

Conversation

@steilerDev
Copy link
Copy Markdown
Owner

Summary

  • Replaces the segmented direction toggle ("This item depends on" / "This item blocks") + dependency type dropdown with a natural-language sentence builder: [Picker] must [finish▾] before [Picker] can [start▾]
  • Introduces DependencySentenceBuilder and DependencySentenceDisplay as a new reusable component family under client/src/components/DependencySentenceBuilder/
  • Extends WorkItemPicker with specialOptions (e.g. "This item" with italic styling) and showItemsOnFocus props — fully backward compatible
  • Refactors both WorkItemDetailPage and WorkItemCreatePage to use the new sentence builder; removes all direction toggle and type dropdown code
  • The THIS_ITEM_ID sentinel allows the create-page builder to represent the not-yet-created item before submission, then replaces it with the real ID when making API calls

Changes

New files

  • client/src/components/DependencySentenceBuilder/dependencyVerbs.ts — pure verb↔DependencyType mapping utilities + THIS_ITEM_ID sentinel
  • client/src/components/DependencySentenceBuilder/DependencySentenceBuilder.tsx + .module.css — interactive sentence builder UI
  • client/src/components/DependencySentenceBuilder/DependencySentenceDisplay.tsx + .module.css — groups existing dependencies into readable sentence groups
  • client/src/components/DependencySentenceBuilder/index.ts — barrel export

Modified files

  • client/src/components/WorkItemPicker/WorkItemPicker.tsx — adds specialOptions + showItemsOnFocus props; selectedTitleSpecial italic styling for sentinel display
  • client/src/components/WorkItemPicker/WorkItemPicker.module.css.specialOption, .optionsDivider, .selectedTitleSpecial styles
  • client/src/pages/WorkItemDetailPage/WorkItemDetailPage.tsx — dependency section replaced; delete confirmation modal for single dependency; handleAddDependency takes { predecessorId, successorId, dependencyType }
  • client/src/pages/WorkItemDetailPage/WorkItemDetailPage.module.css — old direction toggle and dependency select styles removed; .addDependencySection added
  • client/src/pages/WorkItemDetailPage/WorkItemDetailPage.test.tsx — 3 trivial label fixes (title selector, empty state text, group header text) caused by new UI
  • client/src/pages/WorkItemCreatePage/WorkItemCreatePage.tsx — PendingDependency interface updated; pending chips show natural-language sentences
  • client/src/pages/WorkItemCreatePage/WorkItemCreatePage.module.css — removed old toggle/type/chip styles; added .chipSentence

Test plan

  • All 1072 existing tests pass (npm test -- --maxWorkers=2)
  • npm run lint — 0 errors
  • npm run format:check — all clean
  • npm run typecheck — all workspaces clean
  • Manual: Open work item detail → dependencies section shows sentence groups; builder slots work; "This item" appears as special option in italic
  • Manual: Create work item → dependency builder prefills slot 2 with "This item"; pending list shows sentence format
  • Manual: Mobile breakpoint — sentence builder stacks vertically

🤖 Generated with Claude Code

…ndency UX

Replace the segmented direction toggle + type dropdown with a natural-language
"sentence builder" approach: [Picker] must [finish▾] before [Picker] can [start▾].

New components:
- DependencySentenceBuilder/dependencyVerbs.ts — verb↔DependencyType mapping + THIS_ITEM_ID sentinel
- DependencySentenceBuilder.tsx — sentence builder UI with two WorkItemPickers + verb selects
- DependencySentenceDisplay.tsx — groups existing deps by type/direction into readable sentences
- DependencySentenceBuilder/index.ts — barrel export

WorkItemPicker extended with:
- specialOptions prop — renders "This item" at top of dropdown with italic styling
- showItemsOnFocus prop — opens dropdown with initial results on focus without typing

WorkItemDetailPage/WorkItemCreatePage refactored to use sentence builder.
WorkItemDetailPage.test.tsx updated for new dependency display (3 trivial label fixes).

All 1072 tests pass. Lint and format clean. TypeScript strict mode clean.

Co-Authored-By: Claude frontend-developer (Sonnet 4.5) <noreply@anthropic.com>
Co-Authored-By: Claude frontend-developer (Sonnet 4.5) <noreply@anthropic.com>
…ents

Add 70 new tests covering the sentence-builder dependency UX redesign:

- dependencyVerbs.test.ts: 13 unit tests for verbsToDependencyType and
  dependencyTypeToVerbs including all 4 combinations and round-trip
  verification
- DependencySentenceDisplay.test.tsx: 21 component tests covering empty
  state, all 4 dependency type group headers, predecessor/successor
  grouping, delete callbacks, mixed display, and custom thisItemLabel
- DependencySentenceBuilder.test.tsx: 17 integration tests for the
  interactive form — default state, verb selects, onAdd callback,
  form reset, "This item" mutual exclusion, disabled state
- WorkItemPicker.test.tsx: 13 component tests for new specialOptions
  and showItemsOnFocus props, plus backward compatibility, divider
  rendering, excludeIds filtering, and error handling
- WorkItemDetailPage.test.tsx: extended with 4 new dependency section
  tests verifying sentence builder is rendered and old direction toggle
  is absent
- WorkItemCreatePage.test.tsx: extended with 3 new dependency section
  tests including pending dependency sentence format verification

Total test count: 1142 (up from 1072)

Co-Authored-By: Claude qa-integration-tester (Sonnet 4.5) <noreply@anthropic.com>
@steilerDev steilerDev merged commit 9686fa6 into beta Feb 19, 2026
4 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.8.0-beta.27 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@steilerDev steilerDev deleted the feat/dependency-sentence-builder branch February 19, 2026 20:39
@github-actions
Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.8.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants