From f802039757d5da01a2b7cb7d1b15c692f137d91f Mon Sep 17 00:00:00 2001 From: Tommaso Negri Date: Wed, 14 Oct 2026 21:58:57 +0200 Subject: add tasks --- tasks/20261014-191342/TASK.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tasks/20261014-191342/TASK.md (limited to 'tasks/20261014-191342') diff --git a/tasks/20261014-191342/TASK.md b/tasks/20261014-191342/TASK.md new file mode 100644 index 0000000..59f494c --- /dev/null +++ b/tasks/20261014-191342/TASK.md @@ -0,0 +1,15 @@ +# Serialize block commands and preserve gesture order + +- STATUS: OPEN +- PRIORITY: 30 +- TAGS: review,bug,core + +Files: Sources/bar/Models/Block.swift, Sources/bar/Views/BlockView.swift, and behavioral tests. + +Problem: Every timer tick, Darwin notification, click, and scroll starts a detached command. Earlier slow results can overwrite newer output; bursts can launch many processes and race script side effects. + +Approach: Give each block one running command. Coalesce ordinary refresh requests into at most one pending refresh, while retaining ordered gesture requests and their BUTTON/SCROLL/CELL environment snapshots. Explicitly review how pending gestures and refreshes interleave. A generation counter alone fixes stale display results but does not serialize side effects. Keep the implementation local to Block and readable; avoid introducing a generic scheduling framework. Consider what a large gesture burst should do without silently losing user actions. + +Completion checks: Controlled slow and fast commands cannot produce stale overwrites. A refresh burst has bounded pending refresh work. Click/scroll side effects execute in order, with correct environment values. Separate blocks can still run independently and main-actor UI remains responsive. Reuse Runner timeout behavior rather than duplicating process control. + +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. -- cgit v1.2.3