Closes #315 (2) more prominent toolbar button#335
Merged
Conversation
Contributor
|
Thoughts: New Action button is much better, trying to pick holes, "Save action" is confusing as it's already saved but not that impactful. I wasn't sure how to add a custom event in this deployment - this hasn't been QA'd Apart from that I'm concerned I haven't found anything! It looks really good, and feels very intuitive |
rafaeelaudibert
pushed a commit
that referenced
this pull request
Apr 21, 2026
## Problem On an insight breakdown, if a user picks the SQL expression option and enters a non-trivial expression (e.g. `countIf(properties.$browser = 'Chrome')`), the raw expression is used verbatim as the column/series label. That's unreadable in charts and tables. Today, a user can work around this by aliasing the expression — either with `AS column_name` or with a trailing `-- column_name` comment — but there's no in-product hint that this is an option. Context: [support ticket #335](https://posthog.slack.com/archives/C094MLV8SKX/p1775761471898039). ## Changes - Added a `showBreakdownLabelHint` prop to `HogQLEditor`. When set, and the current buffered expression is longer than 20 characters and doesn't already end in an `AS <name>` alias or contain a `-- <name>` comment label, a small secondary-text tip is rendered directly under the editor hint: > Tip: add `AS column_name` or `-- column_name` to the end of your expression to use a readable label for this breakdown. - Threaded the flag from `TaxonomicFilter` → `taxonomicFilterLogic` → the HogQL expression group's `componentProps` → `InlineHogQLEditor` → `HogQLEditor`, so the hint can be opted into per TaxonomicFilter usage. - Set `hogQLExpressionShowBreakdownLabelHint` on the `TaxonomicFilter` rendered from `TaxonomicBreakdownPopover`, so the hint only appears in the insights breakdown flow (not in property filters, column selectors, etc., which also use the same editor). - Combined the new prop with `hogQLGlobals` into a single `hogQLExpressionComponentProps` selector to stay within kea's `SelectorTuple` length limit on the `taxonomicGroups` selector. ## How did you test this code? - `pnpm --filter=@posthog/frontend typescript:check` reports the same number of pre-existing errors before and after this change (no new TS errors introduced). - `pnpm --filter=@posthog/frontend format` runs cleanly. - No manual browser test performed in this agent environment — the dev server wasn't started, so the UI change itself has not been interactively verified. Reviewers should spot-check the breakdown popover with short (<= 20 char) expressions, long expressions, and long expressions that already use `AS` or `-- name`. ## Publish to changelog? no ## 🤖 LLM context Authored by PostHog Code based on a Slack request to surface the `AS column_name` / `-- column_name` workaround as an in-product hint on SQL breakdowns, gated on expression length > 20 characters. --- *Created with [PostHog Code](https://posthog.com/code?ref=pr)*
thmsobrmlr
pushed a commit
that referenced
this pull request
Apr 21, 2026
## Problem On an insight breakdown, if a user picks the SQL expression option and enters a non-trivial expression (e.g. `countIf(properties.$browser = 'Chrome')`), the raw expression is used verbatim as the column/series label. That's unreadable in charts and tables. Today, a user can work around this by aliasing the expression — either with `AS column_name` or with a trailing `-- column_name` comment — but there's no in-product hint that this is an option. Context: [support ticket #335](https://posthog.slack.com/archives/C094MLV8SKX/p1775761471898039). ## Changes - Added a `showBreakdownLabelHint` prop to `HogQLEditor`. When set, and the current buffered expression is longer than 20 characters and doesn't already end in an `AS <name>` alias or contain a `-- <name>` comment label, a small secondary-text tip is rendered directly under the editor hint: > Tip: add `AS column_name` or `-- column_name` to the end of your expression to use a readable label for this breakdown. - Threaded the flag from `TaxonomicFilter` → `taxonomicFilterLogic` → the HogQL expression group's `componentProps` → `InlineHogQLEditor` → `HogQLEditor`, so the hint can be opted into per TaxonomicFilter usage. - Set `hogQLExpressionShowBreakdownLabelHint` on the `TaxonomicFilter` rendered from `TaxonomicBreakdownPopover`, so the hint only appears in the insights breakdown flow (not in property filters, column selectors, etc., which also use the same editor). - Combined the new prop with `hogQLGlobals` into a single `hogQLExpressionComponentProps` selector to stay within kea's `SelectorTuple` length limit on the `taxonomicGroups` selector. ## How did you test this code? - `pnpm --filter=@posthog/frontend typescript:check` reports the same number of pre-existing errors before and after this change (no new TS errors introduced). - `pnpm --filter=@posthog/frontend format` runs cleanly. - No manual browser test performed in this agent environment — the dev server wasn't started, so the UI change itself has not been interactively verified. Reviewers should spot-check the breakdown popover with short (<= 20 char) expressions, long expressions, and long expressions that already use `AS` or `-- name`. ## Publish to changelog? no ## 🤖 LLM context Authored by PostHog Code based on a Slack request to surface the `AS column_name` / `-- column_name` workaround as an in-product hint on SQL breakdowns, gated on expression length > 20 characters. --- *Created with [PostHog Code](https://posthog.com/code?ref=pr)*
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Think this is a lot more obvious now, with clear links to docs
@Tannergoods Ready for QA. I touched everything to do with Actions and the toolbar so both of those need good QA :)