//editor/com.aardarch.aardink.ui/FindReplacePanel
FindReplacePanel
@Composablefun FindReplacePanel(state: FindReplaceState, onNext: () -> Unit, onPrev: () -> Unit, onReplace: () -> Unit, onReplaceAll: () -> Unit, onClose: () -> Unit, modifier: Modifier = Modifier)
Slide-down find/replace panel anchored to the top of the editor.
The panel mutates state directly. The host (typically CodeEditorLayout) is responsible for watching the state and re-running com.aardarch.aardink.core.FindEngine.findAll on changes.
It takes the keyboard focus when it opens and on every FindReplaceState.show: the find field, or the replace field when opened for replacing with something already to find. In its fields, Enter goes to the next match (Shift+Enter to the previous one, and Enter in the replace field replaces the current match), and Escape closes the panel.
Parameters
| Name | Summary |
|---|---|
| state | The state holder backing this panel. |
| onNext | User pressed the “next match” arrow — host should scroll/select that match. |
| onPrev | User pressed the “previous match” arrow. |
| onReplace | Replace the current match with FindReplaceState.replacement. |
| onReplaceAll | Replace every match in the document. |
| onClose | Close the panel (typically calls FindReplaceState.hide). |