Skip to content

Conversation

jabahamondes
Copy link
Contributor

Problem

Sometimes I would like to easily export result without actually having to export it, I would just want to copy them.

Changes

  • Introduced a dropdown menu for copying table results in CSV, JSON, and Excel formats.
  • Added utility functions for clipboard operations and a helper function to create data table queries.
  • Enhanced the OutputPane component to support new copy features, improving user experience in data export.

How did you test this code?

Mannually:

image

CSV:

col1,col10,col11,col12,col13,col14,col15,col16,col17,col18,col19,col2,col20,col3,col4,col5,col6,col7,col8,col9
1,10,11,12,13,14,15,16,17,18,19,2,20,3,4,5,6,7,8,9

JSON

[
    {
        "col1": 1,
        "col2": 2,
        "col3": 3,
        "col4": 4,
        "col5": 5,
        "col6": 6,
        "col7": 7,
        "col8": 8,
        "col9": 9,
        "col10": 10,
        "col11": 11,
        "col12": 12,
        "col13": 13,
        "col14": 14,
        "col15": 15,
        "col16": 16,
        "col17": 17,
        "col18": 18,
        "col19": 19,
        "col20": 20
    }
]

EXCEL:

col1	col10	col11	col12	col13	col14	col15	col16	col17	col18	col19	col2	col20	col3	col4	col5	col6	col7	col8	col9
1	10	11	12	13	14	15	16	17	18	19	2	20	3	4	5	6	7	8	9

- Introduced a dropdown menu for copying table results in CSV, JSON, and Excel formats.
- Added utility functions for clipboard operations and a helper function to create data table queries.
- Enhanced the OutputPane component to support new copy features, improving user experience in data export.
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 file reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

@jabahamondes jabahamondes requested a review from lricoy October 3, 2025 13:15
@posthog-bot posthog-bot requested a review from a team October 3, 2025 13:16
Copy link
Contributor

github-actions bot commented Oct 3, 2025

Size Change: 0 B

Total Size: 3.07 MB

ℹ️ View Unchanged
Filename Size
frontend/dist/toolbar.js 3.07 MB

compressed-size-action

Copy link
Member

@lricoy lricoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! Big fan of copying results 🚀

Perhaps wait for @PostHog/team-data-warehouse's review, as they have more experience in this area.

One comment: It is worth testing larger result sets (e.g, 50k lines + many columns). I've seen in the past that when implementing this copy feature, it would freeze the screen/OOM.

I think is valid to test that or put behind a FF for a while because those tickets would probably go to DW, so it is their call.

@jabahamondes
Copy link
Contributor Author

@lricoy agree, I think there is a limit of 100 always to display in the table though

@jabahamondes
Copy link
Contributor Author

@lricoy tested with a limit 50k from the events table and I was able to copy/paste without crashing my mac 🤣
image
I think we should be fine but open to still add this behind a ff if dw team consider it as necessary 🫡

@lricoy
Copy link
Member

lricoy commented Oct 3, 2025

@lricoy agree, I think there is a limit of 100 always to display in the table though

Oh, right, it is capped at 1k it seems

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.

2 participants