fix: functional labels picker in new issue dialog + popover click fix#1936
fix: functional labels picker in new issue dialog + popover click fix#1936apsisvictor-sys wants to merge 1 commit intopaperclipai:masterfrom
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Greptile SummaryThis PR replaces the placeholder "Labels" button in the new-issue dialog with a fully functional labels picker (search, multi-select, colour chips, Confidence Score: 4/5Two P1 bugs in NewIssueDialog.tsx (stale label state on re-open and broken empty-state UX) should be fixed before merging. The IssueProperties.tsx change is safe. The NewIssueDialog.tsx change has two concrete defects: selected labels persist across dialog sessions (wrong data submitted), and the search empty-state message never surfaces when no results match (broken UX on the new code path). Both are straightforward fixes. ui/src/components/NewIssueDialog.tsx — label reset on dialog open (line ~519) and empty-state condition (line 1444). Important Files Changed
|
| {(labels ?? []).length === 0 && ( | ||
| <p className="px-2 py-2 text-xs text-muted-foreground">No labels defined.</p> | ||
| )} |
There was a problem hiding this comment.
Empty-state message never shows when search has no matches
The empty-state check (labels ?? []).length === 0 tests whether the unfiltered label list is empty. When the user types a search term that matches no labels, the filtered .map(...) above renders nothing — but this condition is still false (e.g. there are 5 labels, just none matching the search), so the user sees a completely blank dropdown with no feedback.
The guard should compare against the filtered list:
| {(labels ?? []).length === 0 && ( | |
| <p className="px-2 py-2 text-xs text-muted-foreground">No labels defined.</p> | |
| )} | |
| {(labels ?? []) | |
| .filter((l) => !labelSearch.trim() || l.name.toLowerCase().includes(labelSearch.toLowerCase())) | |
| .length === 0 && ( | |
| <p className="px-2 py-2 text-xs text-muted-foreground"> | |
| {labelSearch.trim() ? "No labels found." : "No labels defined."} | |
| </p> | |
| )} |
Prompt To Fix With AI
This is a comment left during a code review.
Path: ui/src/components/NewIssueDialog.tsx
Line: 1444-1446
Comment:
**Empty-state message never shows when search has no matches**
The empty-state check `(labels ?? []).length === 0` tests whether the *unfiltered* label list is empty. When the user types a search term that matches no labels, the filtered `.map(...)` above renders nothing — but this condition is still false (e.g. there are 5 labels, just none matching the search), so the user sees a completely blank dropdown with no feedback.
The guard should compare against the *filtered* list:
```suggestion
{(labels ?? [])
.filter((l) => !labelSearch.trim() || l.name.toLowerCase().includes(labelSearch.toLowerCase()))
.length === 0 && (
<p className="px-2 py-2 text-xs text-muted-foreground">
{labelSearch.trim() ? "No labels found." : "No labels defined."}
</p>
)}
```
How can I resolve this? If you propose a fix, please make it concise.
Summary
New issue dialog: labels picker — Replaces the placeholder "Labels" button with a fully functional label selector. Users can now search labels, toggle multi-select, and see selected labels with their color indicators directly on the issue creation form. Selected label IDs are included in the create issue payload via
labelIds.IssueProperties popover click fix — The
PropertyPickerpopover trigger button was missing an explicitonClickhandler, relying solely on Radix'sasChildprop merging. This caused the popover to not toggle reliably in some cases. Added explicitonClick={() => onOpenChange(!open)}to the trigger button.Test plan
labelIdsis sent in the request payload🤖 Generated with Claude Code