diff --git a/.gitignore b/.gitignore index 2f35ea1..bdb22df 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,5 @@ pnpm-debug.log* # Go build output tmp/ bin/ + +.cgcignore diff --git a/Backend/internal/config/config.go b/Backend/internal/config/config.go index a5f3b09..63c713f 100644 --- a/Backend/internal/config/config.go +++ b/Backend/internal/config/config.go @@ -15,7 +15,6 @@ type Config struct { LogLevel string WebPort string APIPort string - WorkerPort string PostgresURL string ValkeyURL string ShutdownTimeout time.Duration @@ -28,7 +27,6 @@ func Load() *Config { LogLevel: getEnv("LOG_LEVEL", "debug"), WebPort: getEnv("BACKEND_WEB_PORT", "8080"), APIPort: getEnv("BACKEND_API_PORT", "8081"), - WorkerPort: getEnv("BACKEND_WORKER_PORT", "8082"), PostgresURL: getEnv("DATABASE_URL", "postgres://moku:moku_dev_password@localhost:5432/moku?sslmode=disable"), ValkeyURL: getEnv("VALKEY_URL", "redis://localhost:6379/0"), ShutdownTimeout: getDurationEnv("BACKEND_SHUTDOWN_TIMEOUT", 10*time.Second), @@ -43,8 +41,6 @@ func (c *Config) Address(serviceName string) string { port = c.WebPort case "api": port = c.APIPort - case "worker": - port = c.WorkerPort default: port = c.WebPort } diff --git a/Env/.env.example b/Env/.env.example index 0420468..65b3261 100644 --- a/Env/.env.example +++ b/Env/.env.example @@ -6,7 +6,6 @@ LOG_LEVEL=debug BACKEND_WEB_PORT=8080 BACKEND_API_PORT=8081 -BACKEND_WORKER_PORT=8082 BACKEND_SHUTDOWN_TIMEOUT=10s DATABASE_URL=postgres://moku:moku_dev_password@localhost:5432/moku?sslmode=disable diff --git a/Frontend/src/components/shell/AppShell/AppShell.module.scss b/Frontend/src/components/shell/AppShell/AppShell.module.scss index 54c29c1..f4ac941 100644 --- a/Frontend/src/components/shell/AppShell/AppShell.module.scss +++ b/Frontend/src/components/shell/AppShell/AppShell.module.scss @@ -23,6 +23,14 @@ background: var(--color-surface); } +.bodyRailCollapsed { + --rail-width: 0rem; +} + +.bodySidebarCollapsed { + --sidebar-width: 0rem; +} + .railColumn { min-height: 0; display: flex; @@ -97,7 +105,7 @@ position: absolute; bottom: var(--space-3); left: calc(var(--space-1) + (var(--rail-width) * 0.1)); - width: calc(var(--sidebar-width) + (var(--rail-width) * 0.9) - var(--space-2)); + width: max(12rem, calc(var(--sidebar-width) + (var(--rail-width) * 0.9) - var(--space-2))); right: auto; z-index: calc(var(--z-modal) + 1); pointer-events: none; @@ -112,6 +120,14 @@ --rail-width: 5rem; --sidebar-width: 17.25rem; } + + .bodyRailCollapsed { + --rail-width: 0rem; + } + + .bodySidebarCollapsed { + --sidebar-width: 0rem; + } } @include respond-down(tablet) { @@ -119,6 +135,58 @@ --rail-width: 4.5rem; --sidebar-width: 13.25rem; } + + .bodyRailCollapsed { + --rail-width: 0rem; + } + + .bodySidebarCollapsed { + --sidebar-width: 0rem; + } +} + +.bodyRailCollapsed .railColumn { + overflow: hidden; +} + +.bodySidebarCollapsed .railColumn { + --rail-dock-clearance: 0rem; +} + +.bodySidebarCollapsed:not(.bodyRailCollapsed) .railColumn { + --rail-bottom-offset: var(--space-3); +} + +.bodySidebarCollapsed .sidebarColumn { + --sidebar-dock-clearance: 0rem; + display: none; + overflow: hidden; + border-left-width: 0; + border-top-width: 0; +} + +.bodySidebarCollapsed .workspaceRegion { + grid-template-columns: minmax(0, 1fr); +} + +.bodySidebarCollapsed .workspaceMain { + border-left-color: transparent; +} + +.bodySidebarCollapsed:not(.bodyRailCollapsed) .workspaceMain { + border-top-width: 1px; + border-top-color: var(--shell-frame-border); + border-left-color: var(--shell-frame-border); + border-top-left-radius: var(--shell-top-left-radius); + box-shadow: none; +} + +.bodySidebarCollapsed:not(.bodyRailCollapsed) .workspaceRegion::before { + display: none; +} + +.bodySidebarCollapsed .sidebarDock { + display: none; } @include respond-down(mobile) { diff --git a/Frontend/src/components/shell/AppShell/AppShell.tsx b/Frontend/src/components/shell/AppShell/AppShell.tsx index cd17542..00b8dd6 100644 --- a/Frontend/src/components/shell/AppShell/AppShell.tsx +++ b/Frontend/src/components/shell/AppShell/AppShell.tsx @@ -11,6 +11,8 @@ import styles from "./AppShell.module.scss"; export const AppShell = (): JSX.Element => { const [themeState, setThemeState] = createSignal("light"); + const [isRailCollapsed, setIsRailCollapsed] = createSignal(false); + const [isSidebarCollapsed, setIsSidebarCollapsed] = createSignal(false); onMount((): void => { setThemeState(getDocumentTheme()); @@ -27,20 +29,37 @@ export const AppShell = (): JSX.Element => {
-
+
{/* Left server rail */}
- +
{/* Sidebar + main workspace frame */}
- + { + setIsRailCollapsed((collapsed) => !collapsed); + }} + />
- + { + setIsSidebarCollapsed((collapsed) => !collapsed); + }} + />
diff --git a/Frontend/src/components/shell/LeftRail/LeftRail.module.scss b/Frontend/src/components/shell/LeftRail/LeftRail.module.scss index e63ba89..541c9f9 100644 --- a/Frontend/src/components/shell/LeftRail/LeftRail.module.scss +++ b/Frontend/src/components/shell/LeftRail/LeftRail.module.scss @@ -1,7 +1,6 @@ .rail { --rail-workspace-size: var(--control-size-lg); --rail-action-size: var(--control-size-md); - --rail-dock-clearance: 8rem; position: relative; z-index: 3; flex: 1; @@ -10,10 +9,19 @@ flex-direction: column; align-items: center; gap: var(--space-3); - padding: var(--space-3) var(--space-2) calc(var(--space-3) + var(--rail-dock-clearance)); + padding: var(--space-3) var(--space-2) calc(var(--space-3) + var(--rail-dock-clearance, 8rem)); overflow: visible; } +.railCollapsed { + --rail-workspace-size: calc(var(--control-size-md) + 0.1rem); + --rail-action-size: calc(var(--control-size-md) + 0.1rem); + justify-content: flex-start; + gap: 0; + padding-top: var(--space-4); + padding-inline: var(--space-1); +} + .topCluster, .bottomCluster { width: 100%; @@ -25,12 +33,22 @@ .bottomCluster { margin-top: auto; + margin-bottom: var(--rail-bottom-offset, 0rem); } .topCluster { gap: var(--space-3); } +.railCollapsed .topCluster { + gap: var(--space-3); +} + +.railCollapsed .topCluster, +.railCollapsed .bottomCluster { + align-items: center; +} + .items { width: 100%; min-height: 0; diff --git a/Frontend/src/components/shell/LeftRail/LeftRail.tsx b/Frontend/src/components/shell/LeftRail/LeftRail.tsx index 5445cbf..4ab68e1 100644 --- a/Frontend/src/components/shell/LeftRail/LeftRail.tsx +++ b/Frontend/src/components/shell/LeftRail/LeftRail.tsx @@ -1,6 +1,6 @@ // Path: Frontend/src/components/shell/LeftRail/LeftRail.tsx -import { For, type JSX } from "solid-js"; +import { For, Show, type JSX } from "solid-js"; import { Plus } from "../../../lib/icons"; import { railItems, type RailItem } from "../data/shell.data"; import styles from "./LeftRail.module.scss"; @@ -42,29 +42,49 @@ const RailEntry = (props: RailEntryProps): JSX.Element => { ); }; -export const LeftRail = (): JSX.Element => { +type LeftRailProps = { + collapsed: boolean; +}; + +export const LeftRail = (props: LeftRailProps): JSX.Element => { const personalItem = railItems.find((item) => item.kind === "personal"); const organizationItems = railItems.filter((item) => item.kind === "organization"); return ( -