feat: enhance scenario card interaction with expand/collapse and dele…#3
Merged
Conversation
Contributor
There was a problem hiding this comment.
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
canEditis false, the title is rendered as adisabled<button>. Clicks on disabled form controls don’t dispatch click events, so clicking the title area likely won’t bubble to the headeronClick, which undermines the “entire header is clickable” behavior in read-only mode. Consider rendering a non-disabled element when!canEdit(or avoiddisabledand usearia-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.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Contributor
|
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:
If you need me to access, download, or install something from one of these locations, you can either:
|
0610d2e to
6202e86
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…te confirmation
This pull request improves the user interaction experience in the
ScenarioCardcomponent 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:
div.group/scenario) clickable to toggle scenario expansion, except when interacting with specific child elements, by adding acursor-pointerclass and moving the expansion logic to the header'sonClickhandler.e.stopPropagation()in theironClickhandlers, preventing their clicks from bubbling up and unintentionally toggling the scenario expansion. [1] [2] [3] [4]