Skip to content

fix(bluebird): make truncated channel feed messages expandable#3325

Merged
adboio merged 4 commits into
mainfrom
posthog-code/channels-feed-expandable-message
Jul 10, 2026
Merged

fix(bluebird): make truncated channel feed messages expandable#3325
adboio merged 4 commits into
mainfrom
posthog-code/channels-feed-expandable-message

Conversation

@adboio

@adboio adboio commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Problem

In the Channels feed, a task's original message/prompt was clamped to 4 lines with a pure CSS line-clamp and cut off at a plain ellipsis — with no "See more"/"Show more" or any other way to expand and read the rest of it.

Why: reported from the channels view — the truncated prompt had no affordance to expand; it just rendered a plaintext ellipsis.

Changes

  • Feed rows (ChannelFeedView) now render the prompt through CollapsibleMessageContent — the same "Show more"/"Show less" expander the task thread's UserMessage already uses — instead of a hard line-clamp-4.
  • Made CollapsibleMessageContent typography-neutral: moved its font-medium text-[13px] onto the existing callers (UserMessage, QueuedMessageView, both visually unchanged) so the feed keeps ThreadItemBody's 14px/normal body text rather than inheriting the bubble styling.
  • Switched its overflow check from a one-shot on-mount measurement to a ResizeObserver, so feed rows that mount off-screen under content-visibility: auto (and lay out lazily) measure their real height once they scroll into view.

How did you test this?

  • tsc --noEmit on @posthog/ui — clean.
  • Vitest for the touched areas (session-update + canvas) — 113 tests pass, including UserMessage.test.tsx.
  • biome check on the changed files — clean.
  • Did not launch the Electron app / capture a screenshot in this environment.

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Created with PostHog Code

The channel feed clamped each task's kickoff message to 4 lines with a
pure CSS `line-clamp`, so a longer prompt was cut off at a bare ellipsis
with no way to read the rest.

Render the prompt through `CollapsibleMessageContent` instead — the same
"Show more"/"Show less" affordance the task thread's `UserMessage`
already uses — so long messages can be expanded in place.

`CollapsibleMessageContent` was carrying `font-medium text-[13px]` that
only suited its message-bubble callers, which would have shrunk and
emboldened the feed's body text. Moved that typography onto the existing
callers (`UserMessage`, `QueuedMessageView` — unchanged visually) so the
component is typography-neutral and the feed keeps `ThreadItemBody`'s
14px/normal styling.

Its overflow measurement now uses a `ResizeObserver` rather than a
one-shot on-mount read: feed rows mount inside a `content-visibility:
auto` container that lays out lazily, so an on-mount measurement would
miss their real height until they scroll into view (and it now also
tracks reflow/resize).

Generated-By: PostHog Code
Task-Id: 1a8a2d95-b217-4491-9db5-fa67efb24750
@trunk-io

trunk-io Bot commented Jul 9, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 38bdaec.

adboio added 3 commits July 9, 2026 18:06
Read the content height into state from a callback ref instead of a
mount effect (React's recommended pattern for measuring a DOM node).
This resolves the React Doctor `no-initialize-state` finding and runs
the measurement in the commit phase, before paint, so long messages no
longer flash unclamped for a frame before collapsing. The ResizeObserver
is retained for reflow and for feed rows that lay out lazily under
`content-visibility: auto`.

Generated-By: PostHog Code
Task-Id: 1a8a2d95-b217-4491-9db5-fa67efb24750
The collapsed-message fade was an absolutely-positioned, full-width
gradient box tinted with a `fadeColor` that had to match the caller's
background. In the channel feed that background isn't uniform (row hover
tint) and the prompt text is often ragged, so the fade rendered as a
visible full-width band past the text — janky.

Switch to a paint-only CSS `mask-image` gradient on the text box itself,
the same technique the chat thread's user bubble already uses. A mask
fades only painted pixels, so it needs no background color to blend into
and never paints a band past the text. This drops the `fadeColor` prop
entirely (removed from both callers) and makes the fade correct on any
background.

Generated-By: PostHog Code
Task-Id: 1a8a2d95-b217-4491-9db5-fa67efb24750
Cut the verbose comments in CollapsibleMessageContent down to terse
one/two-liners, and lower the collapsed max-height from 160px to 120px so
messages collapse a bit sooner (~6 lines), keeping the feed compact.

Generated-By: PostHog Code
Task-Id: 1a8a2d95-b217-4491-9db5-fa67efb24750
@adboio adboio marked this pull request as ready for review July 10, 2026 17:11
@adboio adboio added the Stamphog This will request an autostamp by stamphog on small changes label Jul 10, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pure UI fix that replaces a static line-clamp-4 with the existing CollapsibleMessageContent component, cleans up the gradient overlay approach (positioned div → CSS mask-image), and switches to a ResizeObserver callback ref for more accurate overflow detection. No data model, API, or business logic changes.

@greptile-apps

greptile-apps Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "refactor(bluebird): trim comments, lower..." | Re-trigger Greptile

@adboio adboio merged commit d2379d5 into main Jul 10, 2026
35 checks passed

adboio commented Jul 10, 2026

Copy link
Copy Markdown
Contributor Author

Merge activity

@adboio adboio deleted the posthog-code/channels-feed-expandable-message branch July 10, 2026 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Stamphog This will request an autostamp by stamphog on small changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant