android_catalogue1-7 Exercise 3: Leftover Text in the Tag Box ============================================================== Option A (recommended): treat leftover text as an intended tag. In FormViewModel.save(), first call addTag(s.tagQuery) and then read the state again, so the pending text becomes a chip before saving: fun save(onSaved: () -> Unit) { addTag(_state.value.tagQuery) // no-op if the box is empty val s = _state.value // read AFTER the tag was added ...rest unchanged... } It belongs in the view model: it changes the form's state and the decision "what counts as the user's tags" is a business rule, not a drawing concern. A composable could call it, but then every caller of the form would have to remember to. Option B: do not add silently; instead show an error on the tag box ("Press Add to keep this tag") and block the save. More explicit, and safer if users type things in the box they do not mean as a tag, but it adds a step. Either way, the point is that the data the user can see on screen should match what is saved. A subtle trap: reading `_state.value` BEFORE calling addTag would use the old state and drop the tag anyway.