Skip to content

Conversation

mtrezza
Copy link
Member

@mtrezza mtrezza commented Jul 7, 2025

Summary

  • show copy icon in info panel values
  • allow copying of KeyValueElement values

Testing

  • npm test (fails: jest not found)
  • npm run lint (fails: cannot find module 'eslint/config')

https://chatgpt.com/codex/tasks/task_e_686ba5f9d250832dab77f9cd8c029c44

Summary by CodeRabbit

  • New Features

    • Added a copy-to-clipboard icon to key-value items, allowing users to easily copy values with one click.
    • Display of a notification message when a value is copied (if enabled).
  • Style

    • Improved alignment and hover effects for key-value items, including showing the copy icon only on hover for a cleaner interface.

Copy link

parse-github-assistant bot commented Jul 7, 2025

🚀 Thanks for opening this pull request!

Copy link

coderabbitai bot commented Jul 7, 2025

📝 Walkthrough

Walkthrough

The changes modify the AggregationPanel component to pass a new showNote prop to the KeyValueElement. The KeyValueElement is updated to include a copy-to-clipboard icon that appears on hover, enabling users to copy the value. Styles are added for vertical alignment and icon visibility on hover, and a copy handler triggers an optional notification callback.

Changes

File(s) Change Summary
src/components/AggregationPanel/AggregationPanel.js Passes showNote prop to KeyValueElement and refactors JSX syntax for multi-line clarity.
src/components/AggregationPanel/AggregationPanel.scss Adds .keyValue flex alignment and .copyIcon styles that show the icon on hover.
src/components/AggregationPanel/AggregationPanelComponents.js Converts KeyValueElement to include copy-to-clipboard handler, copy icon, and support for showNote callback.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant AggregationPanel
    participant KeyValueElement
    participant Clipboard
    participant Notification

    User->>AggregationPanel: Hover over key-value item
    AggregationPanel->>KeyValueElement: Render with showNote prop
    User->>KeyValueElement: Click copy icon
    KeyValueElement->>Clipboard: Copy item.value
    Clipboard-->>KeyValueElement: Success
    KeyValueElement->>Notification: Call showNote("Copied to clipboard")
Loading

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

npm error code ERR_SSL_WRONG_VERSION_NUMBER
npm error errno ERR_SSL_WRONG_VERSION_NUMBER
npm error request to https://10.0.0.28:4873/npm/-/npm-10.9.2.tgz failed, reason: C0CC49EDB07F0000:error:0A00010B:SSL routines:ssl3_get_record:wrong version number:../deps/openssl/openssl/ssl/record/ssl3_record.c:354:
npm error
npm error A complete log of this run can be found in: /.npm/_logs/2025-07-07T11_15_04_037Z-debug-0.log


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7ef219b and 5973575.

📒 Files selected for processing (2)
  • src/components/AggregationPanel/AggregationPanel.scss (1 hunks)
  • src/components/AggregationPanel/AggregationPanelComponents.js (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/components/AggregationPanel/AggregationPanel.scss
  • src/components/AggregationPanel/AggregationPanelComponents.js
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Docker linux/amd64

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai auto-generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

The label codex cannot be used here.

@parseplatformorg
Copy link
Contributor

parseplatformorg commented Jul 7, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

@mtrezza mtrezza changed the title Add copy to clipboard in AggregationPanel feat: Add copy value of key-value element to clipboard in info panel Jul 7, 2025
@mtrezza mtrezza changed the title feat: Add copy value of key-value element to clipboard in info panel feat: Add clipboard icon to copy value of key-value element in info panel to clipboard Jul 7, 2025
@mtrezza mtrezza changed the title feat: Add clipboard icon to copy value of key-value element in info panel to clipboard feat: Add clipboard icon to copy value of key-value element in info panel Jul 7, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
src/components/AggregationPanel/AggregationPanelComponents.js (1)

15-20: Add error handling for copy operation.

The copy operation could potentially fail. Consider adding error handling to provide user feedback if the copy action fails.

  const handleCopy = () => {
-   copy(String(item.value));
-   if (showNote) {
-     showNote('Value copied to clipboard', false);
-   }
+   try {
+     const success = copy(String(item.value));
+     if (showNote) {
+       showNote(success ? 'Value copied to clipboard' : 'Failed to copy value', !success);
+     }
+   } catch (error) {
+     if (showNote) {
+       showNote('Failed to copy value', true);
+     }
+   }
  };
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dfa8a6b and 7ef219b.

📒 Files selected for processing (3)
  • src/components/AggregationPanel/AggregationPanel.js (1 hunks)
  • src/components/AggregationPanel/AggregationPanel.scss (1 hunks)
  • src/components/AggregationPanel/AggregationPanelComponents.js (2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/components/AggregationPanel/AggregationPanel.js (1)
src/components/AggregationPanel/AggregationPanelComponents.js (2)
  • KeyValueElement (14-37)
  • KeyValueElement (14-37)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Docker linux/amd64
🔇 Additional comments (2)
src/components/AggregationPanel/AggregationPanel.scss (1)

24-34: LGTM! Clean CSS implementation for copy icon behavior.

The styling correctly implements the show-on-hover pattern for the copy icon with appropriate visual alignment and spacing.

src/components/AggregationPanel/AggregationPanel.js (1)

104-112: LGTM! Proper prop passing for copy functionality.

The addition of the showNote prop correctly enables the copy notification feature while maintaining the existing component structure.

Comment on lines 32 to 34
<span className={styles.copyIcon} onClick={handleCopy}>
<Icon name="clone-icon" width={12} height={12} />
</span>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add accessibility attributes to the copy icon.

The copy icon is missing accessibility attributes, making it less accessible to screen readers and keyboard users.

-     <span className={styles.copyIcon} onClick={handleCopy}>
+     <span 
+       className={styles.copyIcon} 
+       onClick={handleCopy}
+       role="button"
+       tabIndex={0}
+       aria-label="Copy value to clipboard"
+       onKeyDown={(e) => {
+         if (e.key === 'Enter' || e.key === ' ') {
+           e.preventDefault();
+           handleCopy();
+         }
+       }}
+     >
        <Icon name="clone-icon" width={12} height={12} />
      </span>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<span className={styles.copyIcon} onClick={handleCopy}>
<Icon name="clone-icon" width={12} height={12} />
</span>
<span
className={styles.copyIcon}
onClick={handleCopy}
role="button"
tabIndex={0}
aria-label="Copy value to clipboard"
onKeyDown={(e) => {
if (e.key === 'Enter' || e.key === ' ') {
e.preventDefault();
handleCopy();
}
}}
>
<Icon name="clone-icon" width={12} height={12} />
</span>
🤖 Prompt for AI Agents
In src/components/AggregationPanel/AggregationPanelComponents.js around lines 32
to 34, the copy icon span lacks accessibility attributes. Add appropriate
attributes such as role="button", tabIndex="0" to make it focusable by keyboard,
and include aria-label describing the action (e.g., "Copy to clipboard") to
improve screen reader accessibility. Also, ensure the onClick handler is
complemented with onKeyPress or onKeyDown to support keyboard interaction.

Comment on lines +2 to +3
import copy from 'copy-to-clipboard';
import Icon from 'components/Icon/Icon.react';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Verify the imported dependencies are available.

Ensure that copy-to-clipboard library and the Icon component with "clone-icon" name are available in the project.


🏁 Script executed:

#!/bin/bash
# Check if copy-to-clipboard is available in package.json
echo "Checking copy-to-clipboard dependency:"
cat package.json | jq '.dependencies."copy-to-clipboard", .devDependencies."copy-to-clipboard"'

# Check if Icon component exists and supports clone-icon
echo "Checking Icon component:"
fd -t f "Icon.react.js" -x cat {}

# Search for clone-icon usage or definition
echo "Searching for clone-icon definition:"
rg "clone-icon" -A 2 -B 2

Length of output: 2473


Dependencies verified: copy-to-clipboard@3.3.3 and Icon('clone-icon') are available

The copy-to-clipboard package is listed in package.json and the Icon component supports the clone-icon sprite (see src/icons/clone-icon.svg).

Next steps (src/components/AggregationPanel/AggregationPanelComponents.js):

  • Add accessibility attributes to the copy icon wrapper:
    • e.g. <span role="button" aria-label="Copy value" …>
  • Introduce error handling around the copy operation in handleCopy:
    • wrap copy(String(item.value)) in try/catch and surface failures (toast, console.warn, etc.)
🤖 Prompt for AI Agents
In src/components/AggregationPanel/AggregationPanelComponents.js around lines 2
to 3, enhance accessibility by adding role="button" and aria-label="Copy value"
attributes to the span wrapping the copy icon. Additionally, update the
handleCopy function to wrap the copy(String(item.value)) call in a try/catch
block, and handle any errors by displaying a toast notification or logging a
warning to the console.

Copy link

uffizzi-cloud bot commented Jul 7, 2025

Uffizzi Ephemeral Environment deployment-64525

⌚ Updated Jul 07, 2025, 11:20 UTC

☁️ https://app.uffizzi.com/github.com/parse-community/parse-dashboard/pull/2871

📄 View Application Logs etc.

What is Uffizzi? Learn more

@mtrezza mtrezza merged commit 7862c42 into alpha Jul 7, 2025
11 checks passed
@mtrezza mtrezza deleted the codex/add-clipboard-icon-to-keyvalueelement branch July 7, 2025 11:28
parseplatformorg pushed a commit that referenced this pull request Jul 7, 2025
# [7.3.0-alpha.2](7.3.0-alpha.1...7.3.0-alpha.2) (2025-07-07)

### Features

* Add clipboard icon to copy value of key-value element in info panel ([#2871](#2871)) ([7862c42](7862c42))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 7.3.0-alpha.2

@parseplatformorg parseplatformorg added the state:released-alpha Released as alpha version label Jul 7, 2025
@mtrezza mtrezza mentioned this pull request Jul 9, 2025
4 tasks
parseplatformorg pushed a commit that referenced this pull request Aug 1, 2025
# [7.3.0](7.2.1...7.3.0) (2025-08-01)

### Bug Fixes

* Changing "Relative dates" option of saved filter does not enable save button ([#2947](#2947)) ([4f4977d](4f4977d))
* Class object counters in sidebar not updating ([#2950](#2950)) ([0f1920b](0f1920b))
* Clicking linked pointer with Cmd key in view table doesn't open page in new browser tab ([#2902](#2902)) ([101b194](101b194))
* Fails to generate MFA code with CLI command `parse-dashboard --createMFA` ([#2883](#2883)) ([544df1f](544df1f))
* Gracefully fail when trying to get new features in latest version of dashboard ([#2880](#2880)) ([1969a0e](1969a0e))
* Header checkbox in data browser does not indicate when a few rows are selected ([#2957](#2957)) ([e4ab666](e4ab666))
* Hyperlink in Views table ignores `urlQuery` key ([#2926](#2926)) ([c5eedf4](c5eedf4))
* Incorrect table cell width in App Settings table ([#2933](#2933)) ([d46765b](d46765b))
* Info panel scroll-to-top setting not persistent across dashboard sessions ([#2938](#2938)) ([2b78087](2b78087))
* Invalid clipboard content for multi-cell copy in data browser ([#2882](#2882)) ([22a2065](22a2065))
* Legacy filters without `filterId` cannot be deleted in data browser ([#2946](#2946)) ([65df9d6](65df9d6))
* Legacy filters without `filterId` do not appear in sidebar ([#2945](#2945)) ([fde3769](fde3769))
* Modal text input can be resized smaller than its cell in Safari browser ([#2930](#2930)) ([82a0cdc](82a0cdc))
* Move settings button on data browser toolbar for better UI ([#2940](#2940)) ([c473ce6](c473ce6))
* Pagination footer bar hides rows in data browser ([#2879](#2879)) ([6bc2da8](6bc2da8))
* Race condition on info panel request shows info panel data not corresponding to selected cell ([#2909](#2909)) ([6f45bb3](6f45bb3))
* Saved legacy filter in data browser cannot be deleted or cloned ([#2944](#2944)) ([15da90d](15da90d))
* Saved legacy filter with classname in query cannot be deleted ([#2948](#2948)) ([05ee5b3](05ee5b3))
* Selected text in info panel cannot be copied using Ctrl+C ([#2951](#2951)) ([0164c19](0164c19))
* Views not sorted alphabetically in sidebar ([#2943](#2943)) ([4c81fe4](4c81fe4))
* Warning dialog is shown after executing script on selected rows ([#2899](#2899)) ([027f1ed](027f1ed))

### Features

* Add additional values in info panel key-value element ([#2904](#2904)) ([a8f110e](a8f110e))
* Add AI agent for natural language interaction with Parse Server ([#2954](#2954)) ([32bd6e8](32bd6e8))
* Add clipboard icon to copy value of key-value element in info panel ([#2871](#2871)) ([7862c42](7862c42))
* Add Cloud Function as data source for views with optional text or file upload ([#2939](#2939)) ([f5831c7](f5831c7))
* Add column freezing in data browser ([#2877](#2877)) ([29f4a88](29f4a88))
* Add custom data views with aggregation query ([#2888](#2888)) ([b1679db](b1679db))
* Add environment variable support for AI agent configuration ([#2956](#2956)) ([2ac9e7e](2ac9e7e))
* Add hyperlink support in Views table ([#2925](#2925)) ([06cfc11](06cfc11))
* Add inclusive date filters "is on or after", "is on or before" in data browser ([#2929](#2929)) ([c8d621b](c8d621b))
* Add quick-add button to array parameter in Cloud Config ([#2866](#2866)) ([e98ccb2](e98ccb2))
* Add row number column to data browser ([#2878](#2878)) ([c0aa407](c0aa407))
* Add Settings menu to scroll info panel to top when browsing through rows ([#2937](#2937)) ([f339cb8](f339cb8))
* Add support for "not equal to" filter for Boolean values in data browser and analytics explorer ([#2914](#2914)) ([d55b89c](d55b89c))
* Add support for `Image` type in View table to display images ([#2952](#2952)) ([6a6b1f0](6a6b1f0))
* Add type mismatch warning when quick-adding entry to Cloud Config array parameter ([#2875](#2875)) ([bb1837f](bb1837f))
* Add view edit icon to views list in sidebar ([#2901](#2901)) ([96e33b9](96e33b9))
* Allow editing filter without loading data in data browser ([#2949](#2949)) ([9623580](9623580))
* Allow editing saved filters in data browser ([#2942](#2942)) ([daaccaa](daaccaa))
* Allow freeform text view resizing in modal dialogs ([#2910](#2910)) ([1399162](1399162))
* Persist info panel visibility when navigating across classes in data browser ([#2908](#2908)) ([1a3610a](1a3610a))
* Prefetch info panel data with config options `prefetchObjects` and `prefetchStale` ([#2915](#2915)) ([54a8156](54a8156))
* Warn when leaving data browser page with selected rows ([#2887](#2887)) ([206ead1](206ead1))

### Performance Improvements

* Add config option `enableResourceCache` to cache dashboard resources locally for faster loading in additional browser tabs ([#2920](#2920)) ([41a4963](41a4963))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:released-alpha Released as alpha version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants