Artifact viewer: keep the preview between the top bar and the controls

Every preview (image, text, markdown, HTML, video) now fills the space between
the viewer's top bar and its bottom controls instead of passing behind them;
the insets are applied once here and removed for the content inside.
This commit is contained in:
2026-11-01 21:22:36 +00:00
parent b57b494959
commit a322e367da
2 changed files with 30 additions and 4 deletions
@@ -13,11 +13,12 @@ import 'package:pipelines_app/features/artifacts/domain/artifact_record.dart';
import 'package:pipelines_app/features/artifacts/ui/artifact_external_open.dart';
import 'package:pipelines_app/features/artifacts/ui/artifact_gallery_page.dart';
import 'package:pipelines_app/features/artifacts/ui/artifact_viewer_content.dart'
show artifactPreviewRetryKey;
show ArtifactPreviewBody, artifactPreviewRetryKey;
import 'package:pipelines_app/features/artifacts/ui/artifact_viewer_fetch.dart';
import 'package:pipelines_app/features/artifacts/ui/artifact_viewer_page.dart';
import 'package:pipelines_app/features/artifacts/ui/artifact_visit_list.dart';
import 'package:pipelines_app/ui/adaptive/glass_pill.dart';
import 'package:pipelines_app/ui/adaptive/segmented_bar.dart';
import 'package:pipelines_app/features/chat/ui/transcript/chat_markdown_view.dart';
import '../domain/artifact_fixtures.dart';
@@ -729,6 +730,16 @@ void main() {
// Right above the stacked bar, not lifted by its clearance twice
// (the bar is one 56 px pill above the inset plus its margin).
expect(pager.bottom, greaterThanOrEqualTo(size.height - 120 - 56));
// The preview sits between the bars, never behind either.
final preview = tester.getRect(
find.byType(ArtifactPreviewBody).first,
);
final actions = tester.getRect(
find.byKey(const Key('artifact-viewer-actions')),
);
final topBar = tester.getRect(find.byType(SegmentedBar).first);
expect(preview.bottom, lessThanOrEqualTo(actions.top));
expect(preview.top, greaterThanOrEqualTo(topBar.bottom - 1));
},
);
}