Skip to content

fix: don't reserve space for attach button when upload is disabled#257

Merged
cpsievert merged 3 commits into
mainfrom
fix/chat-input-upload-padding
Jun 19, 2026
Merged

fix: don't reserve space for attach button when upload is disabled#257
cpsievert merged 3 commits into
mainfrom
fix/chat-input-upload-padding

Conversation

@cpsievert

@cpsievert cpsievert commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

Problem

When allow_attachments is not set (the default), the chat input was still reserving padding-left: 36px on the text field — the same space used by the attach button when uploads are enabled. This left a visible gap on the left side of the input with no button to fill it.

Closes #256

Fix

The unconditional padding-left: 36px on .tiptap is replaced with a :has(.shiny-chat-btn-attach) rule, so left padding is only applied when the attach button is actually rendered in the DOM.

Also removes the dead textarea rule inside .shiny-chat-inputtextarea was replaced by Tiptap in #251 and the CSS was never cleaned up.

When enableUpload is false, the attach button is not rendered, but the
input was still applying padding-left: 36px unconditionally. Use
:has(.shiny-chat-btn-attach) to only add left padding when the button
is actually present.

Closes #256

This comment was marked as resolved.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 3 out of 9 changed files in this pull request and generated 1 comment.

Files not reviewed (2)
  • pkg-py/src/shinychat/www/shinychat.css: Generated file
  • pkg-r/inst/lib/shiny/shinychat.css: Generated file

Comment thread js/src/chat/chat.scss
@cpsievert cpsievert merged commit 94c284f into main Jun 19, 2026
18 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.

Chat input leaves space for the file upload button even if not enabled

2 participants