From 3c73028c8065e3bb6bd1aff6c952c561c06f6461 Mon Sep 17 00:00:00 2001 From: Jean-Luc Makiola Date: Mon, 6 Jul 2026 22:28:31 +0200 Subject: [PATCH] Wrap long event titles in the edit screen (#33) The edit-screen title field was single-line, so long titles scrolled off one line instead of wrapping. Make it multi-line so it wraps and grows vertically, matching the detail screen and Google Calendar. A title is still one logical line: strip any newline the IME's Enter key or a paste would introduce in setTitle, so no line break reaches the provider's TITLE column. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../de/jeanlucmakiola/calendula/ui/edit/EventEditScreen.kt | 6 +++++- .../jeanlucmakiola/calendula/ui/edit/EventEditViewModel.kt | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/de/jeanlucmakiola/calendula/ui/edit/EventEditScreen.kt b/app/src/main/java/de/jeanlucmakiola/calendula/ui/edit/EventEditScreen.kt index ac1c6f9..fe7182f 100644 --- a/app/src/main/java/de/jeanlucmakiola/calendula/ui/edit/EventEditScreen.kt +++ b/app/src/main/java/de/jeanlucmakiola/calendula/ui/edit/EventEditScreen.kt @@ -520,13 +520,17 @@ private fun EventEditContent( .padding(start = 24.dp, end = 24.dp, top = 8.dp, bottom = 40.dp), ) { // Title: borderless headline, mirroring the detail screen's title + - // accent bar instead of a boxed Material text field. + // accent bar instead of a boxed Material text field. Multi-line so long + // titles wrap instead of scrolling off one line (#33); newlines are + // stripped in setTitle, so this stays a single logical line — the Enter + // key just has no effect. InlineField( value = form.title, onValueChange = viewModel::setTitle, placeholder = stringResource(R.string.event_edit_title_hint), textStyle = MaterialTheme.typography.headlineMedium .copy(fontWeight = FontWeight.SemiBold), + singleLine = false, enabled = !locked, modifier = Modifier .fillMaxWidth() diff --git a/app/src/main/java/de/jeanlucmakiola/calendula/ui/edit/EventEditViewModel.kt b/app/src/main/java/de/jeanlucmakiola/calendula/ui/edit/EventEditViewModel.kt index fe1ec73..e2da425 100644 --- a/app/src/main/java/de/jeanlucmakiola/calendula/ui/edit/EventEditViewModel.kt +++ b/app/src/main/java/de/jeanlucmakiola/calendula/ui/edit/EventEditViewModel.kt @@ -336,7 +336,11 @@ class EventEditViewModel @Inject constructor( _revealed.value = _revealed.value + field } - fun setTitle(value: String) = update { it.copy(title = value) } + // The title field wraps (multi-line) so long titles stay visible (#33), but + // a title is one logical line: drop any newline the IME's Enter key or a + // paste would introduce, so it never reaches the provider's TITLE column. + fun setTitle(value: String) = + update { it.copy(title = value.replace("\n", "").replace("\r", "")) } fun setLocation(value: String) = update { it.copy(location = value) } fun setDescription(value: String) = update { it.copy(description = value) } fun setAllDay(value: Boolean) {