Skip to content

fix(sessions): stop footer status line overlapping diff stats when narrow#3258

Merged
pauldambra merged 2 commits into
mainfrom
posthog-code/fix-session-footer-overlap
Jul 8, 2026
Merged

fix(sessions): stop footer status line overlapping diff stats when narrow#3258
pauldambra merged 2 commits into
mainfrom
posthog-code/fix-session-footer-overlap

Conversation

@pauldambra

@pauldambra pauldambra commented Jul 8, 2026

Copy link
Copy Markdown
Member

Problem

When the main chat window is narrow (e.g. with panes open), the status line above the prompt input overlaps itself: "(Esc to stop" wraps onto three lines and the elapsed time paints over the diff stats ("22 files").

The left half of the footer row is allowed to shrink (min-w-0), but nothing inside GeneratingIndicator was constrained to a single line — so wrappable text wrapped, and the non-wrappable elapsed time overflowed into the shrink-0 right-side stats.

Fix

Make the indicator a single non-wrapping line that shrinks gracefully:

  • Root flex gets min-w-0 and the brain icon shrink-0, so the component shrinks inside the row instead of overflowing into the diff stats.
  • "(Esc to stop", the dot separator, and the elapsed time are now one Text run (dot rendered inline), so they truncate as a unit with an ellipsis instead of wrapping.
  • The hint gets shrink-[8] truncate and the activity word truncate, so the Esc/timer hint collapses first and the activity word only ellipsizes as a last resort. The context ring and diff stats keep their space.

After (light mode, from the new Storybook stories)

Wide (720px) — everything on one line:

Footer at 720px, light mode

Narrow (340px) — the "(Esc to stop · …s)" hint ellipsizes first; the context ring stays intact, nothing overlaps or wraps:

Footer at 340px, light mode

(Screenshots live on the posthog-code/fix-session-footer-overlap-assets branch so no binaries land in this PR's diff.)

Testing

  • Added SessionFooter.stories.tsx rendering the footer at fixed widths from 720px down to 220px (generating, generating + queue, awaiting permission, idle). Verified in Storybook (dark and light) via headless browser screenshots:
    • At 720–400px everything fits on one line.
    • At 340px the "(Esc to stop · …s)" hint ellipsizes; at 280px it's nearly collapsed; only at 220px does the activity word itself truncate.
    • The right-side context ring stays fully legible at every width — no overlap, no wrapping.
    • Note: DiffStatsChip doesn't render in Storybook (its diff-stats query never resolves there), but it shares the shrink-0 right-side group with the context ring, so the overlap scenario is exercised.
  • pnpm exec biome check on the changed files — clean.
  • pnpm --filter @posthog/ui typecheck — passes.

🤖 Generated with Claude Code

…rrow

The generating indicator's text nodes had no single-line constraint, so in a narrow chat pane "(Esc to stop" wrapped onto multiple lines and the non-wrappable elapsed time painted over the shrink-0 diff stats on the right.

Make the indicator a single non-wrapping line that shrinks cleanly: the "(Esc to stop · 5.4s)" hint is one truncating text run that gives up space (shrink-[8]) before the activity word, which itself truncates as a last resort.

Generated-By: PostHog Code
Task-Id: 8391467b-63fc-459c-89ef-1d9a45177b91
@trunk-io

trunk-io Bot commented Jul 8, 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 8, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit a17ac71.

Renders the footer inside fixed-width boxes (720px down to 220px) so the truncation behaviour at narrow pane widths is easy to eyeball in Storybook. Covers generating, generating-with-queue, awaiting-permission, and idle states.

DiffStatsChip doesn't render in Storybook (its tRPC diff-stats query never resolves there), but the pure ContextUsageIndicator occupies the same shrink-0 right-side group, so the overlap scenario is still exercised.

Generated-By: PostHog Code
Task-Id: 8391467b-63fc-459c-89ef-1d9a45177b91
pauldambra added a commit that referenced this pull request Jul 8, 2026
Assets-only branch so the PR description can embed the images without adding binaries to the PR diff.

Generated-By: PostHog Code
Task-Id: 8391467b-63fc-459c-89ef-1d9a45177b91
@pauldambra pauldambra added the Stamphog This will request an autostamp by stamphog on small changes label Jul 8, 2026
@pauldambra pauldambra requested a review from a team July 8, 2026 09:46
@pauldambra pauldambra enabled auto-merge (squash) July 8, 2026 09:47

@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 CSS layout fix — adds min-w-0/truncate/shrink-0 to prevent text overflow in narrow panels, with an accompanying Storybook story to visualise the fix. No logic, data model, or API surface touched.

@pauldambra pauldambra merged commit 0707768 into main Jul 8, 2026
31 checks passed
@pauldambra pauldambra deleted the posthog-code/fix-session-footer-overlap branch July 8, 2026 09:47
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