feat(app): icon-only tab bars, Settings from the Pipelines bar, main bar bottom right with detail bars above it
Settings leaves the tab bar (Pipelines, Runs, Chat, Search) and opens as a page from a gear in the Pipelines bar, keeping /settings, its keys and a Back to Pipelines (also the system Back). Every floating tab bar shows icons only, named for assistive technology. On wide windows the shell's tab bar stays at the bottom right; a split detail learns its height plus a 12px gap, so its tabs or the chat composer float above it, and pages the detail opens (the stage page) stay in its pane through its own navigator.
This commit is contained in:
@@ -12,6 +12,7 @@ import 'pipeline_models.dart';
|
||||
import 'pipeline_repository.dart';
|
||||
import 'pipelines_controller.dart';
|
||||
import 'pending_run_store.dart';
|
||||
import 'widgets/pipeline_bar_buttons.dart';
|
||||
import 'widgets/pipeline_controls.dart';
|
||||
import 'widgets/pipeline_detail_panel.dart';
|
||||
import 'widgets/pipeline_list_panel.dart';
|
||||
@@ -36,6 +37,7 @@ class PipelinesScreen extends StatefulWidget {
|
||||
this.onViewPipelineRuns,
|
||||
this.onSelectionChanged,
|
||||
this.onOpenSchedules,
|
||||
this.onOpenSettings,
|
||||
this.initialPipelineId,
|
||||
this.initialVersion = 0,
|
||||
this.initialStageKey,
|
||||
@@ -66,6 +68,9 @@ class PipelinesScreen extends StatefulWidget {
|
||||
/// Opens every schedule; shown in the bar while the list is visible.
|
||||
final VoidCallback? onOpenSchedules;
|
||||
|
||||
/// Opens Settings as a page; a gear in the bar while the list is visible.
|
||||
final VoidCallback? onOpenSettings;
|
||||
|
||||
/// The pipeline a deep link names, opened after the list read starts.
|
||||
final int? initialPipelineId;
|
||||
|
||||
@@ -281,6 +286,8 @@ class _PipelinesScreenState extends State<PipelinesScreen> {
|
||||
if (listShown && widget.onOpenSchedules != null)
|
||||
_schedulesButton(context),
|
||||
_refreshButton(context),
|
||||
if (listShown && widget.onOpenSettings != null)
|
||||
_settingsButton(context),
|
||||
],
|
||||
child: body,
|
||||
);
|
||||
@@ -298,6 +305,7 @@ class _PipelinesScreenState extends State<PipelinesScreen> {
|
||||
...pipelineListActions(context, _controller),
|
||||
if (widget.onOpenSchedules != null) _schedulesButton(context),
|
||||
_refreshButton(context),
|
||||
if (widget.onOpenSettings != null) _settingsButton(context),
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -307,26 +315,11 @@ class _PipelinesScreenState extends State<PipelinesScreen> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _schedulesButton(BuildContext context) {
|
||||
if (useCupertinoControls(context)) {
|
||||
return Semantics(
|
||||
button: true,
|
||||
label: 'Schedules',
|
||||
child: CupertinoButton(
|
||||
key: const Key('pipelines-open-schedules'),
|
||||
padding: EdgeInsets.zero,
|
||||
onPressed: widget.onOpenSchedules,
|
||||
child: const Icon(CupertinoIcons.calendar),
|
||||
),
|
||||
);
|
||||
}
|
||||
return IconButton(
|
||||
key: const Key('pipelines-open-schedules'),
|
||||
tooltip: 'Schedules',
|
||||
onPressed: widget.onOpenSchedules,
|
||||
icon: const Icon(Icons.schedule),
|
||||
);
|
||||
}
|
||||
Widget _schedulesButton(BuildContext context) =>
|
||||
pipelineSchedulesButton(context, widget.onOpenSchedules);
|
||||
|
||||
Widget _settingsButton(BuildContext context) =>
|
||||
pipelineSettingsButton(context, widget.onOpenSettings);
|
||||
|
||||
Widget _refreshButton(BuildContext context) {
|
||||
if (useCupertinoControls(context)) {
|
||||
@@ -357,6 +350,7 @@ class _PipelinesScreenState extends State<PipelinesScreen> {
|
||||
...pipelineListActions(context, _controller),
|
||||
if (widget.onOpenSchedules != null) _schedulesButton(context),
|
||||
_refreshButton(context),
|
||||
if (widget.onOpenSettings != null) _settingsButton(context),
|
||||
],
|
||||
),
|
||||
body: SafeArea(top: false, child: body),
|
||||
@@ -372,6 +366,7 @@ class _PipelinesScreenState extends State<PipelinesScreen> {
|
||||
...pipelineListActions(context, _controller),
|
||||
if (widget.onOpenSchedules != null) _schedulesButton(context),
|
||||
_refreshButton(context),
|
||||
if (widget.onOpenSettings != null) _settingsButton(context),
|
||||
],
|
||||
),
|
||||
child: SafeArea(top: false, child: body),
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'pipeline_controls.dart';
|
||||
|
||||
/// One icon action in the Pipelines bar's actions pill: a Material
|
||||
/// [IconButton] with its tooltip, or a Cupertino button named for
|
||||
/// accessibility.
|
||||
Widget pipelineBarIconButton(
|
||||
BuildContext context, {
|
||||
required Key key,
|
||||
required String label,
|
||||
required IconData icon,
|
||||
required IconData cupertinoIcon,
|
||||
required VoidCallback? onPressed,
|
||||
}) {
|
||||
if (useCupertinoControls(context)) {
|
||||
return Semantics(
|
||||
button: true,
|
||||
label: label,
|
||||
child: CupertinoButton(
|
||||
key: key,
|
||||
padding: EdgeInsets.zero,
|
||||
onPressed: onPressed,
|
||||
child: Icon(cupertinoIcon),
|
||||
),
|
||||
);
|
||||
}
|
||||
return IconButton(
|
||||
key: key,
|
||||
tooltip: label,
|
||||
onPressed: onPressed,
|
||||
icon: Icon(icon),
|
||||
);
|
||||
}
|
||||
|
||||
/// Opens every schedule.
|
||||
Widget pipelineSchedulesButton(BuildContext context, VoidCallback? onPressed) =>
|
||||
pipelineBarIconButton(
|
||||
context,
|
||||
key: const Key('pipelines-open-schedules'),
|
||||
label: 'Schedules',
|
||||
icon: Icons.schedule,
|
||||
cupertinoIcon: CupertinoIcons.calendar,
|
||||
onPressed: onPressed,
|
||||
);
|
||||
|
||||
/// Opens Settings as a page (it is not a tab of the shell).
|
||||
Widget pipelineSettingsButton(BuildContext context, VoidCallback? onPressed) =>
|
||||
pipelineBarIconButton(
|
||||
context,
|
||||
key: const Key('pipelines-open-settings'),
|
||||
label: 'Settings',
|
||||
icon: Icons.settings_outlined,
|
||||
cupertinoIcon: CupertinoIcons.gear,
|
||||
onPressed: onPressed,
|
||||
);
|
||||
@@ -4,14 +4,15 @@ import 'package:flutter/material.dart';
|
||||
/// The detail sections: Summary, the pinned definition Graph and Source.
|
||||
enum PipelineDetailTab {
|
||||
summary('Summary', Icons.summarize_outlined, CupertinoIcons.doc_text),
|
||||
graph('Graph', Icons.account_tree_outlined, CupertinoIcons.arrow_branch),
|
||||
graph('Graph', Icons.hub_outlined, CupertinoIcons.flowchart),
|
||||
source('Source', Icons.code, CupertinoIcons.chevron_left_slash_chevron_right);
|
||||
|
||||
const PipelineDetailTab(this.label, this.icon, this.cupertinoIcon);
|
||||
|
||||
final String label;
|
||||
|
||||
/// The tab's glyph, shown above its name in the bottom bar.
|
||||
/// The tab's glyph, the only thing the bottom bar draws (the label is its
|
||||
/// accessible name); distinct from the shell's Pipelines tab beneath it.
|
||||
final IconData icon;
|
||||
final IconData cupertinoIcon;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ enum RunVisitSection {
|
||||
Icons.difference_outlined,
|
||||
CupertinoIcons.arrow_right_arrow_left,
|
||||
),
|
||||
session('Session', Icons.forum_outlined, CupertinoIcons.chat_bubble_2),
|
||||
session('Session', Icons.forum_outlined, CupertinoIcons.text_bubble),
|
||||
definition(
|
||||
'Definition',
|
||||
Icons.description_outlined,
|
||||
|
||||
Reference in New Issue
Block a user