Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions frontend/src/BDDScenariosSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,18 @@ function ScenarioCard({
className="rounded-xl border border-border/25 bg-card/50 overflow-hidden"
>
{/* Header row */}
<div className="flex items-center gap-2 px-4 py-3 group/scenario">
<div
className="flex items-center gap-2 px-4 py-3 cursor-pointer"
onClick={() => setExpanded((x) => !x)}
Comment thread
pikann marked this conversation as resolved.
>
Comment thread
pikann marked this conversation as resolved.
{/* Expand/collapse button */}
<button
type="button"
className="shrink-0 p-0 text-muted-foreground/70 cursor-pointer"
onClick={() => setExpanded((x) => !x)}
onClick={(e) => {
e.stopPropagation();
setExpanded((x) => !x);
}}
aria-expanded={expanded}
aria-label={expanded ? "Collapse scenario" : "Expand scenario"}
>
Expand Down Expand Up @@ -175,6 +181,7 @@ function ScenarioCard({
e.currentTarget.blur();
}
}}
onClick={(e) => e.stopPropagation()}
className="flex-1 bg-transparent text-[13px] font-semibold text-foreground outline-none"
/>
) : (
Expand All @@ -185,7 +192,8 @@ function ScenarioCard({
"flex-1 text-left text-[13px] font-semibold text-foreground truncate",
canEdit && "hover:cursor-text",
)}
onClick={() => {
onClick={(e) => {
e.stopPropagation();
if (!canEdit) return;
setExpanded(true);
setEditTitle(true);
Expand All @@ -202,9 +210,12 @@ function ScenarioCard({
{canEdit && (
<button
type="button"
onClick={() => deleteMut.mutate()}
onClick={(e) => {
e.stopPropagation();
deleteMut.mutate();
}}
disabled={deleteMut.isPending}
className="opacity-0 group-hover/scenario:opacity-100 ml-1 shrink-0 rounded-md p-1 text-muted-foreground/50 hover:text-destructive hover:bg-destructive/10 transition-all duration-150"
className="ml-1 shrink-0 rounded-md p-1 text-muted-foreground/50 hover:text-destructive hover:bg-destructive/5 transition-all duration-150"
aria-label="Delete scenario"
>
<Trash2 className="size-3.5" />
Expand Down
2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "com.paca.bdd",
"displayName": "BDD Scenarios",
"description": "Adds Given/When/Then BDD acceptance criteria to tasks.",
"version": "0.2.0",
"version": "0.2.2",
"permissions": ["db.read", "db.write", "events.subscribe"],
"backend": {
"eventSubscriptions": ["task.deleted"],
Expand Down
Loading