From cf2854a0291012525f5d4151367c9f2135d2df95 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Tue, 1 Sep 2026 19:01:09 -0400 Subject: [PATCH] ktlint: a multiline .border() left the next '.' orphaned, exactly as #3110 records MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `standard:chain-method-continuation` on `LinkPreviewRow.kt:83`. The `.border(…)` call took three arguments across four lines, and the `.padding(…)` after it then began a line with a `.` — which the rule only accepts glued to the closing paren, `).padding(…)`. Issue #3110 hit this same rule in `NoteCard.kt` and recorded the fix: do not write the multiline element. Naming `shape`, `padH` and `padV` first collapses `.border` back to one line and removes the duplicated RoundedCornerShape at the same time, which is better than what ktlint was willing to accept. Also did what #3110's verification note says to do rather than fixing only the line the linter named: scanned every Kotlin file this branch touched for the same shape — a multiline chain element followed by a `.` on a new line — and found no others. ktlint reports one violation and stops, so a second would have cost another full Android lane. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01K3MMqUtzX1TJgA1oypvm1c --- .../thoughtsync/ui/LinkPreviewRow.kt | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/android/app/src/main/java/com/fabledsword/thoughtsync/ui/LinkPreviewRow.kt b/android/app/src/main/java/com/fabledsword/thoughtsync/ui/LinkPreviewRow.kt index 428afa8..8a5b9cc 100644 --- a/android/app/src/main/java/com/fabledsword/thoughtsync/ui/LinkPreviewRow.kt +++ b/android/app/src/main/java/com/fabledsword/thoughtsync/ui/LinkPreviewRow.kt @@ -70,17 +70,22 @@ fun LinkPreviewCard( compact: Boolean, modifier: Modifier = Modifier, ) { + // Every element of the Modifier chain stays on ONE line, which is why the shape + // and the two paddings are named first. `standard:chain-method-continuation` + // wants a `.` that follows a MULTILINE element glued to its closing paren — + // `).padding(…)` — which is unreadable, so the multiline element is avoided + // instead (Scribe #3110). + val shape = RoundedCornerShape(PREVIEW_RADIUS) + val padH = if (compact) 8.dp else 10.dp + val padV = if (compact) 6.dp else 8.dp + Column( modifier = modifier .fillMaxWidth() - .clip(RoundedCornerShape(PREVIEW_RADIUS)) - .border( - 1.dp, - MaterialTheme.colorScheme.outlineVariant, - RoundedCornerShape(PREVIEW_RADIUS), - ) - .padding(horizontal = if (compact) 8.dp else 10.dp, vertical = if (compact) 6.dp else 8.dp), + .clip(shape) + .border(1.dp, MaterialTheme.colorScheme.outlineVariant, shape) + .padding(horizontal = padH, vertical = padV), ) { preview.siteName?.takeIf { it.isNotBlank() }?.let { site -> Text(