Skip to content

feat(kitchen-sink): add mock agent event log copy#4943

Merged
NathanFlurry merged 1 commit intomainfrom
05-04-feat_kitchen_sink_copy_event_log
May 5, 2026
Merged

feat(kitchen-sink): add mock agent event log copy#4943
NathanFlurry merged 1 commit intomainfrom
05-04-feat_kitchen_sink_copy_event_log

Conversation

@NathanFlurry
Copy link
Copy Markdown
Member

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Copy link
Copy Markdown
Member Author

NathanFlurry commented May 4, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

@claude
Copy link
Copy Markdown
Contributor

claude Bot commented May 4, 2026

PR Review: feat(kitchen-sink): add mock agent event log copy

Overview

This PR adds a Copy button to the Event Log panel in the kitchen-sink example's MockAgenticLoopPanel. Clicking it copies log entries to the clipboard in a tab-separated format (time\tlevel\tmessage) and shows a brief "Copied" confirmation for 1.5 seconds before resetting. The change is small, self-contained, and follows existing patterns.


What Works Well

  • Timer cleanup: copyResetTimerRef is properly cleared in the existing unmount useEffect, preventing state updates on an unmounted component.
  • Debounced reset: The timer is cancelled and restarted on each click, correctly handling rapid clicking.
  • Accessible markup: The button has both aria-label and title attributes and is disabled when the log is empty.
  • Correct useCallback dependency: Depends on logs, so the closure always captures the latest entries.

Issues

Unhandled clipboard API rejection

navigator.clipboard.writeText rejects when the page is served over HTTP (common in local dev), the user denies the clipboard permission, or the document is not focused. Currently the rejection is silently swallowed — the button appears to do nothing with no feedback to the user.

Wrap the clipboard call in a try/catch:

try {
    await navigator.clipboard.writeText(text);
    setEventLogCopied(true);
    if (copyResetTimerRef.current) clearTimeout(copyResetTimerRef.current);
    copyResetTimerRef.current = setTimeout(() => {
        setEventLogCopied(false);
        copyResetTimerRef.current = null;
    }, 1500);
} catch (err) {
    console.error("Failed to copy event log:", err);
}

Minor Notes

  • CSS placement: New styles are added inline in index.html, consistent with the rest of the file.
  • Lucide icon size: <Clipboard size={15} /> vs size={16} used elsewhere (e.g. <Trash2 size={16} />). A 1px difference is harmless but could be aligned for consistency.

Summary

Straightforward and well-implemented. The only actionable change is adding a try/catch around the clipboard write to handle rejections gracefully. Everything else looks good.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 4, 2026

Preview packages published to npm

Install with:

npm install rivetkit@pr-4943

All packages published as 0.0.0-pr.4943.a6ee1bd with tag pr-4943.

Engine binary is shipped via @rivetkit/engine-cli on linux-x64-musl, linux-arm64-musl, darwin-x64, and darwin-arm64. Windows users should use the release installer or set RIVET_ENGINE_BINARY.

Docker images:

docker pull rivetdev/engine:slim-a6ee1bd
docker pull rivetdev/engine:full-a6ee1bd
Individual packages
npm install rivetkit@pr-4943
npm install @rivetkit/react@pr-4943
npm install @rivetkit/rivetkit-napi@pr-4943
npm install @rivetkit/workflow-engine@pr-4943

@NathanFlurry NathanFlurry force-pushed the 05-04-fix_kitchen_sink_mock_agent_defaults branch from a247dd2 to 6c0e498 Compare May 4, 2026 15:36
Base automatically changed from 05-04-fix_kitchen_sink_mock_agent_defaults to main May 5, 2026 14:57
@NathanFlurry NathanFlurry merged commit a051729 into main May 5, 2026
22 of 24 checks passed
@NathanFlurry NathanFlurry deleted the 05-04-feat_kitchen_sink_copy_event_log branch May 5, 2026 14:58
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