mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-12 01:07:46 +00:00
fix(napplets): expand the "what it can access" section straight down, not from the left
The disclosure used AnimatedVisibility's default transition and the inner servers Column didn't fill width, so the section faded/expanded while the server list also grew in horizontally from the left — an inconsistent, weird effect. Make the transition explicit (fade + expandVertically/shrinkVertically anchored at Top, so it opens/closes straight down like the card) and fill width on the servers column so nothing slides in sideways. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016ncMHuBBVHEf7spAoSssde
This commit is contained in:
+12
-2
@@ -21,6 +21,10 @@
|
||||
package com.vitorpamplona.amethyst.commons.ui.note
|
||||
|
||||
import androidx.compose.animation.AnimatedVisibility
|
||||
import androidx.compose.animation.expandVertically
|
||||
import androidx.compose.animation.fadeIn
|
||||
import androidx.compose.animation.fadeOut
|
||||
import androidx.compose.animation.shrinkVertically
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.border
|
||||
import androidx.compose.foundation.clickable
|
||||
@@ -213,7 +217,13 @@ private fun DetailsDisclosure(
|
||||
)
|
||||
}
|
||||
|
||||
AnimatedVisibility(visible = expanded) {
|
||||
AnimatedVisibility(
|
||||
visible = expanded,
|
||||
// Expand/collapse straight down from the top (matching the card) with a fade — never a
|
||||
// sideways slide. Each child fills width so nothing grows in from the left as it lays out.
|
||||
enter = fadeIn() + expandVertically(expandFrom = Alignment.Top),
|
||||
exit = shrinkVertically(shrinkTowards = Alignment.Top) + fadeOut(),
|
||||
) {
|
||||
Column(
|
||||
modifier = Modifier.fillMaxWidth().padding(top = 6.dp),
|
||||
verticalArrangement = Arrangement.spacedBy(8.dp),
|
||||
@@ -239,7 +249,7 @@ private fun DetailsDisclosure(
|
||||
}
|
||||
|
||||
if (servers.isNotEmpty()) {
|
||||
Column(verticalArrangement = Arrangement.spacedBy(2.dp)) {
|
||||
Column(Modifier.fillMaxWidth(), verticalArrangement = Arrangement.spacedBy(2.dp)) {
|
||||
Text(
|
||||
text = stringResource(Res.string.nsite_servers),
|
||||
style = MaterialTheme.typography.labelMedium,
|
||||
|
||||
Reference in New Issue
Block a user