feat(app): pipeline source and stage prompts switch between raw and rendered markdown
This commit is contained in:
@@ -3,6 +3,7 @@ import 'dart:convert';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../ui/text/markdown_source_view.dart';
|
||||
import '../../../core/api_gateway.dart';
|
||||
import '../../../ui/adaptive/host.dart';
|
||||
import '../domain/graph_protocol.dart';
|
||||
@@ -153,8 +154,15 @@ class _StageDefinitionFieldView extends StatelessWidget {
|
||||
children: [
|
||||
Text(field.label, style: style.label),
|
||||
const SizedBox(height: 4),
|
||||
// An authored text block (a prompt) is markdown: rendered or raw.
|
||||
if (field.block)
|
||||
_SelectableDefinitionText(value: field.value, style: style.value)
|
||||
MarkdownSourceView(
|
||||
text: field.value,
|
||||
raw: _SelectableDefinitionText(
|
||||
value: field.value,
|
||||
style: style.value,
|
||||
),
|
||||
)
|
||||
else
|
||||
Text(field.value, style: style.value),
|
||||
],
|
||||
|
||||
@@ -10,6 +10,7 @@ import '../pipeline_models.dart';
|
||||
import '../pipelines_controller.dart';
|
||||
import '../ui/run_pipeline_action.dart';
|
||||
import 'pipeline_controls.dart';
|
||||
import '../../../ui/text/markdown_source_view.dart';
|
||||
import 'pipeline_detail_styles.dart';
|
||||
import 'pipeline_graph_tab.dart';
|
||||
import 'pipeline_summary_view.dart';
|
||||
@@ -395,7 +396,14 @@ class _PipelineDetailPanelState extends State<PipelineDetailPanel> {
|
||||
if (detail.source.isEmpty)
|
||||
Text('No source recorded.', style: pipelineMutedStyle(context))
|
||||
else
|
||||
SelectableText(detail.source, style: pipelineValueStyle(context)),
|
||||
// The definition is markdown: rendered, or its raw text.
|
||||
MarkdownSourceView(
|
||||
text: detail.source,
|
||||
raw: SelectableText(
|
||||
detail.source,
|
||||
style: pipelineValueStyle(context),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user