Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🎨 feat: Add Save/Download button to Artifact and CodeBlock as request… #5346

Closed
wants to merge 3 commits into from

Conversation

Ringish
Copy link

@Ringish Ringish commented Jan 17, 2025

Summary

This PR adds a "Save" button to both the Artifact and CodeBlock components, allowing users to download code directly instead of just copying it to the clipboard.

Motivation and Context

  • Users previously had to manually copy or click Copy button and paste code
  • This feature improves usability by enabling direct downloads
  • The implementation uses showSaveFilePicker() when available, with a fallback to an anchor-based download

Closes #4645

Change Type

  • New feature (non-breaking change which adds functionality)

Testing

  1. Navigate to an artifact or a code block in the app
  2. Click the new "Save" button
  3. Verify that the correct file is downloaded

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • I have commented in any complex areas of my code
  • I have made pertinent documentation changes
  • My changes do not introduce new warnings
  • [] I have written tests demonstrating that my changes are effective or that my feature works
  • Local unit tests pass with my changes
  • A pull request for updating the documentation has been submitted (if needed)

@danny-avila
Copy link
Owner

Thanks, implemented in #5428

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.

Enhancement: artifacts - add button to download/save the generated html (or other code)
2 participants