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(data-warehouse): query tabs #23958

Merged
merged 99 commits into from
Aug 6, 2024
Merged

feat(data-warehouse): query tabs #23958

merged 99 commits into from
Aug 6, 2024

Conversation

EDsCODE
Copy link
Member

@EDsCODE EDsCODE commented Jul 24, 2024

Problem

  • want to be able to query multiple things at once side by side

Changes

  • add query tabs
Screenshot 2024-07-25 at 6 32 59 PM

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

Does this work well for both Cloud and self-hosted?

How did you test this code?

Copy link
Contributor

github-actions bot commented Jul 24, 2024

Size Change: +34 B (0%)

Total Size: 1.07 MB

ℹ️ View Unchanged
Filename Size Change
frontend/dist/toolbar.js 1.07 MB +34 B (0%)

compressed-size-action

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

2 snapshot changes in total. 0 added, 2 modified, 0 deleted:

  • chromium: 0 added, 2 modified, 0 deleted (diff for shard 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@EDsCODE EDsCODE marked this pull request as ready for review July 25, 2024 20:04
@EDsCODE EDsCODE requested a review from Gilbert09 July 25, 2024 20:07
Copy link
Member

@Gilbert09 Gilbert09 left a comment

Choose a reason for hiding this comment

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

I think it'd be really good to be able to preserve your tabs and the contents of your tabs within local storage!

createModel: () => {
if (props.monaco) {
const uri = props.monaco.Uri.parse((values.modelCount + 1).toString())
const model = props.monaco.editor.createModel('SELECT event FROM events LIMIT 100', props.language, uri)
Copy link
Member

Choose a reason for hiding this comment

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

Should we use the default query from frontend/src/queries/examples.ts?


function QueryTab({ model, active, onClear, onClick }: QueryTabProps): JSX.Element {
return (
<button
Copy link
Member

Choose a reason for hiding this comment

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

Should we use LemonTabs or something similar for this?

Copy link
Member Author

Choose a reason for hiding this comment

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

avoided lemontabs as I wanted custom UI that was very much editor-tab like

Copy link
Member Author

Choose a reason for hiding this comment

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

just updated the images in the PR description to match

onClear ? 'pl-3 pr-2' : 'px-4'
)}
>
{'Query ' + model.path.split('/').pop()}
Copy link
Member

Choose a reason for hiding this comment

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

Will we allow people to name these at some point?

@EDsCODE EDsCODE requested a review from Gilbert09 July 29, 2024 01:06
@EDsCODE
Copy link
Member Author

EDsCODE commented Jul 29, 2024

@Gilbert09 one more pass please on the state logic. I will add this behind a feature flag too as it's a significant implementation that should be tested more deeply

Comment on lines 62 to 67
onClick={() =>
saveAs(
true,
'Only the currently open query will be saved as an insight. All other draft queries will be discarded'
)
}
Copy link
Member

Choose a reason for hiding this comment

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

Not one for right now, but I wonder whether we can make this experience better somehow. Maybe opening the new insight in a new tab, or just having a toast with a link to the insight

@Twixes
Copy link
Member

Twixes commented Aug 2, 2024

Hmm, why is this better than browser tabs? Tabs have come up at times in the past (@corywatilo can tell you a lot about it), but in the browser context, they easily make things more confusing by duplicating browser functionality.

@EDsCODE
Copy link
Member Author

EDsCODE commented Aug 5, 2024

@Twixes maybe not the strongest point here but gotten this request internally and externally because it would make flipping between queries part of the posthog experience. I don't think people prefer to have multiple tabs of posthog open. Can dig more here

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

5 snapshot changes in total. 0 added, 5 modified, 0 deleted:

  • chromium: 0 added, 5 modified, 0 deleted (diff for shard 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

4 snapshot changes in total. 0 added, 4 modified, 0 deleted:

  • chromium: 0 added, 4 modified, 0 deleted (diff for shard 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

2 snapshot changes in total. 0 added, 2 modified, 0 deleted:

  • chromium: 0 added, 2 modified, 0 deleted (diff for shard 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

2 snapshot changes in total. 0 added, 2 modified, 0 deleted:

  • chromium: 0 added, 2 modified, 0 deleted (diff for shard 1)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

3 snapshot changes in total. 0 added, 3 modified, 0 deleted:

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

1 snapshot changes in total. 0 added, 1 modified, 0 deleted:

  • chromium: 0 added, 1 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@EDsCODE EDsCODE merged commit 4107195 into master Aug 6, 2024
93 checks passed
@EDsCODE EDsCODE deleted the dw-query-tabs branch August 6, 2024 21:13
silentninja pushed a commit to silentninja/posthog that referenced this pull request Aug 8, 2024
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Ben White <[email protected]>
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.

5 participants