fix(app): guard foreground refresh during interaction
This commit is contained in:
@@ -90,6 +90,9 @@ class AppRouterDelegate extends RouterDelegate<AppRoute> with ChangeNotifier {
|
||||
|
||||
AppRoute get route => _route;
|
||||
|
||||
/// Whether a dialog, popup, or other route is covering the shell page.
|
||||
bool get hasTransientRoute => _navigatorKey.currentState?.canPop() ?? false;
|
||||
|
||||
bool get searchOpen => _route.kind == AppRouteKind.search;
|
||||
|
||||
bool get templatesOpen => _route.kind == AppRouteKind.templates;
|
||||
|
||||
@@ -217,6 +217,7 @@ class _PipelinesAppState extends State<PipelinesApp>
|
||||
|
||||
// A return to the foreground refreshes only the visible list. Detail routes
|
||||
// (including pipeline definitions and run visits) keep their current data.
|
||||
if (_delegate.hasTransientRoute || _isEditingText) return;
|
||||
final route = _delegate.route;
|
||||
if (route.kind == AppRouteKind.pipelines &&
|
||||
route.pipelineId == null &&
|
||||
@@ -227,6 +228,11 @@ class _PipelinesAppState extends State<PipelinesApp>
|
||||
}
|
||||
}
|
||||
|
||||
bool get _isEditingText {
|
||||
final focusContext = FocusManager.instance.primaryFocus?.context;
|
||||
return focusContext?.findAncestorWidgetOfExactType<EditableText>() != null;
|
||||
}
|
||||
|
||||
/// A replaced socket drops the attention status baseline so the gap cannot
|
||||
/// replay a transition; the Runs list's next read reseeds the rows.
|
||||
void _attentionSessionChanged() {
|
||||
|
||||
Reference in New Issue
Block a user