Skip to content

fix(bots): match Home composer's top padding to the chat composer - #51168

Merged
brennanb2025 merged 3 commits into
mainfrom
brennanb2025/home-composer-top-padding
Nov 27, 2026
Merged

brennanb2025 merged 3 commits into
mainfrom
brennanb2025/home-composer-top-padding

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

When you type in the Bots Home box and the text sits on its own line above the buttons, there was more empty space above the text than in the normal chat box. Now the text starts the same distance below the box's top edge as it does in chat. The buttons along the bottom don't move.

What Changed

  • Before: with the text on its own row (one line once the box is narrow, any multi-line draft, or with the 1 / 2 arrows showing), the first line started 14px below the card's border (8px card padding + 6px editor padding). The chat composer starts its text 10px below (6px + 4px).
  • After: in that stacked layout, when nothing sits above the text (no image thumbnails, reply chip, or notice), the editor's top padding drops from 6px to 2px, so the text starts 10px below the border, the same as chat. The one-line minimum height drops from 32px to 28px to match, so the box gets 4px shorter and its bottom row stays put.
  • Unchanged: the single-row layout where the text sits between + and send (it stays centered on the buttons), the side padding, the bottom padding, the gap between the text and the buttons, and the spacing below images, the reply chip, or a notice.

useBotItemCommentStacked takes a new leads flag (nothing above the text) and adds pt-0.5 / min-h-7 to the stacked classes, including the under-520px container-query stack.

Why

The two composers should look the same. I kept this change inside the stacked layout instead of switching the card to chat's p-1.5. Changing the card padding would also have moved the + / send row, the single-row layout, and the thumbnails and reply chip.

Linked Issue

N/A (internal report from a maintainer).

Visual Proof

These are component fixture renders at 2x in dark theme. The reported case had the 1 / 2 arrows showing, a single typed line, and a narrow box.

Before After
Reported case: one typed line under the 520px break, stacked above the arrows (new stackedOneLine fixture) stacked-before stacked-after
With 1 / 2 arrows, one line (stacked) nav-before nav-after
Multi-line (at its max height) multi-before multi-after
One row, text beside buttons (unchanged) row-before row-after

The chat composer this matches, for reference (unchanged):

native

Testing

  • I manually tested these changes locally. I rendered every BotItemCommentBox fixture (empty, one line, long text, narrow, pasted image, pickers, posted) and the stepper's 260px rows with 1 / 2 arrows, before and after, on Linux. The text in stacked layouts moved up 4px, the bottom row kept its distance from the bottom border, the one-row layouts didn't change, and the image-first layout didn't change.
  • Automated tests added/updated, or explained why not below. No unit test, because this is a spacing-only change. I added a BotItemStepper:stackedOneLine component fixture for the reported layout; its before/after renders are above.
  • Every added test fails without this change and avoids the test anti-patterns. None added.

Performance

None, because this only changes class names that are already computed during each render.

Risk

The riskiest part is the stacked one-line layout: if the leads flag were wrong, text could sit 4px closer to an image or reply chip above it. The flag reads the same image, reply and notice state that renders those elements. Only the Bots Home comment composer is affected. Back out with a plain revert.

Level: Low

AI Disclosure

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

This is CSS only in the renderer, so platform, remote host and mobile behavior is unchanged.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • I stated the risk: what could break, for whom, and how to back it out
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@brennanb2025
brennanb2025 marked this pull request as ready for review November 27, 2026 22:19
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Review status

Problem: In the Bots Home comment box, when the text sits on its own row above the buttons, there were 14px between the box's top edge and the first line of text. The chat composer has 10px.

Change: In that layout, when nothing sits above the text, the text now starts 10px below the top edge, the same as chat. The bottom row of buttons stays where it was. The layout where the text sits between + and send is unchanged, and so is the spacing under images, the reply chip, or a notice.

Verified:

  • Rendered every comment-box fixture (empty, one line, long text, narrow, pasted image, pickers) and the 1 / 2 arrow rows, before and after. Screenshots are in the PR body.
  • remote-check (format, lint, typecheck, related tests, ratchets) passed on this head.
  • One fresh reviewer checked correctness, class conflicts, the height threshold, perf, and the PR body. No findings.

Fixed: nothing needed. Deferred: none.

@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

BotItemCommentField now passes a leads condition to useBotItemCommentStacked. The hook uses that condition to adjust inset padding and editor minimum height when text is stacked, or at the item pane’s 520px breakpoint when it is not stacked. The fixture helper now accepts pane width and item total parameters, and a new fixture covers a short draft in a 420px pane.

Merge Risk: Minimal · up to 18174

This is a small spacing-only adjustment to the Bots Home comment composer with no behavior or performance impact identified. It is low risk to merge.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the Bots Home comment composer's top padding is adjusted to match the chat composer. The title is specific and follows the fix(scope) convention. The diff matches it: …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description is thorough and follows the repository template. It includes ELI5, What Changed, Why, Linked Issue (N/A, internal maintainer report), Visual Proof with before/after renders, Testing, P…
Full details: Title check

Explanation

The title names the main change: the Bots Home comment composer's top padding is adjusted to match the chat composer. The title is specific and follows the fix(scope) convention. The diff matches it: the stacked layout drops the editor top padding from 6px to 2px and the minimum height from 32px to 28px.

Full details: Description check

Explanation

The description is thorough and follows the repository template. It includes ELI5, What Changed, Why, Linked Issue (N/A, internal maintainer report), Visual Proof with before/after renders, Testing, Performance, Risk with level, Agent skill upstream boundary, Notes, and Checklist. The Linked Issue section says N/A rather than linking an issue. The template says an issue should always exist for outside contributors, and this author is a maintainer, so the special case applies. The Performance section is completed. The AI Disclosure and Review sections are empty, which is acceptable for a maintainer per the template note. The final checklist item for lint, typecheck, test, and build is unchecked, but the template allows CI to cover it.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 897c7728-18b5-4063-8ce4-0e95594c1578
Commits

Reviewing files that changed from the base of the PR and between 80eb6e8 and 18174f0.

Files selected for processing: 1

  • src/renderer/src/components/bots/items/BotItemStepper.fixture.tsx

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 1 remain after this review.

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Review status (update)

  • I added a BotItemStepper:stackedOneLine component fixture for the reported layout: one typed line stacked above the arrows. Its before/after renders are in the PR body. The text now starts 4px higher, and the bottom row doesn't move.
  • One fresh reviewer checked the fixture commits and found nothing. The existing wide fixtures render as before.
  • CI is green on this head.

Fixed: nothing needed. Deferred: none.

@brennanb2025
brennanb2025 merged commit af01c61 into main Nov 27, 2026
56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant