data explorer: create "Copy as Code" modal #8537
Draft
+434
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is building off the
copy-as-code-comms
branch from #8536 for ease of review.This PR implements the actions and modal dialog for the
Copy as Code
data explorer button.A modal dialog was chosen over a modal popup since we cannot use a modal popup in the editor action bar at this point in time. Notes from @dhruvisompura:
Note that this is just the first implementation! Things like the "Copy to Clipboard" functionality, real code editor block, etc will come in a follow up PR.
Release Notes
New Features
Bug Fixes
QA Notes
Intended behavior is that the modal has a dropdown that is populated with either "No available syntaxes." or the name of a syntax, eg,
pandas
, + generated code. At this point, the code generation piece is not implemented, so we won't have to check the code is correct (yet).On the Python side, a
pandas
dataframe will fill the dropdown withpandas
. Apolars
dataframe will fill the dropdown withpolars
. For the R side, the dropdown should sayNo available syntaxes
.Screen.Recording.2025-07-15.at.5.43.01.PM.mov