refactor(desktop): reorganize workspace panels and navigation
Gitea CI / Windows x64 and Android (pull_request) Successful in 16m21s
Gitea CI / Gitea CI passed (pull_request) Successful in 3s

This commit is contained in:
lingjhf committed 2026-10-06 12:11:59 +08:00
1 parent 826745b407
commit 1f73765745
92 files changed
+5811 -2650

No files matched your search

@@ -23,8 +23,7 @@ final class DesktopWorkspaceGeometry {
required this.editorHidden,
});
static const editorCollapseWidth = 480.0;
static const editorCollapseDragBuffer = editorCollapseWidth / 3;
static const editorMinimumWidth = 480.0;
static const editorRestoreWidth = 560.0;
final double sidebarWidth;
@@ -42,7 +41,7 @@ final class DesktopWorkspaceGeometry {
required bool sidebarCollapsed,
double? sidebarWidth,
double? agentWidth,
bool editorCollapsedByAgent = false,
bool agentFullscreen = false,
}) {
final navigationWidth =
(sidebarWidth ?? WorkspaceLayoutMetrics.sidebarDefaultWidth)
@@ -57,19 +56,17 @@ final class DesktopWorkspaceGeometry {
.clamp(220.0, math.max(220.0, width - navigationSpace - 1))
.toDouble()
: 0.0;
final remaining = width - navigationSpace - requestedAgentWidth - 1;
final hidden =
mode == WorkspaceMode.agent &&
(width - navigationSpace - 1 < 220 + editorCollapseWidth ||
(editorCollapsedByAgent && remaining < editorRestoreWidth) ||
remaining <= editorCollapseWidth - editorCollapseDragBuffer);
(width - navigationSpace - 1 < 220 + editorMinimumWidth ||
agentFullscreen);
return DesktopWorkspaceGeometry(
sidebarWidth: navigationWidth,
agentWidth: hidden
? width - navigationSpace
: mode == WorkspaceMode.agent
? requestedAgentWidth
.clamp(220.0, width - navigationSpace - editorCollapseWidth - 1)
.clamp(220.0, width - navigationSpace - editorMinimumWidth - 1)
.toDouble()
: 0,
editorHidden: hidden,