iOS: redraw only the blocks when the band widens !231

merged merged by cmc on 2026-10-11 03:14 UTC · krz/orgstar:claude/gracious-lalande-edc4f9 into main

Discussion

cmc

Builds on MR 230 (claude/jovial-meitner-d68a71) and includes its commit; merge that first, or rebase this one.

viewResized() laid the whole file out again whenever the block band's width changed. In truncate mode KeyedTextView.layoutSubviews grows contentSize.width on each pass that meets a wider line, so scrolling a truncated file relaid out the whole document repeatedly and moved the text under the view, the same mechanism as the fold jump MR 230 fixed.

Only shaded block fragments read the band's width, so a band change now redraws the shaded ranges alone (invalidateRenderingAttributes plus invalidateLayout per range, via redraw(blocks:), extracted from redrawSelectedBlocks()). A change to the view's own width (rotation, split view) still lays out the whole file, now inside keepingTopLine.

Also drops @retroactive on AgendaItem: Identifiable in AgendaScreen.swift: Xcode 27 rejects it on a same-package type and the target did not build.

Verified: xcodebuild -scheme OrgstarMobile -destination 'generic/platform=iOS Simulator' build succeeds; swift test passes (110 tests).