fix(chat): more room above the composer and the typing bubble
- Last message keeps 16 px to the input box - Typing bubble keeps 16 px to the message above Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@@ -146,7 +146,8 @@ const PROGRESS_BAR_WIDTH: f32 = 0.35;
146
146
const TYPING_BUBBLE_HEIGHT: f32 = 28.;
147
147
const TYPING_BUBBLE_PADDING: f32 = 12.;
148
148
const TYPING_SIDE_INSET: f32 = 20.;
149
const COMPOSER_TOP_GAP: f32 = 8.;
149
const COMPOSER_TOP_GAP: f32 = 16.;
150
const TYPING_TOP_GAP: f32 = 16.;
150
151
const TYPING_BOTTOM_GAP: f32 = 8.;
151
152
pub const TYPING_TAG: &str = "shell/islands/main/typing";
152
153
const TYPING_DOT_SIZE: f32 = 5.;
@@ -4120,7 +4121,7 @@ impl Render for ConversationView {
4120
4121
})
4121
4122
})
4122
4123
.with_list_style(StyleRefinement::default().pb(px(if typing_line.is_some() {
4123
TYPING_BUBBLE_HEIGHT + 2. * TYPING_BOTTOM_GAP
4124
TYPING_TOP_GAP + TYPING_BUBBLE_HEIGHT + TYPING_BOTTOM_GAP
4124
4125
} else if in_feed {
4125
4126
0.
4126
4127
} else {
@@ -4318,7 +4319,7 @@ fn typing_bottom_offset(timeline: Option<Bounds<Pixels>>, last_row: Option<Bound
4318
4319
return TYPING_BOTTOM_GAP;
4319
4320
};
4320
4321
let under_last_row = f32::from(timeline.bottom() - last_row.bottom())
4321
- TYPING_BOTTOM_GAP
4322
- TYPING_TOP_GAP
4322
4323
- TYPING_BUBBLE_HEIGHT;
4323
4324
under_last_row.max(TYPING_BOTTOM_GAP)
4324
4325
}
@@ -4558,7 +4559,7 @@ mod tests {
4558
4559
use gpui_kit::{Bounds, point, px, size};
4559
4560
let timeline = Bounds::new(point(px(0.), px(100.)), size(px(800.), px(600.)));
4560
4561
let row_ending_at = |bottom: f32| Some(Bounds::new(point(px(0.), px(bottom - 50.)), size(px(800.), px(50.))));
4561
assert_eq!(typing_bottom_offset(Some(timeline), row_ending_at(400.)), 264.);
4562
assert_eq!(typing_bottom_offset(Some(timeline), row_ending_at(400.)), 256.);
4562
4563
assert_eq!(typing_bottom_offset(Some(timeline), row_ending_at(900.)), 8.);
4563
4564
assert_eq!(typing_bottom_offset(Some(timeline), None), 8.);
4564
4565
}
@@ -146,7 +146,8 @@ const PROGRESS_BAR_WIDTH: f32 = 0.35;146
const TYPING_BUBBLE_HEIGHT: f32 = 28.;146
const TYPING_BUBBLE_HEIGHT: f32 = 28.;147
const TYPING_BUBBLE_PADDING: f32 = 12.;147
const TYPING_BUBBLE_PADDING: f32 = 12.;148
const TYPING_SIDE_INSET: f32 = 20.;148
const TYPING_SIDE_INSET: f32 = 20.;149
const COMPOSER_TOP_GAP: f32 = 8.;149
const COMPOSER_TOP_GAP: f32 = 16.;150
const TYPING_TOP_GAP: f32 = 16.;150
const TYPING_BOTTOM_GAP: f32 = 8.;151
const TYPING_BOTTOM_GAP: f32 = 8.;151
pub const TYPING_TAG: &str = "shell/islands/main/typing";152
pub const TYPING_TAG: &str = "shell/islands/main/typing";152
const TYPING_DOT_SIZE: f32 = 5.;153
const TYPING_DOT_SIZE: f32 = 5.;@@ -4120,7 +4121,7 @@ impl Render for ConversationView {4120
})4121
})4121
})4122
})4122
.with_list_style(StyleRefinement::default().pb(px(if typing_line.is_some() {4123
.with_list_style(StyleRefinement::default().pb(px(if typing_line.is_some() {4123
TYPING_BUBBLE_HEIGHT + 2. * TYPING_BOTTOM_GAP4124
TYPING_TOP_GAP + TYPING_BUBBLE_HEIGHT + TYPING_BOTTOM_GAP4124
} else if in_feed {4125
} else if in_feed {4125
0.4126
0.4126
} else {4127
} else {@@ -4318,7 +4319,7 @@ fn typing_bottom_offset(timeline: Option<Bounds<Pixels>>, last_row: Option<Bound4318
return TYPING_BOTTOM_GAP;4319
return TYPING_BOTTOM_GAP;4319
};4320
};4320
let under_last_row = f32::from(timeline.bottom() - last_row.bottom())4321
let under_last_row = f32::from(timeline.bottom() - last_row.bottom())4321
- TYPING_BOTTOM_GAP4322
- TYPING_TOP_GAP4322
- TYPING_BUBBLE_HEIGHT;4323
- TYPING_BUBBLE_HEIGHT;4323
under_last_row.max(TYPING_BOTTOM_GAP)4324
under_last_row.max(TYPING_BOTTOM_GAP)4324
}4325
}@@ -4558,7 +4559,7 @@ mod tests {4558
use gpui_kit::{Bounds, point, px, size};4559
use gpui_kit::{Bounds, point, px, size};4559
let timeline = Bounds::new(point(px(0.), px(100.)), size(px(800.), px(600.)));4560
let timeline = Bounds::new(point(px(0.), px(100.)), size(px(800.), px(600.)));4560
let row_ending_at = |bottom: f32| Some(Bounds::new(point(px(0.), px(bottom - 50.)), size(px(800.), px(50.))));4561
let row_ending_at = |bottom: f32| Some(Bounds::new(point(px(0.), px(bottom - 50.)), size(px(800.), px(50.))));4561
assert_eq!(typing_bottom_offset(Some(timeline), row_ending_at(400.)), 264.);4562
assert_eq!(typing_bottom_offset(Some(timeline), row_ending_at(400.)), 256.);4562
assert_eq!(typing_bottom_offset(Some(timeline), row_ending_at(900.)), 8.);4563
assert_eq!(typing_bottom_offset(Some(timeline), row_ending_at(900.)), 8.);4563
assert_eq!(typing_bottom_offset(Some(timeline), None), 8.);4564
assert_eq!(typing_bottom_offset(Some(timeline), None), 8.);4564
}4565
}