feat(app): artifact viewer previews the text family (logs, JSON, code, config) in bundled monospace

This commit is contained in:
2026-10-23 14:54:00 +01:00
parent 355f8228dd
commit 97d09436c8
13 changed files with 133 additions and 60 deletions
@@ -0,0 +1,37 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:pipelines_app/features/artifacts/domain/artifact_preview.dart';
import 'package:pipelines_app/features/artifacts/domain/artifact_url.dart';
import 'package:pipelines_app/features/artifacts/ui/artifact_viewer_content.dart';
import 'package:pipelines_app/ui/text/monospace.dart';
void main() {
testWidgets('a text-family preview is selectable bundled monospace', (
tester,
) async {
await tester.pumpWidget(
MaterialApp(
home: Scaffold(
body: ArtifactPreviewBody(
plan: ArtifactPreviewPlan(
kind: ArtifactPreviewKind.text,
resolved: ResolvedArtifactUrl(
uri: Uri.parse('http://127.0.0.1:8080/artifacts/1/main.py'),
external: false,
),
message: '',
),
loading: false,
markdownBuilder: defaultArtifactMarkdown,
text: 'def main():\n return 0\n',
),
),
),
);
final text = tester.widget<SelectableText>(
find.byKey(const Key('artifact-text-preview')),
);
expect(text.data, 'def main():\n return 0\n');
expect(text.style?.fontFamily, appMonospaceFamily);
});
}