feat(app): an open pipeline, run or chat fills a phone screen; Back steps up one level; stage tabs end with Session
This commit is contained in:
@@ -128,18 +128,19 @@ class RunVisitSectionStrip extends StatelessWidget {
|
||||
}
|
||||
|
||||
/// The stage page's tabs: Summary (Input and Output), Artifacts, Changes and
|
||||
/// More (Session and Definition). The finer sections stay addressable.
|
||||
/// Session. The finer sections stay addressable.
|
||||
const shownVisitSections = [
|
||||
RunVisitSection.summary,
|
||||
RunVisitSection.artifacts,
|
||||
RunVisitSection.changes,
|
||||
RunVisitSection.more,
|
||||
RunVisitSection.session,
|
||||
];
|
||||
|
||||
/// The tab that shows [section].
|
||||
RunVisitSection visitTabFor(RunVisitSection section) => switch (section) {
|
||||
RunVisitSection.input || RunVisitSection.output => RunVisitSection.summary,
|
||||
RunVisitSection.session || RunVisitSection.definition => RunVisitSection.more,
|
||||
// The stage's definition lives on the pipeline, not on a run's visit.
|
||||
RunVisitSection.more || RunVisitSection.definition => RunVisitSection.session,
|
||||
_ => section,
|
||||
};
|
||||
|
||||
@@ -178,10 +179,7 @@ Widget runVisitSectionBody({
|
||||
cupertino: cupertino,
|
||||
);
|
||||
case RunVisitSection.more:
|
||||
return _MoreSection(
|
||||
session: body(RunVisitSection.session),
|
||||
definition: body(RunVisitSection.definition),
|
||||
);
|
||||
return body(RunVisitSection.session);
|
||||
case RunVisitSection.input:
|
||||
return runDetailFieldTab(
|
||||
tabKey: 'visit-input',
|
||||
@@ -230,57 +228,6 @@ Widget runVisitSectionBody({
|
||||
}
|
||||
}
|
||||
|
||||
/// Session and Definition behind one tab, with a small switch between them.
|
||||
class _MoreSection extends StatefulWidget {
|
||||
const _MoreSection({required this.session, required this.definition});
|
||||
|
||||
final Widget session;
|
||||
final Widget definition;
|
||||
|
||||
@override
|
||||
State<_MoreSection> createState() => _MoreSectionState();
|
||||
}
|
||||
|
||||
class _MoreSectionState extends State<_MoreSection> {
|
||||
var _definition = false;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final cupertino = usesCupertinoHost(context);
|
||||
final control = cupertino
|
||||
? CupertinoSlidingSegmentedControl<bool>(
|
||||
key: const Key('run-visit-more-switch'),
|
||||
groupValue: _definition,
|
||||
onValueChanged: (value) =>
|
||||
setState(() => _definition = value ?? false),
|
||||
children: const {false: Text('Session'), true: Text('Definition')},
|
||||
)
|
||||
: SegmentedButton<bool>(
|
||||
key: const Key('run-visit-more-switch'),
|
||||
showSelectedIcon: false,
|
||||
segments: const [
|
||||
ButtonSegment(value: false, label: Text('Session')),
|
||||
ButtonSegment(value: true, label: Text('Definition')),
|
||||
],
|
||||
selected: {_definition},
|
||||
onSelectionChanged: (value) =>
|
||||
setState(() => _definition = value.single),
|
||||
);
|
||||
return Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 8, 16, 0),
|
||||
child: control,
|
||||
),
|
||||
Expanded(child: _definition ? widget.definition : widget.session),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// The stage's Input and Output as sticky collapsibles, each with a copy
|
||||
/// button for its recorded text.
|
||||
class _VisitSummary extends StatefulWidget {
|
||||
const _VisitSummary({
|
||||
super.key,
|
||||
|
||||
Reference in New Issue
Block a user