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
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:
@@ -13,8 +13,6 @@ class TerminalGestureDetector extends StatefulWidget {
|
||||
this.onTapDown,
|
||||
this.onSecondaryTapDown,
|
||||
this.onSecondaryTapUp,
|
||||
this.onTertiaryTapDown,
|
||||
this.onTertiaryTapUp,
|
||||
this.onLongPressStart,
|
||||
this.onLongPressMoveUpdate,
|
||||
this.onLongPressUp,
|
||||
@@ -35,10 +33,6 @@ class TerminalGestureDetector extends StatefulWidget {
|
||||
|
||||
final GestureTapDownCallback? onDoubleTapDown;
|
||||
|
||||
final GestureTapDownCallback? onTertiaryTapDown;
|
||||
|
||||
final GestureTapUpCallback? onTertiaryTapUp;
|
||||
|
||||
final GestureLongPressStartCallback? onLongPressStart;
|
||||
|
||||
final GestureLongPressMoveUpdateCallback? onLongPressMoveUpdate;
|
||||
@@ -112,9 +106,7 @@ class _TerminalGestureDetectorState extends State<TerminalGestureDetector> {
|
||||
..onTapDown = _handleTapDown
|
||||
..onTapUp = _handleTapUp
|
||||
..onSecondaryTapDown = widget.onSecondaryTapDown
|
||||
..onSecondaryTapUp = widget.onSecondaryTapUp
|
||||
..onTertiaryTapDown = widget.onTertiaryTapDown
|
||||
..onTertiaryTapUp = widget.onTertiaryTapUp;
|
||||
..onSecondaryTapUp = widget.onSecondaryTapUp;
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// Based on xterm.dart v4.0.0 by xuty (MIT). See LICENSE in this directory.
|
||||
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:clide/src/terminal/src/core/mouse/button.dart';
|
||||
import 'package:clide/src/terminal/src/core/mouse/button_state.dart';
|
||||
@@ -20,8 +19,6 @@ class TerminalGestureHandler extends StatefulWidget {
|
||||
this.onTapDown,
|
||||
this.onSecondaryTapDown,
|
||||
this.onSecondaryTapUp,
|
||||
this.onTertiaryTapDown,
|
||||
this.onTertiaryTapUp,
|
||||
this.readOnly = false,
|
||||
});
|
||||
|
||||
@@ -39,10 +36,6 @@ class TerminalGestureHandler extends StatefulWidget {
|
||||
|
||||
final GestureTapUpCallback? onSecondaryTapUp;
|
||||
|
||||
final GestureTapDownCallback? onTertiaryTapDown;
|
||||
|
||||
final GestureTapUpCallback? onTertiaryTapUp;
|
||||
|
||||
final bool readOnly;
|
||||
|
||||
@override
|
||||
@@ -65,8 +58,6 @@ class _TerminalGestureHandlerState extends State<TerminalGestureHandler> {
|
||||
onTapDown: onTapDown,
|
||||
onSecondaryTapDown: onSecondaryTapDown,
|
||||
onSecondaryTapUp: onSecondaryTapUp,
|
||||
onTertiaryTapDown: onSecondaryTapDown,
|
||||
onTertiaryTapUp: onSecondaryTapUp,
|
||||
onLongPressStart: onLongPressStart,
|
||||
onLongPressMoveUpdate: onLongPressMoveUpdate,
|
||||
// onLongPressUp: onLongPressUp,
|
||||
@@ -144,14 +135,6 @@ class _TerminalGestureHandlerState extends State<TerminalGestureHandler> {
|
||||
_tapUp(widget.onSecondaryTapUp, details, TerminalMouseButton.right);
|
||||
}
|
||||
|
||||
void onTertiaryTapDown(TapDownDetails details) {
|
||||
_tapDown(widget.onTertiaryTapDown, details, TerminalMouseButton.middle);
|
||||
}
|
||||
|
||||
void onTertiaryTapUp(TapUpDetails details) {
|
||||
_tapUp(widget.onTertiaryTapUp, details, TerminalMouseButton.right);
|
||||
}
|
||||
|
||||
void onDoubleTapDown(TapDownDetails details) {
|
||||
renderTerminal.selectWord(details.localPosition);
|
||||
}
|
||||
@@ -172,8 +155,10 @@ class _TerminalGestureHandlerState extends State<TerminalGestureHandler> {
|
||||
|
||||
void onDragStart(DragStartDetails details) {
|
||||
_lastDragStartDetails = details;
|
||||
|
||||
details.kind == PointerDeviceKind.mouse ? renderTerminal.selectCharacters(details.localPosition) : renderTerminal.selectWord(details.localPosition);
|
||||
// PanGestureRecognizer in TerminalGestureDetector only registers
|
||||
// PointerDeviceKind.mouse, so we know the drag came from a mouse and
|
||||
// characters are the right selection unit.
|
||||
renderTerminal.selectCharacters(details.localPosition);
|
||||
}
|
||||
|
||||
void onDragUpdate(DragUpdateDetails details) {
|
||||
|
||||
Reference in New Issue
Block a user