Skip to content

feat: enhance scenario card interaction with expand/collapse and dele…#3

Merged
pikann merged 3 commits into
masterfrom
feature/enhance-scenario-card-ui
May 12, 2026
Merged

feat: enhance scenario card interaction with expand/collapse and dele…#3
pikann merged 3 commits into
masterfrom
feature/enhance-scenario-card-ui

Conversation

@pikann
Copy link
Copy Markdown
Contributor

@pikann pikann commented May 12, 2026

…te confirmation
This pull request improves the user interaction experience in the ScenarioCard component by refining how click events are handled. The main focus is to prevent unintended toggling of the scenario expansion when interacting with child elements (such as buttons and editable fields) and to ensure a smoother, more intuitive UI.

Improvements to click event handling and UI behavior:

  • Made the entire header row (div.group/scenario) clickable to toggle scenario expansion, except when interacting with specific child elements, by adding a cursor-pointer class and moving the expansion logic to the header's onClick handler.
  • Updated child elements (expand/collapse button, editable title input, and delete button) to call e.stopPropagation() in their onClick handlers, preventing their clicks from bubbling up and unintentionally toggling the scenario expansion. [1] [2] [3] [4]
  • Adjusted the delete button styling to remove the opacity transition and slightly changed the hover background color for better visual feedback.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 updates the ScenarioCard interaction model in the BDD scenarios UI to make expanding/collapsing feel more intuitive by moving toggle behavior to the header row and preventing click bubbling from interactive child elements.

Changes:

  • Made the entire scenario header row clickable to toggle expand/collapse.
  • Added stopPropagation() to child controls (expand button, title editor, delete) to prevent accidental toggles.
  • Adjusted delete button hover styling.
Comments suppressed due to low confidence (1)

frontend/src/BDDScenariosSection.tsx:200

  • When canEdit is false, the title is rendered as a disabled <button>. Clicks on disabled form controls don’t dispatch click events, so clicking the title area likely won’t bubble to the header onClick, which undermines the “entire header is clickable” behavior in read-only mode. Consider rendering a non-disabled element when !canEdit (or avoid disabled and use aria-disabled/styling) so clicks can toggle expansion.
					<button
						type="button"
						disabled={!canEdit}
						className={cn(
							"flex-1 text-left text-[13px] font-semibold text-foreground truncate",
							canEdit && "hover:cursor-text",
						)}
						onClick={(e) => {
							e.stopPropagation();
							if (!canEdit) return;
							setExpanded(true);
							setEditTitle(true);
						}}

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread frontend/src/BDDScenariosSection.tsx
Comment thread frontend/src/BDDScenariosSection.tsx
Comment thread frontend/src/BDDScenariosSection.tsx Outdated
Comment thread frontend/src/BDDScenariosSection.tsx
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI commented May 12, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • accounts.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=6536 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/com.google.Chrome.scoped_dir.5B4VAe --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,16698061325989371189,4447507212312814774,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,6163194551734051156,4063949454349743534,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome --headless --disable-gpu --no-sandbox --window-size=1200,700 --screenshot=/tmp/paca-ui-feedback-screenshot.png file:///tmp/paca-ui-feedback-screenshot.html ux_amd64/vet ame (dns block)
  • clients2.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=6536 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/com.google.Chrome.scoped_dir.5B4VAe --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,16698061325989371189,4447507212312814774,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,6163194551734051156,4063949454349743534,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome --headless --disable-gpu --no-sandbox --window-size=1200,700 --screenshot=/tmp/paca-ui-feedback-screenshot.png file:///tmp/paca-ui-feedback-screenshot.html ux_amd64/vet ame (dns block)
  • clientservices.googleapis.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=6536 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/com.google.Chrome.scoped_dir.5B4VAe --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,16698061325989371189,4447507212312814774,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,6163194551734051156,4063949454349743534,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome --headless --disable-gpu --no-sandbox --window-size=1200,700 --screenshot=/tmp/paca-ui-feedback-screenshot.png file:///tmp/paca-ui-feedback-screenshot.html ux_amd64/vet ame (dns block)
  • redirector.gvt1.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=6536 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/com.google.Chrome.scoped_dir.5B4VAe --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,16698061325989371189,4447507212312814774,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,6163194551734051156,4063949454349743534,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome --headless --disable-gpu --no-sandbox --window-size=1200,700 --screenshot=/tmp/paca-ui-feedback-screenshot.png file:///tmp/paca-ui-feedback-screenshot.html ux_amd64/vet ame (dns block)
  • safebrowsingohttpgateway.googleapis.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=6536 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/com.google.Chrome.scoped_dir.5B4VAe --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,16698061325989371189,4447507212312814774,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,6163194551734051156,4063949454349743534,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome --headless --disable-gpu --no-sandbox --window-size=1200,700 --screenshot=/tmp/paca-ui-feedback-screenshot.png file:///tmp/paca-ui-feedback-screenshot.html ux_amd64/vet ame (dns block)
  • www.google.com
    • Triggering command: /proc/self/exe /proc/self/exe --type=utility --utility-sub-type=network.mojom.NetworkService --lang=en-US --service-sandbox-type=none --no-sandbox --use-angle=swiftshader-webgl --crashpad-handler-pid=6536 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/com.google.Chrome.scoped_dir.5B4VAe --change-stack-guard-on-fork=enable --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,16698061325989371189,4447507212312814774,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,6163194551734051156,4063949454349743534,4 --trace-process-track-uuid=3190708989122997041 (dns block)
    • Triggering command: /opt/google/chrome/chrome /usr/bin/google-chrome --headless --disable-gpu --no-sandbox --window-size=1200,700 --screenshot=/tmp/paca-ui-feedback-screenshot.png file:///tmp/paca-ui-feedback-screenshot.html ux_amd64/vet ame (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot finished work on behalf of pikann May 12, 2026 07:40
@pikann pikann force-pushed the feature/enhance-scenario-card-ui branch from 0610d2e to 6202e86 Compare May 12, 2026 07:46
@pikann pikann merged commit c9b1edc into master May 12, 2026
1 check passed
@pikann pikann deleted the feature/enhance-scenario-card-ui branch May 12, 2026 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants