remove dead tertiary-tap surface (T-95)
test / unit + widget + golden + a11y (push) Failing after 30s
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 1m1s

The middle-click ("tertiary tap") path in TerminalGestureHandler was
wired wrong: build() bound onTertiaryTapDown to the secondary state
method, so a middle-click fired as if it were a right-click. The
state's onTertiaryTapDown/Up methods were unreachable, and the
onTertiaryTapUp body had a copy-paste bug (button=right instead of
middle). No production caller passed onTertiaryTapDown / onTertiaryTapUp
through, and TerminalView didn't expose them either, so the public
parameters were dead too.

Drops both layers of dead surface — option B of T-95. Same shape as
T-93's resolution (delete unused, restore later when a real consumer
needs it). Also collapses the unreachable onDragStart selectWord
branch (PanGestureRecognizer is mouse-only, so the touch path can't
fire) into a single selectCharacters call with a comment.

Companion: refines the reflow-padding test in coverage_trivials_test
to use narrow→wide reflow setup (more honest about intent, also
actually exercises the padding branch — Buffer.resize now 100%) and
clears two unnecessary_import warnings surfaced by the deletion.

Coverage: gesture_handler 55/59 -> 59/59; gesture_detector 50/50;
buffer/buffer 260/261 -> 261/261.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-11 17:56:24 +02:00
co-authored by Claude Opus 4.7
parent 155af91e66
commit 0a43a1f7d2
4 changed files with 12 additions and 36 deletions
+7 -7
View File
@@ -35,13 +35,13 @@ void main() {
test('Buffer.resize pads reflow output up to the new height', () {
final t = Terminal(maxLines: 200, onOutput: (_) {});
// Write content narrower than the new width — reflow should produce
// fewer lines than newHeight, triggering the pad-with-empty-lines
// branch in buffer.dart.
t.write('abc\r\n');
// Resize to a wide + tall viewport.
t.resize(40, 50, 8, 16);
expect(t.buffer.lines.length, greaterThanOrEqualTo(50));
// Setup: narrow viewport with wrapped continuation lines. Widening
// collapses them in reflow → output rows < newHeight → the
// pad-with-empty-lines branch in Buffer.resize runs.
t.resize(5, 30, 8, 16);
t.write('aaaaaaaaaaaaaaaaaaaa'); // wraps 4 times
t.resize(80, 30, 8, 16); // widen, same height
expect(t.buffer.lines.length, 30);
});
test('TerminalPainter.paintLine handles wide (CJK) cells without skipping the skip', () {
-1
View File
@@ -11,7 +11,6 @@ import 'package:clide/src/terminal/src/ui/controller.dart';
import 'package:clide/src/terminal/src/ui/cursor_type.dart';
import 'package:clide/src/terminal/src/ui/terminal_text_style.dart';
import 'package:clide/src/terminal/src/ui/themes.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_test/flutter_test.dart';