Files
pipelines/app/test/shell/windows/window_popup_rules_test.dart
T
alan fdc730422d Host floating chats on the shell window system
Phase 2.3 and 2.4 of docs/plans/floating-windows.md. A floating chat is a
window of the chat kind over the app's WindowManager, built from the
app-lifetime ChatRuntime, so it shows over every destination and at start
without the Chat destination being built. Float and Dock move the same
keyed view between the tiling and the window host. The pipelines app keeps
one runtime and one ChatWindows; saved chatFloat records (v1 and v2) are
brought over once.

ChatFloatHost, ChatFloatWindow, the float frames and binding, the
controller's float list and FloatingFocusRoot are gone; the workspace only
asks whether a chat is out in a window. Every MenuAnchor targets the root
overlay (guarded by a test), and menus and tooltips name the Alt chords.
2026-11-10 21:17:40 +00:00

28 lines
1.0 KiB
Dart

import 'dart:io';
import 'package:flutter_test/flutter_test.dart';
/// Window content takes input only inside its window (see `WindowNavigator`),
/// so a `MenuAnchor` panel, which may extend past the window, must be in the
/// root overlay. Any content can end up in a window, so every `MenuAnchor` in
/// the app opts in.
void main() {
test('every MenuAnchor targets the root overlay', () {
final offenders = <String>[];
for (final file in Directory('lib').listSync(recursive: true)) {
if (file is! File || !file.path.endsWith('.dart')) continue;
final source = file.readAsStringSync();
for (final match in RegExp(r'\bMenuAnchor\(').allMatches(source)) {
final end = (match.end + 400).clamp(0, source.length);
if (!source
.substring(match.end, end)
.contains('useRootOverlay: true')) {
final line = '\n'.allMatches(source.substring(0, match.start)).length;
offenders.add('${file.path}:${line + 1}');
}
}
}
expect(offenders, isEmpty);
});
}