fix(sessions): clarify "PostHog products used" bar and drop misleading Code link#2545
fix(sessions): clarify "PostHog products used" bar and drop misleading Code link#2545k11kirky wants to merge 2 commits into
Conversation
…g Code link The session resources bar above the composer was confusing: the header "PostHog resources used" gave no explanation, and the "Code" chip linked to the posthog.com/code marketing page even though it just means the agent read files from the user's repo. - Rename the header to "PostHog products used" and add a tooltip explaining it lists products the agent drew on this session. - Stop the "Code" chip linking to the /code landing page; it now shows an explanatory tooltip instead of a misleading destination. - Give every chip a hover tooltip (docs link or explanation). Generated-By: PostHog Code Task-Id: 39a13701-8317-4824-82b7-6558a1af8f3e
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
Prompt To Fix All With AIFix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
apps/code/src/renderer/features/sessions/components/SessionResourcesBar.tsx:118-120
The tooltip fallback for products with no `docUrl` and no `PRODUCT_TOOLTIP` entry is `product.label`, which is the same text already visible in the badge. For `apm` this means hovering the chip shows a tooltip that adds no information. Either add an `apm` entry to `PRODUCT_TOOLTIP` (mirroring the `code` treatment) or omit the tooltip when there's nothing extra to say, to avoid a superfluous interaction.
```suggestion
const tooltip =
PRODUCT_TOOLTIP[product.id] ??
(docUrl ? `Open ${product.label} docs` : undefined);
```
Reviews (1): Last reviewed commit: "fix(sessions): clarify "PostHog products..." | Re-trigger Greptile |
| const tooltip = | ||
| PRODUCT_TOOLTIP[product.id] ?? | ||
| (docUrl ? `Open ${product.label} docs` : product.label); |
There was a problem hiding this comment.
The tooltip fallback for products with no
docUrl and no PRODUCT_TOOLTIP entry is product.label, which is the same text already visible in the badge. For apm this means hovering the chip shows a tooltip that adds no information. Either add an apm entry to PRODUCT_TOOLTIP (mirroring the code treatment) or omit the tooltip when there's nothing extra to say, to avoid a superfluous interaction.
| const tooltip = | |
| PRODUCT_TOOLTIP[product.id] ?? | |
| (docUrl ? `Open ${product.label} docs` : product.label); | |
| const tooltip = | |
| PRODUCT_TOOLTIP[product.id] ?? | |
| (docUrl ? `Open ${product.label} docs` : undefined); |
Prompt To Fix With AI
This is a comment left during a code review.
Path: apps/code/src/renderer/features/sessions/components/SessionResourcesBar.tsx
Line: 118-120
Comment:
The tooltip fallback for products with no `docUrl` and no `PRODUCT_TOOLTIP` entry is `product.label`, which is the same text already visible in the badge. For `apm` this means hovering the chip shows a tooltip that adds no information. Either add an `apm` entry to `PRODUCT_TOOLTIP` (mirroring the `code` treatment) or omit the tooltip when there's nothing extra to say, to avoid a superfluous interaction.
```suggestion
const tooltip =
PRODUCT_TOOLTIP[product.id] ??
(docUrl ? `Open ${product.label} docs` : undefined);
```
How can I resolve this? If you propose a fix, please make it concise.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Per review: chips with no docs link and no explanation (e.g. apm) were getting a tooltip that just repeated the label text. Extract a ResourceChip component that renders such chips bare and only wraps in a Tooltip when there's something extra to say (a docs hint or a per-product explanation). Generated-By: PostHog Code Task-Id: 39a13701-8317-4824-82b7-6558a1af8f3e
Problem
Users hit the bar above the message composer and didn't understand it (per a Slack thread). Two specific issues:
posthog.com/codemarketing landing page — a dead-end destination. It only means "the agent read files from your repository", not a PostHog data product.Changes
/codelanding page; it now shows an explanatory tooltip instead.No behavioural change to what gets tracked — only how the bar is labelled and what the chips do on click/hover.
How did you test this?
tsc -p tsconfig.web.json --noEmit(renderer typecheck) — passes.vitest run accumulateSessionResources— 3 tests pass (accumulation logic unchanged).biome checkon the changed file — clean.Automatic notifications
Created with PostHog Code from a Slack thread