Skip to content

Fixed event handler on click - #159

Merged
MaxDac merged 1 commit into
mainfrom
maxdac/fixes
Sep 18, 2025
Merged

MaxDac merged 1 commit into
mainfrom
maxdac/fixes

Conversation

@MaxDac

@MaxDac MaxDac commented Sep 18, 2025

Copy link
Copy Markdown
Owner

This pull request updates the selection logic for session name copy buttons to ensure only buttons with both data-session-name and data-action attributes are targeted. This change is reflected in both the implementation and all related tests to improve specificity and prevent unintended element selection.

Button selection logic update:

  • Updated the getCopyButtons function in clipboard.mjs to select buttons with both data-session-name and data-action attributes, improving selector specificity.

Test updates for selector consistency:

  • Modified all test cases in clipboard.test.mjs to use the updated selector [data-session-name][data-action] when querying for buttons, ensuring tests match the new implementation. [1] [2] [3] [4] [5] [6]
  • Updated test HTML setup to include the data-action attribute on button elements, reflecting the new requirements for copy button identification.

@MaxDac
MaxDac requested a review from Copilot September 18, 2025 17:10
@MaxDac
MaxDac enabled auto-merge (squash) September 18, 2025 17:10

Copilot AI left a comment

Copy link
Copy Markdown

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 improves the specificity of button selection for session name copy functionality by requiring buttons to have both data-session-name and data-action attributes. This prevents unintended element selection and ensures only the correct buttons are targeted for clipboard operations.

  • Updated selector in getCopyButtons function to target elements with both required attributes
  • Synchronized all test cases to use the new selector pattern
  • Updated test HTML setup to include the data-action attribute

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
apps/privee_web/assets/js/utils/clipboard.mjs Updated getCopyButtons function to use more specific selector requiring both data attributes
apps/privee_web/assets/js/tests/clipboard.test.mjs Updated all test selectors and HTML setup to match the new implementation requirements

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@MaxDac MaxDac closed this Sep 18, 2025
auto-merge was automatically disabled September 18, 2025 17:15

Pull request was closed

@MaxDac MaxDac reopened this Sep 18, 2025
@MaxDac
MaxDac enabled auto-merge (squash) September 18, 2025 17:15
@MaxDac
MaxDac merged commit 1dfc171 into main Sep 18, 2025
3 checks passed
@MaxDac
MaxDac deleted the maxdac/fixes branch September 18, 2025 17:18
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.

2 participants