Phase 6, step 7, and the prerequisite for the pane work rather than a tidy-up:
the transcript has to render at 400dp as a whole screen and at 900dp as the
detail half of a two-pane layout, and a layout that lives in a view model cannot
be composed twice or previewed once.
`ChatMessageListViewModel` was 1,113 lines, of which 380 were
`RenderMessages` -- a `@Composable` member function holding a `LazyColumn`, a
`DropdownMenu`, `Card`s and both of the app's only two `BoxWithConstraints` --
plus three private composables under the class. It is now 356 lines of state and
coroutines, and `ui/composable/widgets/chat/ChatTranscript.kt` is 779 lines of
layout.
**The move is verbatim.** `ProposalsAwaitingYouNotice`, `PrivateMessageNotice`
and `RitualNotice` are byte-identical -- `diff` says so. `RenderMessages` becomes
`ChatTranscript` and differs by exactly the signature line and fourteen
references that had been resolving against the enclosing class and now say
`viewModel.`. Nothing was rewritten while it was in the air; the diff is small
enough to read line by line, which is the only reason to move 760 lines in one
commit.
**Why a parameter and not a receiver.** Keeping it as
`fun ChatMessageListViewModel.ChatTranscript(...)` would have made the diff a
single word, and left every one of those fourteen reads bare. `openMessageActionsFor`
read bare says nothing about where it is kept; `viewModel.openMessageActionsFor`
says it survives the composition, which is the fact a reader of a transcript
needs and the one a pane split will make load-bearing.
**Two imports the extraction nearly lost.** `androidx.compose.runtime.getValue`
and `setValue` are used implicitly, by `by mutableStateOf`, so a "drop imports
whose name does not appear" pass drops both and the five delegated properties
stop compiling. The compiler caught it; noting it because the same pass over the
next file will do the same thing. The earlier version of that pass also required
an import's name not to follow a dot, which silently dropped every
`Modifier.fillMaxWidth()`-shaped extension.
`:composeApp:compileDebugKotlinAndroid`, `:composeApp:compileKotlinJvm` and the
jvm test suite all green. The three `Icons.Filled` deprecation warnings in the
new file came with the code and are unchanged.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>