The code below describes a small Compose screen with a list of drafts and an editing panel for the selected item. After a recent PR, the screen started behaving unpredictably: entered text may end up on the wrong draft, and the selection marker sometimes disappears after Activity recreation.
DraftItem from the ViewModel.id.MainActivity.Pick next button several times to switch to another item.OutlinedTextField.Activity through a system configuration change.id.Activity recreation, the screen should restore the selection by stable identifier, not by temporary position or index.ComponentActivity, without Navigation and without external storageUse line comments to explain the problem, its impact, the fix and how to test it.