refactor: update handler, router, service, components, drafts for API…#120
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds backend seeding of Plane-style default workflow states for projects that have none, and improves frontend state dropdown behavior in draft editing and work item creation (especially inside modal dialogs).
Changes:
- Backend: seed default workflow states for projects with no states (triggered via state listing and during project creation).
- Frontend: refactor draft state option building into a shared utility and improve state selection UX (including disabled/unavailable state options).
- UI components: extend the shared
DropdownwithallowDismissInsideDialogto improve modal dropdown dismissal behavior.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| ui/src/components/work-item/Dropdown.tsx | Adds allowDismissInsideDialog to control outside-click dismissal behavior inside dialogs. |
| ui/src/components/drafts/draftStateOptions.ts | New utility for building Plane-style grouped draft state options. |
| ui/src/components/drafts/DraftIssueRowProperties.tsx | Uses shared draft state option builder; disables unavailable state options. |
| ui/src/components/CreateWorkItemModal.tsx | Improves state dropdown empty handling; conditionally shows modules/cycles; uses new dropdown dismissal behavior. |
| api/internal/service/state.go | Adds default state seeding and invokes it during state listing. |
| api/internal/router/router.go | Wires StateService into ProjectHandler for seeding on project creation. |
| api/internal/handler/project.go | Calls state seeding after project creation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8deb4ada2e
ℹ️ 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".
|
@Rafetikus Have you tested, and confirm it works? can you share some screenshots? |
This pull request introduces improvements to both backend and frontend logic for project states, ensuring that default workflow states are automatically seeded for new projects and enhancing the UI/UX for state selection in work item creation and draft editing. The backend now guarantees Plane-style default states for new projects, while the frontend offers better handling of state options and dropdowns, especially in modal dialogs.
Backend: Automatic Default State Seeding
StateServiceand invoked during project creation. [1] [2] [3] [4]Frontend: Improved State Handling and Dropdown UX
Dropdowncomponent supports a newallowDismissInsideDialogprop, allowing dropdowns to close even when clicking inside dialogs, which improves modal usability. This prop is now used in several dropdowns throughout the work item creation modal. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]UI Logic and Bug Fixes
stateIdin the creation payload.Code Organization
draftStateOptions), improving code reuse and maintainability. [1] [2]User Experience
closes Fix: Create new draft details drop down #77