diff options
| author | Adam <[email protected]> | 2025-12-26 20:47:13 -0600 |
|---|---|---|
| committer | Adam <[email protected]> | 2025-12-26 20:47:13 -0600 |
| commit | 4385fa4dd79955cdb1d7086365ee1a238ebf9748 (patch) | |
| tree | 1809f39a2a00d8040fe1cd8b073a03d54cb2922a /packages/app/src/components/status-bar.tsx | |
| parent | 2b054bec9582b6a6ba421d5ea40576878f8e59e8 (diff) | |
| download | opencode-4385fa4dd79955cdb1d7086365ee1a238ebf9748.tar.gz opencode-4385fa4dd79955cdb1d7086365ee1a238ebf9748.zip | |
fix(desktop): prompt input fixes, directory and branch in status bar
Diffstat (limited to 'packages/app/src/components/status-bar.tsx')
| -rw-r--r-- | packages/app/src/components/status-bar.tsx | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/packages/app/src/components/status-bar.tsx b/packages/app/src/components/status-bar.tsx index e0e25c60b..d8a88503f 100644 --- a/packages/app/src/components/status-bar.tsx +++ b/packages/app/src/components/status-bar.tsx @@ -1,13 +1,31 @@ -import { Show, type ParentProps } from "solid-js" +import { createMemo, Show, type ParentProps } from "solid-js" import { usePlatform } from "@/context/platform" +import { useSync } from "@/context/sync" +import { useGlobalSync } from "@/context/global-sync" export function StatusBar(props: ParentProps) { const platform = usePlatform() + const sync = useSync() + const globalSync = useGlobalSync() + + const directoryDisplay = createMemo(() => { + const directory = sync.data.path.directory || "" + const home = globalSync.data.path.home || "" + const short = home && directory.startsWith(home) ? directory.replace(home, "~") : directory + const branch = sync.data.vcs?.branch + return branch ? `${short}:${branch}` : short + }) + return ( <div class="h-8 w-full shrink-0 flex items-center justify-between px-2 border-t border-border-weak-base bg-background-base"> - <Show when={platform.version}> - <span class="text-12-regular text-text-weak">v{platform.version}</span> - </Show> + <div class="flex items-center gap-3"> + <Show when={platform.version}> + <span class="text-12-regular text-text-weak">v{platform.version}</span> + </Show> + <Show when={directoryDisplay()}> + <span class="text-12-regular text-text-weak">{directoryDisplay()}</span> + </Show> + </div> <div class="flex items-center">{props.children}</div> </div> ) |
