feat(workspace): add workflow navigation and resizable desktop panels

This commit is contained in:
lingjhf committed 2026-10-09 19:23:49 +08:00
1 parent 02413383d8
commit 1acfe4a005
17 files changed
+2008 -277

No files matched your search

+93 -74
View File
@@ -17,9 +17,9 @@ class DesktopWindowFrame extends StatelessWidget {
this.projectTabs,
this.headerTrailing = const SizedBox.shrink(),
this.settingsSelected = false,
this.resourceLibrarySelected = false,
this.onResourceLibraryPressed,
this.workflowSelected = false,
required this.onHomePressed,
required this.onWorkflowPressed,
required this.onSettingsPressed,
required this.child,
});
@@ -35,9 +35,9 @@ class DesktopWindowFrame extends StatelessWidget {
final Widget? projectTabs;
final Widget headerTrailing;
final bool settingsSelected;
final bool resourceLibrarySelected;
final VoidCallback? onResourceLibraryPressed;
final bool workflowSelected;
final VoidCallback onHomePressed;
final VoidCallback onWorkflowPressed;
final VoidCallback onSettingsPressed;
final Widget child;
@@ -119,90 +119,109 @@ class DesktopWindowFrame extends StatelessWidget {
Expanded(
child: Row(
children: [
if (projectTabs == null)
SizedBox(
key: const Key('desktop-navigation-rail'),
width: railWidth,
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 10),
child: Column(
children: [
for (final section in [0, 2])
Padding(
padding: const EdgeInsets.only(bottom: 8),
child: IconButton.filledTonal(
key: ValueKey(switch (section) {
0 => 'desktop-rail-home',
_ => 'desktop-rail-resources',
}),
tooltip: switch (section) {
0 => context.l10n.navigationHome,
_ => context.l10n.navigationLibrary,
},
isSelected:
!settingsSelected &&
(section == 2
? resourceLibrarySelected
: !resourceLibrarySelected),
style: IconButton.styleFrom(
fixedSize: const Size.square(railButtonSize),
minimumSize: const Size.square(railButtonSize),
maximumSize: const Size.square(railButtonSize),
padding: EdgeInsets.zero,
iconSize: railIconSize,
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
backgroundColor:
!settingsSelected &&
(section == 2
? resourceLibrarySelected
: !resourceLibrarySelected)
? null
: Colors.transparent,
SizedBox(
key: const Key('desktop-navigation-rail'),
width: railWidth,
child: LayoutBuilder(
builder: (context, constraints) => SingleChildScrollView(
child: ConstrainedBox(
constraints: BoxConstraints(
minHeight: constraints.maxHeight,
),
child: IntrinsicHeight(
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 10),
child: Column(
children: [
IconButton.filledTonal(
key: const ValueKey('desktop-rail-home'),
tooltip: context.l10n.navigationHome,
isSelected:
!settingsSelected && !workflowSelected,
style: IconButton.styleFrom(
fixedSize: const Size.square(railButtonSize),
minimumSize: const Size.square(
railButtonSize,
),
maximumSize: const Size.square(
railButtonSize,
),
padding: EdgeInsets.zero,
iconSize: railIconSize,
tapTargetSize:
MaterialTapTargetSize.shrinkWrap,
backgroundColor:
settingsSelected || workflowSelected
? Colors.transparent
: null,
),
onPressed: onHomePressed,
icon: const Icon(AppIcons.home),
),
onPressed: switch (section) {
0 => onHomePressed,
_ => onResourceLibraryPressed,
},
icon: Icon(switch (section) {
0 => AppIcons.home,
_ => AppIcons.folder,
}),
),
const SizedBox(height: 8),
IconButton.filledTonal(
key: const ValueKey('desktop-rail-workflow'),
tooltip: context.l10n.workflow,
isSelected: workflowSelected,
style: IconButton.styleFrom(
fixedSize: const Size.square(railButtonSize),
minimumSize: const Size.square(
railButtonSize,
),
maximumSize: const Size.square(
railButtonSize,
),
padding: EdgeInsets.zero,
iconSize: railIconSize,
tapTargetSize:
MaterialTapTargetSize.shrinkWrap,
backgroundColor: workflowSelected
? null
: Colors.transparent,
),
onPressed: onWorkflowPressed,
icon: const Icon(AppIcons.timeline),
),
const Spacer(),
IconButton(
key: const Key('desktop-rail-settings'),
tooltip: context.l10n.settings,
isSelected: settingsSelected,
onPressed: onSettingsPressed,
style: IconButton.styleFrom(
fixedSize: const Size.square(railButtonSize),
minimumSize: const Size.square(
railButtonSize,
),
maximumSize: const Size.square(
railButtonSize,
),
padding: EdgeInsets.zero,
iconSize: railIconSize,
tapTargetSize:
MaterialTapTargetSize.shrinkWrap,
),
icon: const Icon(AppIcons.settings),
),
],
),
const Spacer(),
IconButton(
key: const Key('project-settings-button'),
tooltip: context.l10n.settings,
isSelected: settingsSelected,
onPressed: onSettingsPressed,
style: IconButton.styleFrom(
fixedSize: const Size.square(railButtonSize),
minimumSize: const Size.square(railButtonSize),
maximumSize: const Size.square(railButtonSize),
padding: EdgeInsets.zero,
iconSize: railIconSize,
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
),
icon: const Icon(AppIcons.settings),
),
],
),
),
),
),
),
Expanded(
child: Padding(
padding: EdgeInsets.only(
left: projectTabs == null ? 0 : contentInset,
padding: const EdgeInsets.only(
left: contentInset,
right: contentInset,
bottom: contentInset,
),
child: SizedBox(
key: const Key('desktop-content-container'),
child: WindowHeaderPane(
offset: Offset(
projectTabs == null ? railWidth : contentInset,
headerHeight,
),
offset: const Offset(railWidth + contentInset, headerHeight),
child: LayoutBuilder(
builder: (context, constraints) =>
constraints.maxWidth < 200