fix: prevent IME from hiding latest messages in chat
Changed chat layout from Box overlay to Column flow so imePadding() applies to the whole container instead of just the input bar. Messages area now shrinks with the keyboard, keeping latest messages visible. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -162,13 +162,13 @@ fun ChatScreen(
|
||||
else -> CyreneStatus.OFFLINE
|
||||
}
|
||||
|
||||
// Input area overlaid at bottom, with IME padding so only input moves up
|
||||
Box(
|
||||
// Single column layout: everything flows together and IME shrinks the whole view
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.fillMaxSize()
|
||||
.statusBarsPadding(),
|
||||
.statusBarsPadding()
|
||||
.imePadding(),
|
||||
) {
|
||||
Column(modifier = Modifier.fillMaxSize()) {
|
||||
// Top status bar
|
||||
Row(
|
||||
modifier = Modifier
|
||||
@@ -179,13 +179,11 @@ fun ChatScreen(
|
||||
StatusIndicator(status = status)
|
||||
}
|
||||
|
||||
// Messages area (fills space above input area)
|
||||
// Messages area (fills remaining space, shrinks with IME)
|
||||
PullToRefreshBox(
|
||||
isRefreshing = isRefreshing,
|
||||
onRefresh = { viewModel.refreshMessages() },
|
||||
modifier = Modifier
|
||||
.weight(1f)
|
||||
.padding(bottom = 96.dp), // Reserve space for floating input bar
|
||||
modifier = Modifier.weight(1f),
|
||||
) {
|
||||
if (messages.isEmpty() && !isStreaming) {
|
||||
Box(
|
||||
@@ -218,16 +216,13 @@ fun ChatScreen(
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Input area at bottom, moved up by IME
|
||||
// Input area at bottom, in flow (not overlaid)
|
||||
Column(
|
||||
modifier = Modifier
|
||||
.align(Alignment.BottomCenter)
|
||||
.fillMaxWidth()
|
||||
.background(MaterialTheme.colorScheme.surface)
|
||||
.navigationBarsPadding()
|
||||
.imePadding(),
|
||||
.navigationBarsPadding(),
|
||||
) {
|
||||
// "昔涟正在输入..." indicator
|
||||
if (isStreaming) {
|
||||
|
||||
Reference in New Issue
Block a user