Skip to content

feat: Add copy icon to text and table cell info-panel segments#3382

Open
dblythy wants to merge 1 commit into
parse-community:alphafrom
dblythy:feat/2898-copy-icon-segments
Open

feat: Add copy icon to text and table cell info-panel segments#3382
dblythy wants to merge 1 commit into
parse-community:alphafrom
dblythy:feat/2898-copy-icon-segments

Conversation

@dblythy

@dblythy dblythy commented Jul 4, 2026

Copy link
Copy Markdown
Member

Closes #2898

Extends the hover copy-to-clipboard icon (previously only on key-value info-panel segments, added in #2871) to text segments and individual table cells.

Text item

Before

text before

After

text after

Table cell

Before

table before

After

table after

Summary by CodeRabbit

  • New Features

    • Added copy-to-clipboard buttons across text, key/value, and table content in the aggregation panel.
    • Copy actions can now show user notifications when content is copied.
  • Bug Fixes

    • Improved copy icon visibility and hover behavior so copy actions are easier to find in different content layouts.

@parse-github-assistant

Copy link
Copy Markdown

I will reformat the title to use the proper commit message syntax.

@parse-github-assistant parse-github-assistant Bot changed the title feat: add copy icon to text and table cell info-panel segments feat: Add copy icon to text and table cell info-panel segments Jul 4, 2026
@parse-github-assistant

Copy link
Copy Markdown

🚀 Thanks for opening this pull request! We appreciate your effort in improving the project. Please let us know once your pull request is ready for review.

Tip

  • Keep pull requests small. Large PRs will be rejected. Break complex features into smaller, incremental PRs.
  • Use Test Driven Development. Write failing tests before implementing functionality. Ensure tests pass.
  • Group code into logical blocks. Add a short comment before each block to explain its purpose.
  • We offer conceptual guidance. Coding is up to you. PRs must be merge-ready for human review.
  • Our review focuses on concept, not quality. PRs with code issues will be rejected. Use an AI agent.
  • Human review time is precious. Avoid review ping-pong. Inspect and test your AI-generated code.

Note

Please respond to review comments from AI agents just like you would to comments from a human reviewer. Let the reviewer resolve their own comments, unless they have reviewed and accepted your commit, or agreed with your explanation for why the feedback was incorrect.

Caution

Pull requests must be written using an AI agent with human supervision. Pull requests written entirely by a human will likely be rejected, because of lower code quality, higher review effort and the higher risk of introducing bugs. Please note that AI review comments on this pull request alone do not satisfy this requirement. Our CI and AI review are safeguards, not development tools. If many issues are flagged, rethink your development approach. Invest more effort in planning and design rather than using review cycles to fix low-quality code.

@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a reusable CopyButton component to AggregationPanelComponents and threads a new showNote prop through TextElement, KeyValueElement, and TableElement to enable copy-to-clipboard with notifications for text and table segments. AggregationPanel.js passes showNote accordingly, and SCSS hover selectors are updated for the new elements.

Changes

Copy icon extension for text and table segments

Layer / File(s) Summary
CopyButton component and prop threading
src/components/AggregationPanel/AggregationPanelComponents.js
Adds a CopyButton component using copy-to-clipboard, adds showNote prop to TextElement, KeyValueElement, and TableElement, and updates rendering to conditionally show the copy icon for non-empty values.
Panel wiring and hover styling
src/components/AggregationPanel/AggregationPanel.js, src/components/AggregationPanel/AggregationPanel.scss
renderSegmentContent passes showNote into TextElement and TableElement; SCSS replaces the nested hover rule with explicit hover selectors for .keyValue, .textElement, and .tableCell, and adds/adjusts .textElement and .copyIcon layout.

Estimated code review effort: 2 (Simple) | ~15 minutes

Possibly related PRs

Suggested reviewers: mtrezza

🚥 Pre-merge checks | ✅ 7
✅ Passed checks (7 passed)
Check name Status Explanation
Title check ✅ Passed The title uses the required feat: prefix and accurately summarizes the copy-icon enhancement.
Description check ✅ Passed The description covers the issue and implementation clearly, but it omits the template's explicit Tasks section.
Linked Issues check ✅ Passed The changes add copy-icon support to text segments and table cells, matching the linked issue's feature request.
Out of Scope Changes check ✅ Passed The code changes stay focused on the info-panel copy-icon feature and related styling/component wiring.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Security Check ✅ Passed PASS: The patch only adds hover copy buttons and plain-text notifications; no new HTML injection, eval, or unsafe DOM sinks were introduced.
Engage In Review Feedback ✅ Passed No substantive review feedback comments were present; only a review request and bot ack, so this process check is not applicable.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@dblythy

dblythy commented Jul 6, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

@coderabbitai coderabbitai Bot 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.

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

22-28: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

No guard against empty/undefined text for the copy icon.

Unlike TableElement, which only renders CopyButton when the value is not undefined/null/'', TextElement always renders it. If text is empty/undefined, clicking still copies "undefined"/empty string and shows the confirmation note, which is misleading.

🩹 Proposed fix
 export const TextElement = ({ text, style, showNote }) => (
   <div className={`text-element ${styles.textElement}`} style={style}>
     <p>{text}</p>
-    <CopyButton value={text} showNote={showNote} />
+    {text !== undefined && text !== null && text !== '' && (
+      <CopyButton value={text} showNote={showNote} />
+    )}
   </div>
 );
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/AggregationPanel/AggregationPanelComponents.js` around lines
22 - 28, The TextElement component always renders CopyButton even when text is
empty or undefined, unlike TableElement’s guarded behavior. Update TextElement
in AggregationPanelComponents to conditionally render CopyButton only when text
is not null, undefined, or an empty string, so the copy action and showNote only
appear for valid values.

6-20: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

CopyButton is not keyboard-accessible.

The clickable <span> only handles onClick; there's no role="button", tabIndex, onKeyDown, or aria-label. Keyboard-only or screen-reader users cannot trigger the copy action.

♿ Proposed fix
   return (
-    <span className={styles.copyIcon} onClick={handleCopy}>
+    <span
+      className={styles.copyIcon}
+      onClick={handleCopy}
+      role="button"
+      tabIndex={0}
+      aria-label="Copy to clipboard"
+      onKeyDown={(e) => {
+        if (e.key === 'Enter' || e.key === ' ') {
+          e.preventDefault();
+          handleCopy();
+        }
+      }}
+    >
       <Icon name="clone-icon" width={12} height={12} fill="currentColor" />
     </span>
   );
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/components/AggregationPanel/AggregationPanelComponents.js` around lines 6
- 20, The CopyButton component is only clickable with a mouse, so update the
CopyButton span to be keyboard- and screen-reader accessible. In
AggregationPanelComponents.js, add button semantics to the CopyButton element by
using an appropriate role, tabIndex, aria-label, and an onKeyDown handler that
triggers handleCopy for keyboard activation, while keeping the existing copy
logic and showNote behavior unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/components/AggregationPanel/AggregationPanelComponents.js`:
- Around line 22-28: The TextElement component always renders CopyButton even
when text is empty or undefined, unlike TableElement’s guarded behavior. Update
TextElement in AggregationPanelComponents to conditionally render CopyButton
only when text is not null, undefined, or an empty string, so the copy action
and showNote only appear for valid values.
- Around line 6-20: The CopyButton component is only clickable with a mouse, so
update the CopyButton span to be keyboard- and screen-reader accessible. In
AggregationPanelComponents.js, add button semantics to the CopyButton element by
using an appropriate role, tabIndex, aria-label, and an onKeyDown handler that
triggers handleCopy for keyboard activation, while keeping the existing copy
logic and showNote behavior unchanged.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e9b6f654-c6e3-43bb-aa45-144e05b77a8b

📥 Commits

Reviewing files that changed from the base of the PR and between 9db24be and df07c96.

📒 Files selected for processing (3)
  • src/components/AggregationPanel/AggregationPanel.js
  • src/components/AggregationPanel/AggregationPanel.scss
  • src/components/AggregationPanel/AggregationPanelComponents.js

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.

Make icon to copy available in other types of segments in info panel

1 participant