Skip to content

refactor: update handler, router, service, components, drafts for API…#120

Merged
nazarli-shabnam merged 5 commits into
mainfrom
77-fix-create-new-draft-details-drop-down
Jun 14, 2026
Merged

refactor: update handler, router, service, components, drafts for API…#120
nazarli-shabnam merged 5 commits into
mainfrom
77-fix-create-new-draft-details-drop-down

Conversation

@Rafetikus

Copy link
Copy Markdown
Member

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

  • Projects now automatically receive a set of default workflow states (mirroring Plane's defaults) when created, if none exist. This is handled in the StateService and invoked during project creation. [1] [2] [3] [4]

Frontend: Improved State Handling and Dropdown UX

  • The work item creation modal and draft issue properties now use enhanced logic for displaying and selecting state options, including Plane-style grouping and labels, and improved handling when no states are available. [1] [2] [3] [4]
  • The Dropdown component supports a new allowDismissInsideDialog prop, 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

  • The work item creation modal now conditionally shows modules and cycles dropdowns based on project settings, and resets their values when hidden. [1] [2] [3] [4] [5]
  • Minor bug fixes and UI tweaks, such as ensuring state names default to an empty string if not found, and always passing stateId in the creation payload.

Code Organization

  • Refactored draft state option logic into a new utility module (draftStateOptions), improving code reuse and maintainability. [1] [2]

User Experience

@Rafetikus Rafetikus added this to the Deadline milestone Jun 9, 2026
@Rafetikus Rafetikus self-assigned this Jun 9, 2026
Copilot AI review requested due to automatic review settings June 9, 2026 18:48
@Rafetikus Rafetikus added the bug Something isn't working label Jun 9, 2026
@Rafetikus Rafetikus linked an issue Jun 9, 2026 that may be closed by this pull request

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 Dropdown with allowDismissInsideDialog to 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.

Comment thread api/internal/service/state.go Outdated
Comment thread api/internal/handler/project.go
Comment thread api/internal/service/state.go
Comment thread api/internal/service/state.go Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Comment thread api/internal/handler/project.go

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Comment thread ui/src/components/drafts/draftStateOptions.ts
Comment thread api/internal/service/state.go
@Rafetikus Rafetikus requested a review from nazarli-shabnam June 9, 2026 19:34
@martian56

Copy link
Copy Markdown
Member

@codex review

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

Copy link
Copy Markdown

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: 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".

Comment thread api/internal/store/state.go
Comment thread ui/src/components/CreateWorkItemModal.tsx Outdated

@nazarli-shabnam nazarli-shabnam left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

well done lil one

@martian56

Copy link
Copy Markdown
Member

@Rafetikus Have you tested, and confirm it works? can you share some screenshots?

@nazarli-shabnam nazarli-shabnam merged commit bb50c1b into main Jun 14, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix: Create new draft details drop down

4 participants