MultitabPane: drag-to-reorder gesture wiring (T-84)

Each tab is wrapped in a Draggable (when allowReorder is true and the
entry itself is reorderable) and a DragTarget (always — the controller's
barrier logic decides whether the move actually happens). Drops insert
the dragged entry at the target tab's index. A 2px leading insertion
indicator highlights the active drop target.

The widget harness now wraps children in an Overlay so Draggable's
feedback can mount without each test re-wrapping. Sized by the test
view's bounds to avoid disturbing existing tests that query
find.byType(SizedBox).first.

Four widget tests cover the gesture path: drop reorders, pinned
barrier blocks, pinned tabs aren't draggable, and allowReorder=false
disables drag entirely.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-05-06 14:17:16 +02:00
co-authored by Claude
parent 1caaf5f4dd
commit aa742eed79
5 changed files with 266 additions and 17 deletions
+12 -2
View File
@@ -4,7 +4,13 @@ import 'package:flutter/widgets.dart';
import 'kernel_fixture.dart';
/// Wraps a widget in the minimum tree a primitive needs to resolve
/// theme + i18n: `Directionality → ClideKernel → ClideTheme → child`.
/// theme + i18n + Overlay (for Draggable feedback / Tooltip / etc.):
/// `Directionality → ClideKernel → ClideTheme → MediaQuery →
/// Overlay → child`.
///
/// The Overlay is sized by the test view's bounds via the surrounding
/// MediaQuery; no extra SizedBox is added so existing tests that
/// query `find.byType(SizedBox).first` still find their target.
Widget harness(KernelFixture fixture, Widget child) {
return Directionality(
textDirection: TextDirection.ltr,
@@ -14,7 +20,11 @@ Widget harness(KernelFixture fixture, Widget child) {
controller: fixture.services.theme,
child: MediaQuery(
data: const MediaQueryData(),
child: child,
child: Overlay(
initialEntries: [
OverlayEntry(builder: (_) => child),
],
),
),
),
),