Skip to content

feat: add copy button to Event Log#68

Merged
mrabbani merged 1 commit intomainfrom
feat/event-log-copy-button
Mar 6, 2026
Merged

feat: add copy button to Event Log#68
mrabbani merged 1 commit intomainfrom
feat/event-log-copy-button

Conversation

@mrabbani
Copy link
Member

@mrabbani mrabbani commented Mar 6, 2026

Summary

  • Adds a Copy button to the Event Log header in Settings stories
  • Copies all log entries with full, untruncated values to clipboard (save events show complete JSON instead of 120-char truncation)
  • Shows a green checkmark with "Copied" feedback for 2 seconds

Test plan

  • Open Settings story in Storybook
  • Trigger some onChange and onSave events
  • Click the Copy button in the Event Log header
  • Paste clipboard contents and verify full values are present

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added a "Copy to Clipboard" button to the event log. Users can now export all log entries with timestamps, event types, page IDs, and values as formatted text for easy sharing and reference. The button provides visual confirmation when content is successfully copied.

Save event values are truncated to 120 chars in the display. The copy
button copies all entries with full JSON values to the clipboard.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link

coderabbitai bot commented Mar 6, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

The EventLog component is enhanced with a "Copy to Clipboard" button that formats and copies log entries as text. State management tracks the copied status, and the button dynamically updates its label and icon to provide user feedback for two seconds before reverting.

Changes

Cohort / File(s) Summary
EventLog Component Enhancement
src/components/settings/Settings.stories.tsx
Added clipboard copy functionality with useState for copied state and useCallback for the copy handler. The button formats log entries (timestamps, event types, page IDs, keys, values) and copies them via navigator.clipboard.writeText(). UI elements dynamically reflect the copied state with temporary feedback.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A button to copy, oh what delight!
Log entries whisked to clipboard so tight,
Icons that dance when the copy succeeds,
Two seconds of joy for our debugging needs! 📋✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title clearly and concisely summarizes the main change: adding a copy button to the Event Log component.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/event-log-copy-button

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

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

@mrabbani mrabbani merged commit ef6c1c6 into main Mar 6, 2026
1 check passed
@mrabbani mrabbani deleted the feat/event-log-copy-button branch March 6, 2026 09:09
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.

1 participant