Skip to content

Commit 56603fd

Browse files
nedtwiggclaude
andcommitted
Improve AppBar information density.
- Separate projectDir and homeDir props so the display adapts when a real project directory is set (shows project name prominently with full abbreviated path on wider windows) - When projectDir is the home dir, display "~" with a tooltip showing the full path - Add tooltip to the project directory area showing the full path Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent caabe65 commit 56603fd

2 files changed

Lines changed: 27 additions & 10 deletions

File tree

standalone/src/AppBar.tsx

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export interface ShellEntry {
99

1010
interface AppBarProps {
1111
projectDir: string;
12+
homeDir: string;
1213
shells: ShellEntry[];
1314
}
1415

@@ -162,9 +163,17 @@ function ShellDropdown({ shells }: { shells: ShellEntry[] }) {
162163

163164
// ── AppBar ─────────────────────────────────────────────────────────────────
164165

165-
export function AppBar({ projectDir, shells }: AppBarProps) {
166-
const homeDir = projectDir;
166+
function projectName(dir: string): string {
167+
const sep = dir.includes('\\') ? '\\' : '/';
168+
const parts = dir.split(sep).filter(Boolean);
169+
return parts[parts.length - 1] ?? dir;
170+
}
171+
172+
export function AppBar({ projectDir, homeDir, shells }: AppBarProps) {
167173
const displayDir = abbreviateHome(projectDir, homeDir);
174+
const name = projectName(projectDir);
175+
// Show just the directory name when it's the home dir (avoids bare "~")
176+
const isHome = projectDir === homeDir;
168177

169178
return (
170179
<div
@@ -182,12 +191,19 @@ export function AppBar({ projectDir, shells }: AppBarProps) {
182191
</div>
183192
)}
184193

185-
{/* Project directory — centered fill */}
186-
<div data-tauri-drag-region className="flex min-w-0 flex-1 items-center justify-center">
187-
<span data-tauri-drag-region className="truncate px-4 text-muted">
188-
{displayDir}
189-
</span>
190-
</div>
194+
{/* Project directory — centered */}
195+
<Tip label={displayDir}>
196+
<div data-tauri-drag-region className="flex min-w-0 flex-1 items-center justify-center gap-1.5 px-4">
197+
<span data-tauri-drag-region className="truncate font-medium text-foreground/70">
198+
{isHome ? '~' : name}
199+
</span>
200+
{!isHome && (
201+
<span data-tauri-drag-region className="hidden truncate text-muted sm:inline">
202+
{displayDir}
203+
</span>
204+
)}
205+
</div>
206+
</Tip>
191207

192208
{/* Shell dropdown on the right (macOS) or window controls (Windows/Linux) */}
193209
{IS_MAC ? (

standalone/src/main.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,16 @@ async function bootstrap() {
2929
startUpdateCheck();
3030

3131
// Fetch app bar data from Rust backend
32-
const [projectDir, defaultShell] = await Promise.all([
32+
const [homeDir, defaultShell] = await Promise.all([
3333
invoke<string>("get_project_dir"),
3434
invoke<ShellEntry>("get_default_shell"),
3535
]);
36+
const projectDir = homeDir; // For now, project dir defaults to home
3637
const shells: ShellEntry[] = [defaultShell];
3738

3839
createRoot(document.getElementById("root")!).render(
3940
<StrictMode>
40-
<AppBar projectDir={projectDir} shells={shells} />
41+
<AppBar projectDir={projectDir} homeDir={homeDir} shells={shells} />
4142
<App
4243
initialPaneIds={result.paneIds}
4344
restoredLayout={result.layout}

0 commit comments

Comments
 (0)