thread view: Prevent user message controls to be cut-off (#36865)

In the thread view, when focusing on the user message, we display the
editing control container absolutely-positioned in the top right.
However, if there are no rules items and no restore checkpoint button
_and_ it is the very first message, the editing controls container would
be cut-off. This PR fixes that by giving it a bit more top padding.

Release Notes:

- N/A
This commit is contained in:
Danilo Leal 2025-08-25 10:08:48 -03:00 committed by GitHub
parent 4c0ad95acc
commit 2b5a302972
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1305,14 +1305,23 @@ impl AcpThreadView {
None
};
let has_checkpoint_button = message
.checkpoint
.as_ref()
.is_some_and(|checkpoint| checkpoint.show);
let agent_name = self.agent.name();
v_flex()
.id(("user_message", entry_ix))
.map(|this| if rules_item.is_some() {
.map(|this| {
if entry_ix == 0 && !has_checkpoint_button && rules_item.is_none() {
this.pt_4()
} else if rules_item.is_some() {
this.pt_3()
} else {
this.pt_2()
}
})
.pb_4()
.px_2()