fix dead-wired TerminalView.onTapUp callback (T-93)
test / unit + widget + golden + a11y (push) Failing after 28s
test / integration_test (xvfb) (push) Has been skipped
test / bundle smoke (xvfb 5s) (push) Has been skipped
test / daemon subprocess + web WASM smoke (push) Has been skipped
test / dart doc (lib API) (push) Failing after 59s

`TerminalView.onTapUp` was documented as "Callback for when the
user taps on the terminal" but was wired to a code path nothing
ever invoked:

- `TerminalView.build` passed it via `onTapUp:` to
  `TerminalGestureHandler`,
- which forwarded via `onTapUp:` to `TerminalGestureDetector`,
- whose `onTapUp` field was declared and accepted but never called
  by `_handleTapUp` (which only fires `onSingleTapUp`).

Net: every caller that registered an `onTapUp` callback on
`TerminalView` got silent failure. zero in-tree callers depended
on it (clide_pty_view.dart is the only TerminalView callsite and
doesn't pass any tap callback), but the public API said one thing
and did another.

Fix: wire `_onTapUp` (the cell-resolving state-method) through the
detector's working `onSingleTapUp` slot. The user-facing semantics
("fires on confirmed single tap with the resolved cell offset")
match the only sane interpretation of the docstring, and don't
overlap with the existing `onSecondaryTap*` (which were already
correctly wired through TapGestureRecognizer's secondary callbacks).

Also drops the dead surface that surfaced the bug:
- `TerminalGestureHandler.onTapUp` parameter + field — no caller
  passes it after the fix; was only used to forward into the dead
  detector field.
- `TerminalGestureDetector.onTapUp` parameter + field — never
  invoked by `_handleTapUp`. Pure dead code.

Tests: extends `terminal_view_test.dart` with a primary-tap
regression case + paired tests for selection-clearing and
secondary-tap callback routing. The double-tap recognizer's
300 ms timer is flushed via `pump(const Duration(seconds: 1))`
(pumpAndSettle waits for animations, not arbitrary timers).

Coverage delta:
- terminal_view.dart: 151/188 → 180/188 (95.7%; remaining gaps
  are IME `_onComposing`/`_onEditableRect`/`_onKeyboardShow`
  body branches that need deeper IME mocking).
- gesture_handler.dart: 18/60 → 39/59.
- gesture_detector.dart: 30/50 → 42/50.
- Total project: 65.76% → 66.97%; coverage_floor 65 → 66.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-05-07 08:49:09 +02:00
co-authored by Claude
parent fb85dfa6f9
commit 6b7290dc42
7 changed files with 282 additions and 117 deletions
+137 -107
View File
@@ -1,5 +1,5 @@
{
"exported_at": "2026-05-07T06:25:44Z",
"exported_at": "2026-05-07T06:49:09Z",
"decisions": [
{
"id": "D-1",
@@ -9,7 +9,7 @@
"status": "active",
"date": "2026-04-20",
"file_path": "decisions/architecture.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-3",
@@ -19,7 +19,7 @@
"status": "active",
"date": "2026-04-20",
"file_path": "decisions/architecture.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-4",
@@ -29,7 +29,7 @@
"status": "active",
"date": "2026-04-20",
"file_path": "decisions/architecture.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-5",
@@ -39,7 +39,7 @@
"status": "active",
"date": "2026-04-20",
"file_path": "decisions/architecture.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-6",
@@ -49,7 +49,7 @@
"status": "active",
"date": "2026-04-20",
"file_path": "decisions/architecture.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-7",
@@ -59,7 +59,7 @@
"status": "active",
"date": "2026-04-21",
"file_path": "decisions/architecture.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-8",
@@ -69,7 +69,7 @@
"status": "active",
"date": "2026-04-21",
"file_path": "decisions/architecture.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-9",
@@ -79,7 +79,7 @@
"status": "active",
"date": "2026-04-21",
"file_path": "decisions/architecture.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-10",
@@ -89,7 +89,7 @@
"status": "active",
"date": "2026-04-21",
"file_path": "decisions/architecture.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-11",
@@ -99,7 +99,7 @@
"status": "active",
"date": "2026-04-21",
"file_path": "decisions/architecture.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-12",
@@ -109,7 +109,7 @@
"status": "active",
"date": "2026-04-21",
"file_path": "decisions/architecture.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-13",
@@ -119,7 +119,7 @@
"status": "active",
"date": "2026-04-21",
"file_path": "decisions/architecture.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-14",
@@ -129,7 +129,7 @@
"status": "active",
"date": "2026-04-21",
"file_path": "decisions/architecture.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-15",
@@ -139,7 +139,7 @@
"status": "active",
"date": "2026-04-21",
"file_path": "decisions/extensions.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-16",
@@ -149,7 +149,7 @@
"status": "active",
"date": "2026-04-21",
"file_path": "decisions/extensions.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-17",
@@ -159,7 +159,7 @@
"status": "active",
"date": "2026-04-21",
"file_path": "decisions/extensions.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-18",
@@ -169,7 +169,7 @@
"status": "active",
"date": "2026-04-21",
"file_path": "decisions/extensions.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-19",
@@ -179,7 +179,7 @@
"status": "active",
"date": "2026-04-21",
"file_path": "decisions/extensions.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-20",
@@ -189,7 +189,7 @@
"status": "active",
"date": "2026-04-21",
"file_path": "decisions/accessibility.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-21",
@@ -199,7 +199,7 @@
"status": "active",
"date": "2026-04-21",
"file_path": "decisions/accessibility.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-22",
@@ -209,7 +209,7 @@
"status": "active",
"date": "2026-04-21",
"file_path": "decisions/accessibility.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-23",
@@ -219,7 +219,7 @@
"status": "active",
"date": "2026-04-21",
"file_path": "decisions/testing.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-24",
@@ -229,7 +229,7 @@
"status": "active",
"date": "2026-04-21",
"file_path": "decisions/testing.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-25",
@@ -239,7 +239,7 @@
"status": "active",
"date": "2026-04-21",
"file_path": "decisions/testing.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-26",
@@ -249,7 +249,7 @@
"status": "active",
"date": "2026-04-21",
"file_path": "decisions/testing.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-27",
@@ -259,7 +259,7 @@
"status": "active",
"date": "2026-04-21",
"file_path": "decisions/testing.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-28",
@@ -269,7 +269,7 @@
"status": "active",
"date": "2026-04-21",
"file_path": "decisions/testing.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-29",
@@ -279,7 +279,7 @@
"status": "active",
"date": "2026-04-21",
"file_path": "decisions/testing.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-30",
@@ -289,7 +289,7 @@
"status": "active",
"date": "2026-04-21",
"file_path": "decisions/testing.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-31",
@@ -299,7 +299,7 @@
"status": "active",
"date": "2026-04-21",
"file_path": "decisions/tooling.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-32",
@@ -309,7 +309,7 @@
"status": "active",
"date": "2026-04-21",
"file_path": "decisions/tooling.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-33",
@@ -319,7 +319,7 @@
"status": "active",
"date": "2026-04-21",
"file_path": "decisions/tooling.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-34",
@@ -329,7 +329,7 @@
"status": "active",
"date": "2026-04-21",
"file_path": "decisions/process.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-35",
@@ -339,7 +339,7 @@
"status": "active",
"date": "2026-04-21",
"file_path": "decisions/process.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-36",
@@ -349,7 +349,7 @@
"status": "active",
"date": "2026-04-21",
"file_path": "decisions/process.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-37",
@@ -359,7 +359,7 @@
"status": "active",
"date": "2026-04-21",
"file_path": "decisions/process.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-38",
@@ -369,7 +369,7 @@
"status": "active",
"date": "2026-04-21",
"file_path": "decisions/process.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-39",
@@ -379,7 +379,7 @@
"status": "active",
"date": "2026-04-21",
"file_path": "decisions/process.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-40",
@@ -389,7 +389,7 @@
"status": "active",
"date": "2026-04-21",
"file_path": "decisions/process.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-41",
@@ -399,7 +399,7 @@
"status": "active",
"date": "2026-04-22",
"file_path": "decisions/architecture.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-42",
@@ -409,7 +409,7 @@
"status": "active",
"date": "2026-04-22",
"file_path": "decisions/tooling.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-43",
@@ -419,7 +419,7 @@
"status": "active",
"date": "2026-04-22",
"file_path": "decisions/architecture.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-44",
@@ -429,7 +429,7 @@
"status": "active",
"date": "2026-04-22",
"file_path": "decisions/architecture.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-45",
@@ -439,7 +439,7 @@
"status": "active",
"date": "2026-04-22",
"file_path": "decisions/architecture.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-46",
@@ -449,7 +449,7 @@
"status": "active",
"date": "2026-04-22",
"file_path": "decisions/extensions.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-47",
@@ -459,7 +459,7 @@
"status": "active",
"date": "2026-04-22",
"file_path": "decisions/architecture.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-48",
@@ -469,7 +469,7 @@
"status": "active",
"date": "2026-04-22",
"file_path": "decisions/architecture.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-49",
@@ -479,7 +479,7 @@
"status": "active",
"date": "2026-04-22",
"file_path": "decisions/architecture.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-50",
@@ -489,7 +489,7 @@
"status": "active",
"date": "2026-04-22",
"file_path": "decisions/architecture.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-51",
@@ -499,7 +499,7 @@
"status": "active",
"date": "2026-04-22",
"file_path": "decisions/architecture.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-52",
@@ -509,7 +509,7 @@
"status": "active",
"date": "2026-04-22",
"file_path": "decisions/architecture.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-53",
@@ -519,7 +519,7 @@
"status": "active",
"date": "2026-04-22",
"file_path": "decisions/architecture.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-54",
@@ -529,7 +529,7 @@
"status": "active",
"date": "2026-04-22",
"file_path": "decisions/architecture.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-55",
@@ -539,7 +539,7 @@
"status": "active",
"date": "2026-04-23",
"file_path": "decisions/architecture.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-56",
@@ -549,7 +549,7 @@
"status": "active",
"date": "2026-04-23",
"file_path": "decisions/architecture.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-57",
@@ -559,7 +559,7 @@
"status": "active",
"date": "2026-04-23",
"file_path": "decisions/architecture.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-58",
@@ -569,7 +569,7 @@
"status": "active",
"date": "2026-04-23",
"file_path": "decisions/tooling.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-59",
@@ -579,7 +579,7 @@
"status": "active",
"date": "2026-04-25",
"file_path": "decisions/tooling.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-60",
@@ -589,7 +589,7 @@
"status": "active",
"date": "2026-04-26",
"file_path": "decisions/tooling.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-61",
@@ -599,7 +599,7 @@
"status": "active",
"date": "2026-04-26",
"file_path": "decisions/tooling.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-62",
@@ -609,7 +609,7 @@
"status": "active",
"date": "2026-04-26",
"file_path": "decisions/tooling.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-63",
@@ -619,7 +619,7 @@
"status": "active",
"date": "2026-04-26",
"file_path": "decisions/tooling.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-64",
@@ -629,7 +629,7 @@
"status": "active",
"date": "2026-05-03",
"file_path": "decisions/architecture.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-65",
@@ -639,7 +639,7 @@
"status": "active",
"date": "2026-04-26",
"file_path": "decisions/tooling.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "D-66",
@@ -649,7 +649,7 @@
"status": "active",
"date": "2026-05-06",
"file_path": "decisions/testing.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "Q-1",
@@ -658,7 +658,7 @@
"title": "Authorisation granularity on the IPC socket",
"status": "open",
"file_path": "decisions/questions-architecture.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "Q-2",
@@ -667,7 +667,7 @@
"title": "Back-pressure on event streams",
"status": "open",
"file_path": "decisions/questions-architecture.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "Q-3",
@@ -676,7 +676,7 @@
"title": "Event persistence + audit/undo",
"status": "open",
"file_path": "decisions/questions-architecture.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "Q-4",
@@ -685,7 +685,7 @@
"title": "`.canvas` schema compatibility with Obsidian",
"status": "open",
"file_path": "decisions/questions-architecture.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "Q-5",
@@ -694,7 +694,7 @@
"title": "IPC wire-format stability + `schema_version:`",
"status": "open",
"file_path": "decisions/questions-architecture.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "Q-6",
@@ -703,7 +703,7 @@
"title": "Window chrome — native frame vs frameless custom",
"status": "resolved",
"file_path": "decisions/questions-architecture.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "Q-7",
@@ -712,7 +712,7 @@
"title": "macOS app bundle signing / notarisation",
"status": "open",
"file_path": "decisions/questions-architecture.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "Q-8",
@@ -721,7 +721,7 @@
"title": "Extension API shape — widgets, subcommands, both?",
"status": "open",
"file_path": "decisions/questions-extensions.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "Q-9",
@@ -730,7 +730,7 @@
"title": "Lua runtime vendoring",
"status": "open",
"file_path": "decisions/questions-extensions.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "Q-10",
@@ -739,7 +739,7 @@
"title": "Extension manifest `schema_version:`",
"status": "open",
"file_path": "decisions/questions-extensions.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "Q-11",
@@ -748,7 +748,7 @@
"title": "Coverage gates — hard thresholds vs soft reporting",
"status": "open",
"file_path": "decisions/questions-testing.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "Q-12",
@@ -757,7 +757,7 @@
"title": "Screen-reader automation (axe-core via Playwright)",
"status": "open",
"file_path": "decisions/questions-testing.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "Q-13",
@@ -766,7 +766,7 @@
"title": "Web production-mode a11y",
"status": "open",
"file_path": "decisions/questions-accessibility.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "Q-14",
@@ -775,7 +775,7 @@
"title": "i18n plurals / gender / date-format tooling",
"status": "open",
"file_path": "decisions/questions-accessibility.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "Q-15",
@@ -784,7 +784,7 @@
"title": "Editor tab — full LSP vs tree-sitter-only highlight",
"status": "open",
"file_path": "decisions/questions-process.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "Q-16",
@@ -793,7 +793,7 @@
"title": "`tree-sitter-dart` grammar maintenance",
"status": "open",
"file_path": "decisions/questions-process.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "Q-17",
@@ -802,7 +802,7 @@
"title": "Icon set growth",
"status": "open",
"file_path": "decisions/questions-process.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "Q-18",
@@ -811,7 +811,7 @@
"title": "Theme hot-reload in release builds",
"status": "open",
"file_path": "decisions/questions-process.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "Q-19",
@@ -820,7 +820,7 @@
"title": "(withdrawn)",
"status": "resolved",
"file_path": "decisions/questions-process.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "Q-20",
@@ -829,7 +829,7 @@
"title": "Kernel DB service — namespaced SQL access?",
"status": "open",
"file_path": "decisions/questions-process.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "Q-21",
@@ -838,7 +838,7 @@
"title": "Pql absorbs planning vs keeps separate",
"status": "open",
"file_path": "decisions/questions-architecture.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "Q-22",
@@ -847,7 +847,7 @@
"title": "Ticket persistence strategy",
"status": "open",
"file_path": "decisions/questions-architecture.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "Q-23",
@@ -856,7 +856,7 @@
"title": "SSH-remote development — run clide against a remote workspace",
"status": "open",
"file_path": "decisions/questions-architecture.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "Q-25",
@@ -865,7 +865,7 @@
"title": "Body text face — mono everywhere vs Josefin Sans UI + mono code",
"status": "open",
"file_path": "decisions/questions-architecture.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "Q-26",
@@ -874,7 +874,7 @@
"title": "Small screen layout (\u003c 1000px)",
"status": "open",
"file_path": "decisions/questions-architecture.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "Q-27",
@@ -883,7 +883,7 @@
"title": "Two-editor split",
"status": "open",
"file_path": "decisions/questions-architecture.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "Q-28",
@@ -892,7 +892,7 @@
"title": "Terminal strip scope — shell only or logs/errors/tests",
"status": "open",
"file_path": "decisions/questions-architecture.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "Q-29",
@@ -901,7 +901,7 @@
"title": "Branch picker location",
"status": "open",
"file_path": "decisions/questions-architecture.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "Q-30",
@@ -910,7 +910,7 @@
"title": "Focus behavior when editor is dirty and viewer is peeked",
"status": "open",
"file_path": "decisions/questions-architecture.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "Q-31",
@@ -919,7 +919,7 @@
"title": "XWayland fallback for frameless — proper Wayland protocol needed",
"status": "open",
"file_path": "decisions/questions-architecture.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "R-2",
@@ -929,7 +929,7 @@
"status": "active",
"date": "2026-04-20",
"file_path": "decisions/rejected.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "R-3",
@@ -939,7 +939,7 @@
"status": "active",
"date": "2026-04-21",
"file_path": "decisions/rejected.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "R-4",
@@ -949,7 +949,7 @@
"status": "active",
"date": "2026-04-21",
"file_path": "decisions/rejected.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "R-5",
@@ -959,7 +959,7 @@
"status": "active",
"date": "2026-04-21",
"file_path": "decisions/rejected.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "R-6",
@@ -969,7 +969,7 @@
"status": "active",
"date": "2026-04-21",
"file_path": "decisions/rejected.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "R-7",
@@ -979,7 +979,7 @@
"status": "active",
"date": "2026-04-21",
"file_path": "decisions/rejected.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "R-8",
@@ -989,7 +989,7 @@
"status": "active",
"date": "2026-04-21",
"file_path": "decisions/rejected.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "R-9",
@@ -999,7 +999,7 @@
"status": "active",
"date": "2026-04-21",
"file_path": "decisions/rejected.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "R-10",
@@ -1009,7 +1009,7 @@
"status": "active",
"date": "2026-04-21",
"file_path": "decisions/rejected.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "R-11",
@@ -1019,7 +1019,7 @@
"status": "active",
"date": "2026-04-21",
"file_path": "decisions/rejected.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
},
{
"id": "R-12",
@@ -1029,7 +1029,7 @@
"status": "active",
"date": "2026-04-22",
"file_path": "decisions/rejected.md",
"synced_at": "2026-05-07 06:24:06"
"synced_at": "2026-05-07 06:48:06"
}
],
"decision_refs": [
@@ -2801,6 +2801,16 @@
"priority": "high",
"created_at": "2026-05-07 05:51:48",
"updated_at": "2026-05-07 05:58:51"
},
{
"id": "T-93",
"type": "bug",
"title": "TerminalView.onTapUp callback is wired to a dead path",
"description": "**File:** `lib/src/terminal/src/terminal_view.dart` (param + wiring) + `lib/src/terminal/src/ui/gesture/gesture_handler.dart` (pass-through) + `lib/src/terminal/src/ui/gesture/gesture_detector.dart` (dead field).\n\n**Bug:** `TerminalView.onTapUp` is documented as \"Callback for when the user taps on the terminal\" but is wired to a code path that is never executed:\n\n1. `TerminalView.build` passes `onTapUp: _onTapUp` to `TerminalGestureHandler` (terminal_view.dart:304).\n2. `TerminalGestureHandler.build` forwards via `onTapUp: widget.onTapUp` to `TerminalGestureDetector` (gesture_handler.dart:67).\n3. `TerminalGestureDetector._handleTapUp` (gesture_detector.dart:84) fires only `widget.onSingleTapUp`, never `widget.onTapUp`. The `onTapUp` field on `TerminalGestureDetector` (declared at line 31) is never invoked anywhere in the file.\n\nThe `_onTapUp` method on `TerminalViewState` itself is also dead — it's only referenced from the dead-field path above.\n\n**Two layers of \"dead\" here:**\n\n- The **wiring** is dead — nothing inside the terminal renderer calls into `widget.onTapUp` after the field is set.\n- The **public API surface** has zero in-tree callers. The single `TerminalView` callsite is `lib/widgets/src/clide_pty_view.dart`, and it doesn't pass any tap callback.\n\nSo no production code depends on this parameter; nothing observable changes regardless of which way it gets resolved. (TerminalView's `onSecondaryTapDown` / `onSecondaryTapUp` are wired correctly — `TapGestureRecognizer.onSecondaryTap*` fires them directly. Only `onTapUp` is bad.)\n\n**Two clean resolutions:**\n\n- **A. Fix the wiring.** Call `widget.onTapUp` from `_handleTapUp` (gesture_detector.dart:84) so the parameter does what its docstring claims. Risk: the existing `onSingleTapUp` semantics (gated on `!_isDoubleTap`) need a clearly-defined relationship to `onTapUp` — pick one of:\n - `onTapUp` fires on every tap up (raw); `onSingleTapUp` fires only on confirmed singles.\n - Collapse the two into a single hook and document the contract.\n- **B. Delete the dead surface.** Remove `onTapUp` from `TerminalView`, `TerminalGestureHandler`, and `TerminalGestureDetector` (plus the `_onTapUp` method on `TerminalViewState`). Cleanest because no caller is broken — the surface is documented but unused. If a future caller wants tap notifications, expose `onSingleTapUp` (which works) or re-add `onTapUp` *with wiring* at that point.\n\nRecommendation: **option B**. The \"remove unused public API\" pattern matches the no-pre-existing-excuse / dead-code cleanups in this campaign (the keytab-token defensive throws, the `_LineBuilder.isEmpty` getter, the `_buildDispatcher` rename). If a feature is needed later, add it back deliberately with tests and a real caller.\n\n**Acceptance:**\n\n- Either:\n - **A:** `TerminalView.onTapUp` fires on every tap up; new widget test in `test/terminal/terminal_view_test.dart` verifies the callback runs with a `CellOffset`. Document the contract on the docstring.\n - **B:** `TerminalView.onTapUp` parameter removed; `_onTapUp` method on `TerminalViewState` removed; `onTapUp` parameter on `TerminalGestureHandler` removed; `onTapUp` field + setter on `TerminalGestureDetector` removed. Existing tests still pass.\n- No regression in secondary-tap behaviour (those parameters are wired correctly via `TapGestureRecognizer.onSecondary*`).\n\n**Surfaced from:** T-91 test sweep on `terminal_view.dart`. The widget test that registered `onTapUp` and tapped via `tester.tap` confirmed the callback never fires regardless of `pumpAndSettle` / gesture flushing.\n\n**Cross-references:** T-91 (epic parent), T-89 (coverage epic).\n",
"status": "in_progress",
"priority": "high",
"created_at": "2026-05-07 06:33:47",
"updated_at": "2026-05-07 06:45:24"
}
],
"ticket_deps": null,
@@ -4459,6 +4469,26 @@
"old_value": "in_progress",
"new_value": "done",
"changed_at": "2026-05-07 05:58:51"
},
{
"ticket_id": "T-93",
"field": "description",
"new_value": "**File:** `lib/src/terminal/src/ui/terminal_view.dart` + `gesture/gesture_handler.dart` + `gesture/gesture_detector.dart`.\n\n**Bug:** The `TerminalView.onTapUp` callback parameter (declared at `terminal_view.dart:91`, documented as \"Callback for when the user taps on the terminal\") is wired to a path that is never executed. Internal trace:\n\n1. `TerminalView.build` passes `onTapUp: _onTapUp` to `TerminalGestureHandler` (terminal_view.dart:304).\n2. `TerminalGestureHandler.build` forwards via `onTapUp: widget.onTapUp` to `TerminalGestureDetector` (gesture_handler.dart:67).\n3. `TerminalGestureDetector._handleTapUp` (gesture_detector.dart:84) fires only `widget.onSingleTapUp`, never `widget.onTapUp`. The `onTapUp` field on `TerminalGestureDetector` is declared (gesture_detector.dart:31) but never invoked.\n\nIndependently, `TerminalGestureHandler` exposes an `onSingleTapUp` parameter that *is* properly wired (handler line 139 calls `_tapUp(widget.onSingleTapUp, ...)`), but `TerminalView` never passes a value for it.\n\nNet result: the public `TerminalView.onTapUp` API is silently a no-op. Any caller passing `onTapUp:` to `TerminalView` thinks they registered for tap notifications, but the callback never fires.\n\n**Trigger paths in production:**\n\n`TerminalView.onTapUp` is called by anyone who wants to intercept terminal taps (e.g. for a custom click-to-position cursor, hyperlink detection, click telemetry). Surfaced during T-91's TerminalView widget tests: a test that registered `onTapUp` via `tester.tap` confirmed the callback never fires.\n\n**Acceptance:**\n- `TerminalView.onTapUp` fires on every tap up over the widget (or only confirmed single taps — pick one and document the contract; both shapes are reasonable for terminal selection).\n- `TerminalView.onSingleTapUp` either becomes a public parameter on `TerminalView` (mirroring TerminalGestureHandler), or the docstring on `onTapUp` is clarified to match what actually happens.\n- New widget test in `test/terminal/terminal_view_test.dart` that registers a callback, taps with `tester.tap` + `pumpAndSettle`, and asserts the callback ran with the resolved `CellOffset`.\n- Any pre-existing internal use of `TerminalGestureDetector.onTapUp` vs. `onSingleTapUp` should be reviewed: pick one canonical hook for \"tap completed\" and remove the other, or document the difference.\n\n**Investigation notes:**\n\n- `TerminalGestureDetector` declares both `onTapUp` and `onSingleTapUp` (lines 31 / 33). Only the latter is ever invoked. The `onTapUp` field is therefore dead surface.\n- The cleanest fix shape: have `_handleTapUp` (gesture_detector.dart:84) call `widget.onTapUp` *in addition to* (or instead of) `widget.onSingleTapUp`, depending on the desired contract:\n - **Option A** — fire `onTapUp` on every up event (raw); fire `onSingleTapUp` only on confirmed singles. Most flexible.\n - **Option B** — collapse to a single hook (`onTapUp`) and remove `onSingleTapUp`. Simpler but loses the double-tap distinction.\n- Either option needs verification against the existing single/double-tap timer flow. Don't pick without re-reading how `_isDoubleTap` is used.\n\n**Surfaced from:** T-91 test sweep on `terminal_view.dart`. Documented in the test file as \"skipped — see T-93\".\n\n**Cross-references:** T-91 (epic parent for the test sweep that found this), T-89 (coverage epic), the `onTapUp` test stubbed in `test/terminal/terminal_view_test.dart` will become live once the wiring is fixed.\n",
"changed_at": "2026-05-07 06:34:22"
},
{
"ticket_id": "T-93",
"field": "description",
"old_value": "**File:** `lib/src/terminal/src/ui/terminal_view.dart` + `gesture/gesture_handler.dart` + `gesture/gesture_detector.dart`.\n\n**Bug:** The `TerminalView.onTapUp` callback parameter (declared at `terminal_view.dart:91`, documented as \"Callback for when the user taps on the terminal\") is wired to a path that is never executed. Internal trace:\n\n1. `TerminalView.build` passes `onTapUp: _onTapUp` to `TerminalGestureHandler` (terminal_view.dart:304).\n2. `TerminalGestureHandler.build` forwards via `onTapUp: widget.onTapUp` to `TerminalGestureDetector` (gesture_handler.dart:67).\n3. `TerminalGestureDetector._handleTapUp` (gesture_detector.dart:84) fires only `widget.onSingleTapUp`, never `widget.onTapUp`. The `onTapUp` field on `TerminalGestureDetector` is declared (gesture_detector.dart:31) but never invoked.\n\nIndependently, `TerminalGestureHandler` exposes an `onSingleTapUp` parameter that *is* properly wired (handler line 139 calls `_tapUp(widget.onSingleTapUp, ...)`), but `TerminalView` never passes a value for it.\n\nNet result: the public `TerminalView.onTapUp` API is silently a no-op. Any caller passing `onTapUp:` to `TerminalView` thinks they registered for tap notifications, but the callback never fires.\n\n**Trigger paths in production:**\n\n`TerminalView.onTapUp` is called by anyone who wants to intercept terminal taps (e.g. for a custom click-to-position cursor, hyperlink detection, click telemetry). Surfaced during T-91's TerminalView widget tests: a test that registered `onTapUp` via `tester.tap` confirmed the callback never fires.\n\n**Acceptance:**\n- `TerminalView.onTapUp` fires on every tap up over the widget (or only confirmed single taps — pick one and document the contract; both shapes are reasonable for terminal selection).\n- `TerminalView.onSingleTapUp` either becomes a public parameter on `TerminalView` (mirroring TerminalGestureHandler), or the docstring on `onTapUp` is clarified to match what actually happens.\n- New widget test in `test/terminal/terminal_view_test.dart` that registers a callback, taps with `tester.tap` + `pumpAndSettle`, and asserts the callback ran with the resolved `CellOffset`.\n- Any pre-existing internal use of `TerminalGestureDetector.onTapUp` vs. `onSingleTapUp` should be reviewed: pick one canonical hook for \"tap completed\" and remove the other, or document the difference.\n\n**Investigation notes:**\n\n- `TerminalGestureDetector` declares both `onTapUp` and `onSingleTapUp` (lines 31 / 33). Only the latter is ever invoked. The `onTapUp` field is therefore dead surface.\n- The cleanest fix shape: have `_handleTapUp` (gesture_detector.dart:84) call `widget.onTapUp` *in addition to* (or instead of) `widget.onSingleTapUp`, depending on the desired contract:\n - **Option A** — fire `onTapUp` on every up event (raw); fire `onSingleTapUp` only on confirmed singles. Most flexible.\n - **Option B** — collapse to a single hook (`onTapUp`) and remove `onSingleTapUp`. Simpler but loses the double-tap distinction.\n- Either option needs verification against the existing single/double-tap timer flow. Don't pick without re-reading how `_isDoubleTap` is used.\n\n**Surfaced from:** T-91 test sweep on `terminal_view.dart`. Documented in the test file as \"skipped — see T-93\".\n\n**Cross-references:** T-91 (epic parent for the test sweep that found this), T-89 (coverage epic), the `onTapUp` test stubbed in `test/terminal/terminal_view_test.dart` will become live once the wiring is fixed.\n",
"new_value": "**File:** `lib/src/terminal/src/terminal_view.dart` (param + wiring) + `lib/src/terminal/src/ui/gesture/gesture_handler.dart` (pass-through) + `lib/src/terminal/src/ui/gesture/gesture_detector.dart` (dead field).\n\n**Bug:** `TerminalView.onTapUp` is documented as \"Callback for when the user taps on the terminal\" but is wired to a code path that is never executed:\n\n1. `TerminalView.build` passes `onTapUp: _onTapUp` to `TerminalGestureHandler` (terminal_view.dart:304).\n2. `TerminalGestureHandler.build` forwards via `onTapUp: widget.onTapUp` to `TerminalGestureDetector` (gesture_handler.dart:67).\n3. `TerminalGestureDetector._handleTapUp` (gesture_detector.dart:84) fires only `widget.onSingleTapUp`, never `widget.onTapUp`. The `onTapUp` field on `TerminalGestureDetector` (declared at line 31) is never invoked anywhere in the file.\n\nThe `_onTapUp` method on `TerminalViewState` itself is also dead — it's only referenced from the dead-field path above.\n\n**Two layers of \"dead\" here:**\n\n- The **wiring** is dead — nothing inside the terminal renderer calls into `widget.onTapUp` after the field is set.\n- The **public API surface** has zero in-tree callers. The single `TerminalView` callsite is `lib/widgets/src/clide_pty_view.dart`, and it doesn't pass any tap callback.\n\nSo no production code depends on this parameter; nothing observable changes regardless of which way it gets resolved. (TerminalView's `onSecondaryTapDown` / `onSecondaryTapUp` are wired correctly — `TapGestureRecognizer.onSecondaryTap*` fires them directly. Only `onTapUp` is bad.)\n\n**Two clean resolutions:**\n\n- **A. Fix the wiring.** Call `widget.onTapUp` from `_handleTapUp` (gesture_detector.dart:84) so the parameter does what its docstring claims. Risk: the existing `onSingleTapUp` semantics (gated on `!_isDoubleTap`) need a clearly-defined relationship to `onTapUp` — pick one of:\n - `onTapUp` fires on every tap up (raw); `onSingleTapUp` fires only on confirmed singles.\n - Collapse the two into a single hook and document the contract.\n- **B. Delete the dead surface.** Remove `onTapUp` from `TerminalView`, `TerminalGestureHandler`, and `TerminalGestureDetector` (plus the `_onTapUp` method on `TerminalViewState`). Cleanest because no caller is broken — the surface is documented but unused. If a future caller wants tap notifications, expose `onSingleTapUp` (which works) or re-add `onTapUp` *with wiring* at that point.\n\nRecommendation: **option B**. The \"remove unused public API\" pattern matches the no-pre-existing-excuse / dead-code cleanups in this campaign (the keytab-token defensive throws, the `_LineBuilder.isEmpty` getter, the `_buildDispatcher` rename). If a feature is needed later, add it back deliberately with tests and a real caller.\n\n**Acceptance:**\n\n- Either:\n - **A:** `TerminalView.onTapUp` fires on every tap up; new widget test in `test/terminal/terminal_view_test.dart` verifies the callback runs with a `CellOffset`. Document the contract on the docstring.\n - **B:** `TerminalView.onTapUp` parameter removed; `_onTapUp` method on `TerminalViewState` removed; `onTapUp` parameter on `TerminalGestureHandler` removed; `onTapUp` field + setter on `TerminalGestureDetector` removed. Existing tests still pass.\n- No regression in secondary-tap behaviour (those parameters are wired correctly via `TapGestureRecognizer.onSecondary*`).\n\n**Surfaced from:** T-91 test sweep on `terminal_view.dart`. The widget test that registered `onTapUp` and tapped via `tester.tap` confirmed the callback never fires regardless of `pumpAndSettle` / gesture flushing.\n\n**Cross-references:** T-91 (epic parent), T-89 (coverage epic).\n",
"changed_at": "2026-05-07 06:35:32"
},
{
"ticket_id": "T-93",
"field": "status",
"old_value": "backlog",
"new_value": "in_progress",
"changed_at": "2026-05-07 06:45:24"
}
]
}
+8
View File
@@ -47,6 +47,14 @@ heading, and (b) bumping `pubspec.yaml` `version:` in the same commit.
### Fixed
- `TerminalView.onTapUp` callbacks now actually fire on a primary
tap. The parameter was wired to a code path that nothing in the
gesture-detector chain ever invoked — the documented
"Callback for when the user taps on the terminal" was a no-op
for every caller. Routes through `TerminalGestureHandler.onSingleTapUp`
now, with the resolved cell offset (T-93). Dead `onTapUp` surface
on `TerminalGestureHandler` and `TerminalGestureDetector` removed
in the same change.
- `BufferLine.eraseRange` no longer panics when called with `end == 0`.
The right-side wide-char guard read `_data[-1]` via `getWidth(-1)`,
which threw a `RangeError`. Real trigger path: `Terminal.eraseDisplayAbove`
+1 -1
View File
@@ -301,7 +301,7 @@ class TerminalViewState extends State<TerminalView> {
child = TerminalGestureHandler(
terminalView: this,
terminalController: _controller,
onTapUp: _onTapUp,
onSingleTapUp: _onTapUp,
onTapDown: _onTapDown,
onSecondaryTapDown: widget.onSecondaryTapDown != null ? _onSecondaryTapDown : null,
onSecondaryTapUp: widget.onSecondaryTapUp != null ? _onSecondaryTapUp : null,
@@ -10,7 +10,6 @@ class TerminalGestureDetector extends StatefulWidget {
super.key,
this.child,
this.onSingleTapUp,
this.onTapUp,
this.onTapDown,
this.onSecondaryTapDown,
this.onSecondaryTapUp,
@@ -26,8 +25,6 @@ class TerminalGestureDetector extends StatefulWidget {
final Widget? child;
final GestureTapUpCallback? onTapUp;
final GestureTapUpCallback? onSingleTapUp;
final GestureTapDownCallback? onTapDown;
@@ -16,7 +16,6 @@ class TerminalGestureHandler extends StatefulWidget {
required this.terminalView,
required this.terminalController,
this.child,
this.onTapUp,
this.onSingleTapUp,
this.onTapDown,
this.onSecondaryTapDown,
@@ -32,8 +31,6 @@ class TerminalGestureHandler extends StatefulWidget {
final Widget? child;
final GestureTapUpCallback? onTapUp;
final GestureTapUpCallback? onSingleTapUp;
final GestureTapDownCallback? onTapDown;
@@ -64,7 +61,6 @@ class _TerminalGestureHandlerState extends State<TerminalGestureHandler> {
@override
Widget build(BuildContext context) {
return TerminalGestureDetector(
onTapUp: widget.onTapUp,
onSingleTapUp: onSingleTapUp,
onTapDown: onTapDown,
onSecondaryTapDown: onSecondaryTapDown,
+1 -1
View File
@@ -18,7 +18,7 @@ repository: https://github.com/postmeridiem/clide
# Pre-push line-coverage floor. Ratchets up only — see D-66.
# Reading: `awk -F: '/^coverage_floor:/ {gsub(/ /,"",$2); print $2}' pubspec.yaml`.
coverage_floor: 65
coverage_floor: 66
# Project metadata (was project.yaml, folded in per D-056).
# version: above is the single source of truth. The Makefile reads
+135 -1
View File
@@ -9,7 +9,6 @@ import 'package:clide/src/terminal/src/ui/render.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_test/flutter_test.dart';
/// Minimal widget tree to host a TerminalView. The widget brings its own
@@ -221,4 +220,139 @@ void main() {
expect(state.hasInputConnection, isFalse);
});
});
group('TerminalView — onKeyEvent override', () {
testWidgets('explicit onKeyEvent returning handled short-circuits the default handler', (tester) async {
final r = _OutputRecorder();
final t = r.build();
var overrideCalls = 0;
await tester.pumpWidget(_host(TerminalView(
t,
autofocus: true,
onKeyEvent: (focusNode, event) {
overrideCalls++;
return KeyEventResult.handled;
},
)));
await tester.pump();
await tester.sendKeyEvent(LogicalKeyboardKey.arrowDown);
await tester.pump();
expect(overrideCalls, isPositive);
expect(r.outputs, isEmpty, reason: 'override returned handled — Terminal.keyInput must not run');
});
testWidgets('onKeyEvent returning ignored falls through to the default handler', (tester) async {
final r = _OutputRecorder();
final t = r.build();
await tester.pumpWidget(_host(TerminalView(
t,
autofocus: true,
onKeyEvent: (_, __) => KeyEventResult.ignored,
)));
await tester.pump();
await tester.sendKeyEvent(LogicalKeyboardKey.arrowDown);
await tester.pump();
expect(r.outputs, isNotEmpty);
});
});
group('TerminalView — IME / text input', () {
testWidgets('virtual-keyboard text emits via terminal.textInput when no key match', (tester) async {
final r = _OutputRecorder();
final t = r.build();
await tester.pumpWidget(_host(TerminalView(t, autofocus: true)));
await tester.pump();
// Open an input connection by tapping; pump past the gesture
// detector's 300 ms double-tap timer.
await tester.tap(find.byType(TerminalView));
await tester.pump(const Duration(seconds: 1));
// testTextInput.enterText feeds the editing-value to the connection,
// which CustomTextEdit translates into onInsert. A multi-char string
// can't map to a TerminalKey, so it falls through to textInput.
tester.testTextInput.enterText('hello');
await tester.pump();
expect(r.outputs.any((o) => o.contains('hello')), isTrue);
});
testWidgets('TextInputAction.done routes to TerminalKey.enter', (tester) async {
final r = _OutputRecorder();
final t = r.build();
await tester.pumpWidget(_host(TerminalView(t, autofocus: true)));
await tester.pump();
await tester.tap(find.byType(TerminalView));
await tester.pump(const Duration(seconds: 1));
await tester.testTextInput.receiveAction(TextInputAction.done);
await tester.pump();
// Enter on the default keytab produces a non-empty escape.
expect(r.outputs, isNotEmpty);
});
});
group('TerminalView — taps (T-93)', () {
testWidgets('primary tap fires onTapUp with the resolved cell offset', (tester) async {
final r = _OutputRecorder();
final t = r.build();
var tappedAt = 0;
await tester.pumpWidget(_host(TerminalView(
t,
onTapUp: (_, __) => tappedAt++,
)));
await tester.tapAt(tester.getCenter(find.byType(TerminalView)));
// The gesture detector arms a 300 ms double-tap timer after the tap;
// explicit duration flushes it (pumpAndSettle waits on animations,
// not arbitrary timers).
await tester.pump(const Duration(seconds: 1));
expect(tappedAt, isPositive);
});
testWidgets('primary tap with active selection clears it', (tester) async {
final t = _OutputRecorder().build();
final controller = TerminalController();
addTearDown(controller.dispose);
controller.setSelection(
t.buffer.createAnchor(0, 0),
t.buffer.createAnchor(2, 0),
);
expect(controller.selection, isNotNull);
await tester.pumpWidget(_host(TerminalView(t, controller: controller)));
await tester.tapAt(tester.getCenter(find.byType(TerminalView)));
await tester.pump(const Duration(seconds: 1));
expect(controller.selection, isNull);
});
testWidgets('secondary tap routes through onSecondaryTapDown / onSecondaryTapUp', (tester) async {
final r = _OutputRecorder();
final t = r.build();
var downCalls = 0;
var upCalls = 0;
await tester.pumpWidget(_host(TerminalView(
t,
onSecondaryTapDown: (_, __) => downCalls++,
onSecondaryTapUp: (_, __) => upCalls++,
)));
final pos = tester.getCenter(find.byType(TerminalView));
final gesture = await tester.startGesture(pos, buttons: kSecondaryButton);
await gesture.up();
await tester.pump(const Duration(seconds: 1));
expect(downCalls, isPositive);
expect(upCalls, isPositive);
});
});
group('TerminalView — keyboard visibility', () {
testWidgets('platform keyboard show fires _onKeyboardShow on the focused view', (tester) async {
final t = _OutputRecorder().build();
await tester.pumpWidget(_host(TerminalView(t, autofocus: true)));
await tester.pump();
// Simulate a virtual-keyboard appearance by raising the bottom view
// insets and triggering a metrics-changed cycle.
tester.view.viewInsets = const FakeViewPadding(bottom: 200, left: 0, right: 0, top: 0);
addTearDown(tester.view.resetViewInsets);
tester.binding.handleMetricsChanged();
await tester.pump();
// _onKeyboardShow only acts when the focus node has focus — verify by
// tearing down without throwing.
await tester.pumpWidget(_host(const SizedBox()));
});
});
}