:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
fix(conversations): stop long tags overflowing the ticket sidebar (#85649)
Christiaan Hendriksen9930547a1918
diff --git a/frontend/snapshots.yml b/frontend/snapshots.ymlindex 2826ba602b29..c9138b123691 100644--- a/frontend/snapshots.yml+++ b/frontend/snapshots.yml@@ -4476,6 +4476,10 @@ snapshots:hash: v1.k794b7964.62481a20890d8d9702570d58b69f47580c91399daa635cab23d9e8da75d2636f.oAaWHdceTRTQOchqDXvZ7-ym0DB_CpRpPyXnqlKugwolemon-ui-object-tags--static-only--light:hash: v1.k794b7964.1a69b09d2bc7612599daf0a1228b103250debc4afa2224fb8005e3c9b7f63326.gU2OzoeUxnsDI54qX0B9UdaUsf0FRNhRuem7P2t2CIY+ lemon-ui-object-tags--wrap-long-tags-in-narrow-container--dark:+ hash: v1.k794b7964.d0fa366eb671acf1e7625ca635c64bda5890be3b787b79cf04cfefdf8c373ccb.Du_mnCWcW74eny1ZDLhueIqRdIkmAgbYZ9Yr63EOM4s+ lemon-ui-object-tags--wrap-long-tags-in-narrow-container--light:+ hash: v1.k794b7964.e04b66e33d1a6381143b404306d2574d613b6d2171627b7874d82499c86e3d5a.22xFdY4MD0kVHWGQ8wMrjWCScOj4zvXYQpteE5kTJHIlemon-ui-pagination-control--bordered--dark:hash: v1.k794b7964.35250c17a64dcfcb9d4b9cf13641dbf1c13ac76bf0acaa34df193f91d5d495db.rzQgorIAAL-incvoI_TqbpSdRi7jKRYN6Pq83dr7vBclemon-ui-pagination-control--bordered--light:diff --git a/frontend/src/lib/components/ObjectTags/ObjectTags.stories.tsx b/frontend/src/lib/components/ObjectTags/ObjectTags.stories.tsxindex 9d634f6a8c7d..e330239a937e 100644--- a/frontend/src/lib/components/ObjectTags/ObjectTags.stories.tsx+++ b/frontend/src/lib/components/ObjectTags/ObjectTags.stories.tsx@@ -20,3 +20,11 @@ export const Default: Story = {export const StaticOnly: Story = {args: { staticOnly: true },}++export const WrapLongTagsInNarrowContainer: Story = {+ render: () => (+ <div className="w-40 rounded border p-2">+ <ObjectTags tags={['support-ticket-tag-with-a-very-long-unbroken-name', 'billing']} staticOnly wrap />+ </div>+ ),+}diff --git a/frontend/src/lib/components/ObjectTags/ObjectTags.tsx b/frontend/src/lib/components/ObjectTags/ObjectTags.tsxindex c25f243ddd79..2c732f032e03 100644--- a/frontend/src/lib/components/ObjectTags/ObjectTags.tsx+++ b/frontend/src/lib/components/ObjectTags/ObjectTags.tsx@@ -24,6 +24,12 @@ interface ObjectTagsPropsBase {inputPlaceholder?: string/** Makes each displayed tag clickable, e.g. to filter by it. */onTagClick?: (tag: string) => void+ /**+ * Let a long tag wrap and shrink rather than overflow its container. For narrow containers like a+ * sidebar column — off by default, since it lowers the min-content width and so shifts how much+ * room surrounding table columns get.+ */+ wrap?: boolean}export type ObjectTagsProps =@@ -65,6 +71,7 @@ export function ObjectTags({editLabel = 'Edit tags',inputPlaceholder = 'try "official"',onTagClick,+ wrap = false,}: ObjectTagsProps): JSX.Element {const objectTagId = useId()const logic = objectTagsLogic({ id: objectTagId, onChange })@@ -83,7 +90,7 @@ export function ObjectTags({<div// eslint-disable-next-line react/forbid-dom-propsstyle={style}- className={clsx(className, 'inline-flex flex-wrap gap-0.5 items-center')}+ className={clsx(className, 'inline-flex flex-wrap gap-0.5 items-center', wrap && 'min-w-0 max-w-full')}data-attr={dataAttr}>{editingTags ? (@@ -115,6 +122,8 @@ export function ObjectTags({key={index}type={COLOR_OVERRIDES[tag] || colorForString(tag)}onClick={onTagClick ? () => onTagClick(tag) : undefined}+ className={wrap ? 'max-w-full' : undefined}+ wrap={wrap}>{tag}</LemonTag>diff --git a/frontend/src/lib/lemon-ui/LemonTag/LemonTag.scss b/frontend/src/lib/lemon-ui/LemonTag/LemonTag.scssindex 486a9b836f2b..5bff4334f33f 100644--- a/frontend/src/lib/lemon-ui/LemonTag/LemonTag.scss+++ b/frontend/src/lib/lemon-ui/LemonTag/LemonTag.scss@@ -21,6 +21,13 @@font-weight: normal;}+ &.LemonTag--wrap {+ // `anywhere` (rather than `break-word`) also shrinks the tag's min-content width,+ // so a long unbroken tag can't force its container to overflow+ overflow-wrap: anywhere;+ white-space: normal;+ }+&.LemonTag--primary {color: var(--color-accent);background: none;diff --git a/frontend/src/lib/lemon-ui/LemonTag/LemonTag.tsx b/frontend/src/lib/lemon-ui/LemonTag/LemonTag.tsxindex 0a955f3cad7b..c08fc3a87b3c 100644--- a/frontend/src/lib/lemon-ui/LemonTag/LemonTag.tsx+++ b/frontend/src/lib/lemon-ui/LemonTag/LemonTag.tsx@@ -26,6 +26,8 @@ export interface LemonTagProps {children: React.ReactNodesize?: 'small' | 'medium'weight?: 'normal'+ /** Let long content wrap (breaking mid-word if needed) instead of keeping the tag on one unshrinkable line. */+ wrap?: booleanicon?: JSX.Elementclosable?: booleanonClose?: () => void@@ -50,6 +52,7 @@ export const LemonTag: React.FunctionComponent<className,size = 'medium',weight,+ wrap,icon,closable,onClose,@@ -75,6 +78,7 @@ export const LemonTag: React.FunctionComponent<disabledReason ? 'cursor-not-allowed' : isClickable ? 'cursor-pointer' : undefined,`LemonTag--${type}`,weight && `LemonTag--${weight}`,+ wrap && 'LemonTag--wrap',closeOnClick && 'LemonTag--close-on-click',className)}diff --git a/products/conversations/frontend/components/TicketTags/index.tsx b/products/conversations/frontend/components/TicketTags/index.tsxindex 5857b15da7a6..42b90976b36e 100644--- a/products/conversations/frontend/components/TicketTags/index.tsx+++ b/products/conversations/frontend/components/TicketTags/index.tsx@@ -36,12 +36,13 @@ export function TicketTags({className={className}data-attr="ticket-tags"actionButtonSize="medium"+ wrap/>)return disabledReason ? (<Tooltip title={disabledReason}>- <span>{tagsDisplay}</span>+ <span className="min-w-0">{tagsDisplay}</span></Tooltip>) : (tagsDisplaydiff --git a/products/conversations/frontend/scenes/ticket/SupportTicketScene.tsx b/products/conversations/frontend/scenes/ticket/SupportTicketScene.tsxindex f113f7baaf44..e01de9ef5043 100644--- a/products/conversations/frontend/scenes/ticket/SupportTicketScene.tsx+++ b/products/conversations/frontend/scenes/ticket/SupportTicketScene.tsx@@ -524,8 +524,8 @@ export function SupportTicketScene({ ticketId }: { ticketId: string }): JSX.Elem}}/></div>- <div className="flex justify-between items-center">- <span className="text-muted-alt">Tags</span>+ <div className="flex justify-between items-start gap-2">+ <span className="text-muted-alt shrink-0">Tags</span><TicketTagstags={tags}onChange={setTags}