From 8aacd1f753c7ef21a7e1173cc08c5b0a85a94c6b Mon Sep 17 00:00:00 2001 From: Tommaso Negri Date: Wed, 14 Oct 2026 22:05:54 +0200 Subject: fix block interaction capture warning --- tasks/20261014-192419/TASK.md | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'tasks/20261014-192419') diff --git a/tasks/20261014-192419/TASK.md b/tasks/20261014-192419/TASK.md index c909da9..50f9919 100644 --- a/tasks/20261014-192419/TASK.md +++ b/tasks/20261014-192419/TASK.md @@ -1,6 +1,6 @@ # Resolve BlockView capture warning and clarify monitor lifetime -- STATUS: OPEN +- STATUS: CLOSED - PRIORITY: 190 - TAGS: review,quality,ui @@ -13,3 +13,23 @@ Approach: Inspect the actual closure ownership chain and choose explicit, intent Completion checks: A clean swift build/test has no warning from this capture. Click/scroll receives correct current hover data. Hide/show and any applied screen-rebuild patch do not accumulate monitors, duplicate command dispatch, or retain discarded views/windows. Manually verify lifecycle behavior before claiming leak prevention. Design constraint: Follow README.md: keep source-based configuration, no dependencies or plugin framework, and use the smallest readable change that makes the existing behavior reliable. This is a suggestion for individual review, not a deadline. Findings were recorded on 2026-10-14; re-check the current code before implementing. + +## Implementation and validation + +Implemented explicit weak captures through a per-view BlockInteraction owner. +Registration is idempotent; disappearance removes the monitor and clears hover, +and an isolated deinitializer removes any remaining monitor when its owner is +released. Rendering and hover use line positions, resolving CELL against current +block output and rejecting positions removed by a refresh. This supplies the +BlockView portion of task 20261014-191457 without changing Cell's public model. + +A clean swift test build passes the monitor registration/restart, weak owner and +block lifetime, and refreshed/removed hover regression tests. No capture warning +remains. The optional screen-hotplug patch is not applied (it targets the old +Models/AppDelegate.swift path). + +Status remains OPEN pending manual UI verification: repeat hide/show, click and +scroll after output refresh/shrink, check multiple windows and hover transitions, +and discard/rebuild hosting windows while checking monitor dispatch and window +release. Automated owner lifetime tests do not establish that SwiftUI releases +hosting state in every UI lifecycle path; leak prevention is not claimed. -- cgit v1.2.3