mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-23 17:33:51 +02:00
Put mobile issue priority in overflow menu
This commit is contained in:
1 parent
696e85e83d
commit
a093f7bc8f
2 files changed
+58
-4
No files matched your search
@@ -752,6 +752,28 @@ describe("NewIssueDialog", () => {
|
||||
act(() => root.unmount());
|
||||
});
|
||||
|
||||
it("keeps priority under the mobile overflow menu", async () => {
|
||||
const { root } = renderDialog(container);
|
||||
await flush();
|
||||
|
||||
const priorityChip = container.querySelector('[data-testid="new-issue-priority-chip"]');
|
||||
expect(priorityChip?.className).toContain("hidden");
|
||||
expect(priorityChip?.className).toContain("sm:inline-flex");
|
||||
|
||||
const highPriorityOption = container.querySelector('[data-testid="new-issue-more-priority-high"]');
|
||||
expect(highPriorityOption?.textContent).toContain("High");
|
||||
|
||||
await act(async () => {
|
||||
highPriorityOption?.dispatchEvent(new MouseEvent("click", { bubbles: true }));
|
||||
});
|
||||
await flush();
|
||||
|
||||
const selectedHighPriorityOption = container.querySelector('[data-testid="new-issue-more-priority-high"]');
|
||||
expect(selectedHighPriorityOption?.className).toContain("bg-accent");
|
||||
|
||||
act(() => root.unmount());
|
||||
});
|
||||
|
||||
it("allows editor autocomplete portal pointer events inside the modal", async () => {
|
||||
const { root } = renderDialog(container);
|
||||
await flush();
|
||||
|
||||
@@ -1870,7 +1870,11 @@ export function NewIssueDialog() {
|
||||
{/* Priority chip */}
|
||||
<Popover open={priorityOpen} onOpenChange={setPriorityOpen}>
|
||||
<PopoverTrigger asChild>
|
||||
<button className="inline-flex items-center gap-1.5 rounded-md border border-border px-2 py-1 text-xs hover:bg-accent/50 transition-colors">
|
||||
<button
|
||||
type="button"
|
||||
data-testid="new-issue-priority-chip"
|
||||
className="hidden items-center gap-1.5 rounded-md border border-border px-2 py-1 text-xs transition-colors hover:bg-accent/50 sm:inline-flex"
|
||||
>
|
||||
{currentPriority ? (
|
||||
<>
|
||||
<currentPriority.icon className={cn("h-3 w-3", currentPriority.color)} />
|
||||
@@ -1966,14 +1970,42 @@ export function NewIssueDialog() {
|
||||
</PopoverContent>
|
||||
</Popover>
|
||||
|
||||
{/* More (dates) */}
|
||||
{/* More */}
|
||||
<Popover open={moreOpen} onOpenChange={setMoreOpen}>
|
||||
<PopoverTrigger asChild>
|
||||
<button className="inline-flex items-center justify-center rounded-md border border-border p-1 text-xs hover:bg-accent/50 transition-colors text-muted-foreground">
|
||||
<button
|
||||
type="button"
|
||||
data-testid="new-issue-more-menu-trigger"
|
||||
className="inline-flex items-center justify-center rounded-md border border-border p-1 text-xs text-muted-foreground transition-colors hover:bg-accent/50"
|
||||
>
|
||||
<MoreHorizontal className="h-3 w-3" />
|
||||
</button>
|
||||
</PopoverTrigger>
|
||||
<PopoverContent className="w-44 p-1" align="start">
|
||||
<PopoverContent className="w-44 p-1" align="start" data-testid="new-issue-more-menu">
|
||||
<div className="sm:hidden">
|
||||
<div className="px-2 py-1 text-[10px] font-medium uppercase text-muted-foreground">
|
||||
Priority
|
||||
</div>
|
||||
{priorities.map((p) => (
|
||||
<button
|
||||
type="button"
|
||||
key={p.value}
|
||||
data-testid={`new-issue-more-priority-${p.value}`}
|
||||
className={cn(
|
||||
"flex w-full items-center gap-2 rounded px-2 py-1.5 text-xs hover:bg-accent/50",
|
||||
p.value === priority && "bg-accent",
|
||||
)}
|
||||
onClick={() => {
|
||||
setPriority(p.value);
|
||||
setMoreOpen(false);
|
||||
}}
|
||||
>
|
||||
<p.icon className={cn("h-3 w-3", p.color)} />
|
||||
{p.label}
|
||||
</button>
|
||||
))}
|
||||
<div className="my-1 border-t border-border" />
|
||||
</div>
|
||||
<button className="flex items-center gap-2 w-full px-2 py-1.5 text-xs rounded hover:bg-accent/50 text-muted-foreground">
|
||||
<Calendar className="h-3 w-3" />
|
||||
Start date
|
||||
|
||||
Reference in new issue
Block a user