fix: open edit-draft screen when tapping a draft in ThreadView

Tapping a note in the thread view toggles the collapse/expand state of
its children. For the user's own drafts, tap now opens the edit-draft
screen (via routeEditDraftTo) so the post can be resumed, matching the
behavior everywhere else a draft is tapped.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VQCNuxdYkfouNN3ujxm3mR
This commit is contained in:
Claude
2026-07-29 16:19:17 +00:00
parent 2496a7fb3d
commit 04243d8dfa
@@ -95,6 +95,7 @@ import com.vitorpamplona.amethyst.ui.components.ZoomableContentView
import com.vitorpamplona.amethyst.ui.feeds.RefresheableBox
import com.vitorpamplona.amethyst.ui.navigation.navs.EmptyNav
import com.vitorpamplona.amethyst.ui.navigation.navs.INav
import com.vitorpamplona.amethyst.ui.navigation.routes.routeEditDraftTo
import com.vitorpamplona.amethyst.ui.navigation.routes.routeFor
import com.vitorpamplona.amethyst.ui.navigation.routes.routeToMessage
import com.vitorpamplona.amethyst.ui.note.CheckAndDisplayEditStatus
@@ -512,7 +513,23 @@ fun RenderThreadFeed(
if (item.idHex == noteId) mutableStateOf(selectedNoteColor) else null
}
val onCollapse = remember(item) { { viewModel.toggleCollapsed(item.idHex) } }
// Tapping a reply collapses/expands its children, except for the user's own
// drafts: those open the edit-draft screen so the post can be resumed, matching
// the behavior everywhere else a draft is tapped.
val onClick =
remember(item) {
{
if (item.isDraft()) {
nav.nav {
withContext(Dispatchers.IO) {
routeEditDraftTo(item, accountViewModel.account)
}
}
} else {
viewModel.toggleCollapsed(item.idHex)
}
}
}
NoteCompose(
baseNote = item,
@@ -523,7 +540,7 @@ fun RenderThreadFeed(
parentBackgroundColor = background,
accountViewModel = accountViewModel,
nav = nav,
onClick = onCollapse,
onClick = onClick,
)
}