Move editor UI into the app and release verified Core dependencies (#14)
Gitea CI / Assemble and validate CI artifacts (push) Successful in 1m47s
Gitea CI / Check code and tests (push) Successful in 7m15s
Gitea CI / Build Android APK (push) Successful in 4m6s
Gitea CI / Build Windows x64 app (push) Successful in 3m34s
Gitea CI / Audit and package Windows x64 (push) Successful in 1m29s
Gitea CI / Gitea CI passed (push) Successful in 1s
Gitea Release / Prepare draft Release (push) Failing after 8s
Gitea Release / Upload Android to draft Release (push) Skipped
Gitea Release / Upload Windows to draft Release (push) Skipped
Gitea Release / Verify and publish Release (push) Skipped
Gitea CI / Assemble and validate CI artifacts (push) Successful in 1m47s
Gitea CI / Check code and tests (push) Successful in 7m15s
Gitea CI / Build Android APK (push) Successful in 4m6s
Gitea CI / Build Windows x64 app (push) Successful in 3m34s
Gitea CI / Audit and package Windows x64 (push) Successful in 1m29s
Gitea CI / Gitea CI passed (push) Successful in 1s
Gitea Release / Prepare draft Release (push) Failing after 8s
Gitea Release / Upload Android to draft Release (push) Skipped
Gitea Release / Upload Windows to draft Release (push) Skipped
Gitea Release / Verify and publish Release (push) Skipped
This commit was merged in pull request #14.
This commit is contained in:
1 parent
abc1868550
commit
06f1c26681
452 files changed
+43806
-2329
No files matched your search
@@ -32,6 +32,11 @@ class DesktopWorkspaceShell extends StatefulWidget {
|
||||
required this.scaffoldKey,
|
||||
required this.navigationDrawer,
|
||||
this.projectTabsLayout = false,
|
||||
this.timelineHeight,
|
||||
this.onTimelineHeightChanged,
|
||||
this.onJunctionResizeEnd,
|
||||
this.onSidebarResizeEnd,
|
||||
this.sidebarCanExpand = true,
|
||||
});
|
||||
|
||||
static const gutterWidth = WorkspaceLayoutMetrics.desktopSpacing;
|
||||
@@ -47,12 +52,53 @@ class DesktopWorkspaceShell extends StatefulWidget {
|
||||
final GlobalKey<ScaffoldState> scaffoldKey;
|
||||
final Widget navigationDrawer;
|
||||
final bool projectTabsLayout;
|
||||
final double? timelineHeight;
|
||||
final ValueChanged<double>? onTimelineHeightChanged;
|
||||
final VoidCallback? onJunctionResizeEnd;
|
||||
final VoidCallback? onSidebarResizeEnd;
|
||||
final bool sidebarCanExpand;
|
||||
|
||||
@override
|
||||
State<DesktopWorkspaceShell> createState() => _DesktopWorkspaceShellState();
|
||||
}
|
||||
|
||||
class _DesktopWorkspaceShellState extends State<DesktopWorkspaceShell> {
|
||||
double? _sidebarRestoreWidth;
|
||||
bool _sidebarJunctionDragging = false;
|
||||
|
||||
void _startSidebarResize(double width, {bool junction = false}) {
|
||||
_sidebarRestoreWidth = width;
|
||||
if (junction) setState(() => _sidebarJunctionDragging = true);
|
||||
}
|
||||
|
||||
void _resizeSidebar(double requestedWidth, double maximum) {
|
||||
if (!widget.sidebarCanExpand || widget.controller.agentFloating) return;
|
||||
if (requestedWidth < WorkspaceLayoutMetrics.sidebarSnapThreshold) {
|
||||
if (!widget.sidebarCollapsed) {
|
||||
final restoreWidth = _sidebarRestoreWidth;
|
||||
if (restoreWidth != null && widget.sidebarWidth != restoreWidth) {
|
||||
widget.onSidebarWidthChanged(restoreWidth);
|
||||
}
|
||||
widget.onSidebarCollapsedChanged(true);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (widget.sidebarCollapsed) widget.onSidebarCollapsedChanged(false);
|
||||
widget.onSidebarWidthChanged(
|
||||
requestedWidth.clamp(WorkspaceLayoutMetrics.sidebarMinimumWidth, maximum),
|
||||
);
|
||||
}
|
||||
|
||||
void _finishSidebarResize() {
|
||||
_sidebarRestoreWidth = null;
|
||||
if (_sidebarJunctionDragging) {
|
||||
setState(() => _sidebarJunctionDragging = false);
|
||||
widget.onJunctionResizeEnd?.call();
|
||||
} else {
|
||||
widget.onSidebarResizeEnd?.call();
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
@@ -64,6 +110,11 @@ class _DesktopWorkspaceShellState extends State<DesktopWorkspaceShell> {
|
||||
@override
|
||||
void didUpdateWidget(covariant DesktopWorkspaceShell oldWidget) {
|
||||
super.didUpdateWidget(oldWidget);
|
||||
if (widget.controller.agentFloating ||
|
||||
!widget.sidebarCanExpand ||
|
||||
widget.onTimelineHeightChanged == null) {
|
||||
_sidebarJunctionDragging = false;
|
||||
}
|
||||
if (oldWidget.controller != widget.controller) {
|
||||
oldWidget.controller.removeListener(_changed);
|
||||
widget.controller.addListener(_changed);
|
||||
@@ -85,6 +136,9 @@ class _DesktopWorkspaceShellState extends State<DesktopWorkspaceShell> {
|
||||
required ValueChanged<double> onResize,
|
||||
double direction = 1,
|
||||
VoidCallback? onEnd,
|
||||
VoidCallback? onStart,
|
||||
Set<WorkspaceResizeBoundary> highlightTargets = const {},
|
||||
Offset highlightOffset = Offset.zero,
|
||||
}) => SizedBox(
|
||||
width: WorkspaceLayoutMetrics.desktopResizeHitExtent,
|
||||
height: double.infinity,
|
||||
@@ -95,11 +149,17 @@ class _DesktopWorkspaceShellState extends State<DesktopWorkspaceShell> {
|
||||
direction: direction,
|
||||
onResize: onResize,
|
||||
onEnd: onEnd,
|
||||
onStart: onStart,
|
||||
highlightTargets: highlightTargets,
|
||||
highlightOffset: highlightOffset,
|
||||
),
|
||||
);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => widget.projectTabsLayout
|
||||
Widget build(BuildContext context) =>
|
||||
WorkspaceResizeHighlightScope(child: _workspace(context));
|
||||
|
||||
Widget _workspace(BuildContext context) => widget.projectTabsLayout
|
||||
? _projectWorkspace(context)
|
||||
: LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
@@ -164,6 +224,7 @@ class _DesktopWorkspaceShellState extends State<DesktopWorkspaceShell> {
|
||||
|
||||
return Scaffold(
|
||||
key: widget.scaffoldKey,
|
||||
drawerEnableOpenDragGesture: false,
|
||||
backgroundColor: Colors.transparent,
|
||||
drawer: Drawer(
|
||||
width: 320,
|
||||
@@ -317,6 +378,12 @@ class _DesktopWorkspaceShellState extends State<DesktopWorkspaceShell> {
|
||||
.toDouble();
|
||||
final floating = widget.controller.agentFloating;
|
||||
final collapsed = widget.sidebarCollapsed || floating;
|
||||
double resolveTimelineHeight(double? height) =>
|
||||
WorkspaceLayoutMetrics.resolveTimelineHeight(
|
||||
constraints.maxHeight,
|
||||
height,
|
||||
);
|
||||
final timelineHeight = resolveTimelineHeight(widget.timelineHeight);
|
||||
final geometry = DesktopWorkspaceGeometry(
|
||||
sidebarWidth: sidebarWidth,
|
||||
agentWidth: 0,
|
||||
@@ -324,6 +391,7 @@ class _DesktopWorkspaceShellState extends State<DesktopWorkspaceShell> {
|
||||
);
|
||||
return Scaffold(
|
||||
key: widget.scaffoldKey,
|
||||
drawerEnableOpenDragGesture: false,
|
||||
backgroundColor: Colors.transparent,
|
||||
drawer: Drawer(
|
||||
width: 320,
|
||||
@@ -356,20 +424,64 @@ class _DesktopWorkspaceShellState extends State<DesktopWorkspaceShell> {
|
||||
),
|
||||
],
|
||||
),
|
||||
if (!collapsed)
|
||||
if (!floating &&
|
||||
widget.sidebarCanExpand &&
|
||||
WorkspaceLayoutPolicy.desktopNavigationFits(width))
|
||||
Positioned(
|
||||
left: sidebarWidth - WorkspaceLayoutMetrics.desktopResizeSlop,
|
||||
left: collapsed
|
||||
? 0
|
||||
: sidebarWidth - WorkspaceLayoutMetrics.desktopResizeSlop,
|
||||
top: 0,
|
||||
bottom: 0,
|
||||
child: _gutter(
|
||||
name: 'project-sidebar',
|
||||
initialWidth: sidebarWidth,
|
||||
onResize: (value) => widget.onSidebarWidthChanged(
|
||||
value.clamp(
|
||||
WorkspaceLayoutMetrics.sidebarMinimumWidth,
|
||||
maximum,
|
||||
),
|
||||
highlightTargets: const {WorkspaceResizeBoundary.sidebar},
|
||||
highlightOffset: collapsed
|
||||
? const Offset(
|
||||
-WorkspaceLayoutMetrics.desktopResizeHitExtent / 2,
|
||||
0,
|
||||
)
|
||||
: Offset.zero,
|
||||
initialWidth: collapsed ? 0 : sidebarWidth,
|
||||
onStart: () => _startSidebarResize(sidebarWidth),
|
||||
onResize: (value) => _resizeSidebar(value, maximum),
|
||||
onEnd: _finishSidebarResize,
|
||||
),
|
||||
),
|
||||
if (!floating &&
|
||||
widget.sidebarCanExpand &&
|
||||
WorkspaceLayoutPolicy.desktopNavigationFits(width) &&
|
||||
widget.onTimelineHeightChanged != null)
|
||||
Positioned(
|
||||
left: collapsed
|
||||
? 0
|
||||
: sidebarWidth - WorkspaceLayoutMetrics.desktopResizeSlop,
|
||||
bottom:
|
||||
timelineHeight - WorkspaceLayoutMetrics.desktopResizeSlop,
|
||||
width: WorkspaceLayoutMetrics.desktopResizeHitExtent,
|
||||
height: WorkspaceLayoutMetrics.desktopResizeHitExtent,
|
||||
child: WorkspaceResizeHandle.junction(
|
||||
key: const Key('desktop-chat-timeline-junction'),
|
||||
highlightOffset: collapsed
|
||||
? const Offset(
|
||||
-WorkspaceLayoutMetrics.desktopResizeHitExtent / 2,
|
||||
0,
|
||||
)
|
||||
: Offset.zero,
|
||||
highlightTargets: const {
|
||||
WorkspaceResizeBoundary.sidebar,
|
||||
WorkspaceResizeBoundary.timeline,
|
||||
},
|
||||
initialWidth: collapsed ? 0 : sidebarWidth,
|
||||
initialHeight: timelineHeight,
|
||||
verticalDirection: -1,
|
||||
onStart: () =>
|
||||
_startSidebarResize(sidebarWidth, junction: true),
|
||||
onWidthChanged: (value) => _resizeSidebar(value, maximum),
|
||||
onHeightChanged: (value) => widget.onTimelineHeightChanged!(
|
||||
resolveTimelineHeight(value),
|
||||
),
|
||||
onEnd: _finishSidebarResize,
|
||||
),
|
||||
),
|
||||
if (floating)
|
||||
|
||||
Reference in new issue
Block a user