Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

feat: FolderPicker Windows drive navigation, home shortcut, and error handling

[._.]/ Adam Eivydf159df92762
diff --git a/.changelog/v1.6.x.md b/.changelog/v1.6.x.md
new file mode 100644
index 0000000000..adc2928ec9
--- /dev/null
+++ b/.changelog/v1.6.x.md
@@ -0,0 +1,24 @@
+# Release v1.6.x - Changelog
+
+Released: Unreleased
+
+## Overview
+
+Folder picker improvements for Windows: drive selector, home directory quick-nav, and error handling.
+
+## Features
+
+### FolderPicker: Windows drive navigation
+- Added drive selector bar showing all available Windows drives (A–Z) so users can navigate between drives without typing paths
+- Active drive is visually highlighted with the accent color
+- Drive list is fetched from the server and only shown on Windows
+
+### FolderPicker: Home directory shortcut
+- Added a Home button in the path bar to quickly jump to the user's home directory (`~`)
+- Server resolves `~` to the actual home directory path
+
+## Fixes
+
+### FolderPicker: Error state handling
+- Directory load errors now display inline with a message and "Go to default directory" recovery button instead of silently failing
+- Select button is disabled when no path is loaded
diff --git a/client/src/components/FolderPicker.jsx b/client/src/components/FolderPicker.jsx
index 50a0edce6c..80fe949525 100644
--- a/client/src/components/FolderPicker.jsx
+++ b/client/src/components/FolderPicker.jsx
@@ -1,5 +1,5 @@
import { useState, useEffect, useRef } from 'react';
-import { Folder, FolderOpen, ChevronUp, X, Check } from 'lucide-react';
+import { Folder, FolderOpen, ChevronUp, HardDrive, Home, X, Check, AlertCircle } from 'lucide-react';
import * as api from '../services/api';
export default function FolderPicker({ value, onChange }) {
@@ -7,17 +7,24 @@ export default function FolderPicker({ value, onChange }) {
const [currentPath, setCurrentPath] = useState('');
const [parentPath, setParentPath] = useState(null);
const [directories, setDirectories] = useState([]);
+ const [drives, setDrives] = useState(null);
const [loading, setLoading] = useState(false);
+ const [error, setError] = useState(null);
const modalRef = useRef(null);
// Load directory contents
const loadDirectory = async (path = null) => {
setLoading(true);
- const result = await api.getDirectories(path).catch(() => null);
+ setError(null);
+ const result = await api.getDirectories(path).catch((err) => {
+ setError(err.message || 'Failed to load directory');
+ return null;
+ });
if (result) {
setCurrentPath(result.currentPath);
setParentPath(result.parentPath);
setDirectories(result.directories || []);
+ if (result.drives) setDrives(result.drives);
}
setLoading(false);
};
@@ -100,19 +107,61 @@ export default function FolderPicker({ value, onChange }) {
</button>
</div>
- {/* Current Path */}
- <div className="px-4 py-2 bg-port-bg border-b border-port-border">
- <p className="text-sm font-mono text-gray-400 truncate" title={currentPath}>
+ {/* Current Path + Quick Nav */}
+ <div className="px-4 py-2 bg-port-bg border-b border-port-border flex items-center gap-2">
+ <p className="flex-1 text-sm font-mono text-gray-400 truncate" title={currentPath}>
{currentPath}
</p>
+ {/* Home directory button */}
+ <button
+ type="button"
+ onClick={() => handleNavigate('~')}
+ className="p-1 text-gray-500 hover:text-white shrink-0"
+ title="Home directory"
+ >
+ <Home size={16} />
+ </button>
</div>
+ {/* Windows Drive Selector */}
+ {drives && drives.length > 0 && (
+ <div className="px-4 py-2 border-b border-port-border flex items-center gap-1 flex-wrap">
+ <HardDrive size={14} className="text-gray-500 shrink-0 mr-1" />
+ {drives.map((drive) => (
+ <button
+ key={drive}
+ type="button"
+ onClick={() => handleNavigate(drive)}
+ className={`px-2 py-0.5 text-xs font-mono rounded transition-colors ${
+ currentPath.toUpperCase().startsWith(drive.charAt(0).toUpperCase())
+ ? 'bg-port-accent text-white'
+ : 'bg-port-border text-gray-400 hover:text-white hover:bg-port-border/80'
+ }`}
+ >
+ {drive.charAt(0)}:
+ </button>
+ ))}
+ </div>
+ )}
+
{/* Directory List */}
<div className="flex-1 overflow-auto p-2 min-h-[300px]">
{loading ? (
<div className="flex items-center justify-center h-full text-gray-500">
Loading...
</div>
+ ) : error ? (
+ <div className="flex flex-col items-center justify-center h-full gap-2 text-gray-500 px-4">
+ <AlertCircle size={24} className="text-port-error" />
+ <p className="text-sm text-center">{error}</p>
+ <button
+ type="button"
+ onClick={() => loadDirectory(null)}
+ className="mt-2 text-xs text-port-accent hover:underline"
+ >
+ Go to default directory
+ </button>
+ </div>
) : (
<div className="space-y-1">
{/* Go Up */}
@@ -161,7 +210,8 @@ export default function FolderPicker({ value, onChange }) {
<button
type="button"
onClick={handleSelect}
- className="flex items-center gap-2 px-4 py-2 bg-port-accent hover:bg-port-accent/80 text-white rounded-lg transition-colors"
+ disabled={!currentPath}
+ className="flex items-center gap-2 px-4 py-2 bg-port-accent hover:bg-port-accent/80 text-white rounded-lg transition-colors disabled:opacity-50"
>
<Check size={18} />
Select This Folder
diff --git a/package-lock.json b/package-lock.json
index d060d8ef42..00aa5e97c6 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "portos",
- "version": "1.5.1",
+ "version": "1.6.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "portos",
- "version": "1.5.1",
+ "version": "1.6.0",
"license": "MIT",
"dependencies": {
"express": "^4.21.2",
diff --git a/package.json b/package.json
index fb89ffa2a7..441aee5a35 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "portos",
- "version": "1.5.1",
+ "version": "1.6.0",
"private": true,
"description": "Local dev machine App OS portal",
"author": "Adam Eivy (@antic|@atomantic)",
diff --git a/server/routes/scaffold.js b/server/routes/scaffold.js
index afa494418f..676c4cac54 100644
--- a/server/routes/scaffold.js
+++ b/server/routes/scaffold.js
@@ -1,11 +1,11 @@
import { Router } from 'express';
import { mkdir, writeFile, readdir, copyFile, readFile, stat } from 'fs/promises';
import { existsSync } from 'fs';
-import { join, dirname, resolve } from 'path';
+import { join, dirname, resolve, sep } from 'path';
import { fileURLToPath } from 'url';
import { exec, spawn } from 'child_process';
import { promisify } from 'util';
-import { homedir } from 'os';
+import { homedir, platform } from 'os';
import { createApp, getReservedPorts } from '../services/apps.js';
import { asyncHandler, ServerError } from '../lib/errorHandler.js';
import { safeJSONParse } from '../lib/fileUtils.js';
@@ -23,7 +23,7 @@ router.get('/directories', asyncHandler(async (req, res) => {
// Default to parent of PortOS project if no path provided
const defaultPath = resolve(join(__dirname, '../../..'));
- const targetPath = dirPath ? resolve(dirPath) : defaultPath;
+ const targetPath = dirPath === '~' ? homedir() : dirPath ? resolve(dirPath) : defaultPath;
// Validate path exists and is a directory
if (!existsSync(targetPath)) {
@@ -55,10 +55,22 @@ router.get('/directories', asyncHandler(async (req, res) => {
const parentPath = dirname(targetPath);
const canGoUp = parentPath !== targetPath; // Can't go above root
+ // On Windows, include available drive letters so users can navigate between drives
+ let drives = null;
+ if (platform() === 'win32') {
+ drives = [];
+ for (let i = 65; i <= 90; i++) {
+ const letter = String.fromCharCode(i);
+ const drivePath = `${letter}:${sep}`;
+ try { if (existsSync(drivePath)) drives.push(drivePath); } catch { /* skip inaccessible drives */ }
+ }
+ }
+
res.json({
currentPath: targetPath,
parentPath: canGoUp ? parentPath : null,
- directories
+ directories,
+ ...(drives && { drives })
});
}));