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

fix(ui): truncate long sidebar nav labels instead of overflowing container

Adam Eivyfe8bb1aa8446
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 7e476a1244..ab03aa8efc 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -10,6 +10,7 @@
## Fixed
+- **Sidebar nav labels truncate instead of pushing the container wider.** Long nav labels (e.g. third-party app names) could force the sidebar's flex container to overflow horizontally on narrower viewports, distorting the rest of the layout. Added `min-w-0` to every flex parent in the nav row tree and `truncate` to the label `<span>` elements (top-level links, section buttons, and child links), plus `shrink-0` on the child icon so it can't be squeezed out, and `overflow-x-hidden min-w-0` on the `<nav>` itself so the scroll axis stays vertical. File: `client/src/components/Layout.jsx`.
- **CoS agent PRs now actually open.** Every recent CoS-agent automation that finished its work and pushed its branch was failing at the PR-creation step with `Failed to create PR for <branch>: spawn is not defined`, then triggering `[Recovery] Investigate and retry failed PR for branch …` recovery tasks for the orchestrator to clean up. Root cause: a refactor (commit `17311282`) extracted `execGit` to `server/lib/execGit.js` and dropped the `import { spawn } from 'child_process'` line from `server/services/git.js` — but `createPR()` still calls `spawn('gh', …)` directly, so every PR creation hit a `ReferenceError`. The existing `cleanupAgentWorktree` test suite mocked `git.createPR` so the bug never surfaced in CI. Restored the import and added `server/services/git.test.js` with a regression test that calls the real `createPR` against a non-existent path: success path returns `{ success: false, error: '<gh failure>' }` instead of throwing. The recovery flow continues to work as a safety net, but agents will now hit the happy path and open the PR directly. Files: `server/services/git.js`, `server/services/git.test.js` (new).
- **Mobile responsiveness — narrow forms and wide tables no longer break on small screens.** Four spots were squeezing or clipping content under ~640px wide viewports: (1) the Create App form's Port fields used `grid-cols-3` so the three port inputs (UI, Dev UI, API) crammed into ~100px each on a phone — now `grid-cols-1 sm:grid-cols-3` so they stack on mobile and only side-by-side on `sm:` and up; (2) the Body tab's eye-exam history table has eight columns (Date, L SPH/CYL/AXIS, R SPH/CYL/AXIS, actions) and was wrapped in `overflow-hidden` so the rightmost columns were invisible on mobile — now wrapped in `overflow-x-auto` with `min-w-[640px]` on the table so it scrolls horizontally instead of clipping; (3) the Posture session-history table (5 columns) had the same `overflow-hidden` wrapper — now `overflow-x-auto` with `min-w-[520px]`; (4) the Data Manager Backup Archives table (Archive name + Size + Created + delete button) — same fix with `min-w-[480px]`. Files: `client/src/pages/CreateApp.jsx`, `client/src/pages/DataManager.jsx`, `client/src/components/meatspace/tabs/BodyTab.jsx`, `client/src/components/meatspace/post/PostHistory.jsx`.
diff --git a/client/src/components/Layout.jsx b/client/src/components/Layout.jsx
index b027e1f815..5c4727b836 100644
--- a/client/src/components/Layout.jsx
+++ b/client/src/components/Layout.jsx
@@ -415,14 +415,14 @@ export default function Layout() {
href={href}
target="_blank"
rel="noopener noreferrer"
- className={`flex items-center gap-3 mx-2 px-3 py-2.5 rounded-lg text-sm font-medium transition-colors ${
+ className={`flex items-center gap-3 mx-2 px-3 py-2.5 rounded-lg text-sm font-medium transition-colors min-w-0 ${
collapsed ? 'lg:justify-center lg:px-2' : 'justify-between'
} text-gray-400 hover:text-white hover:bg-port-border/50`}
title={collapsed ? item.label : undefined}
>
- <div className="flex items-center gap-3">
+ <div className="flex items-center gap-3 min-w-0">
<Icon size={20} className="shrink-0" />
- <span className={`whitespace-nowrap ${collapsed ? 'lg:hidden' : ''}`}>
+ <span className={`whitespace-nowrap min-w-0 truncate ${collapsed ? 'lg:hidden' : ''}`}>
{item.label}
</span>
</div>
@@ -438,7 +438,7 @@ export default function Layout() {
to={item.to}
end={item.to === '/'}
onClick={() => setMobileOpen(false)}
- className={`flex items-center gap-3 mx-2 px-3 py-2.5 rounded-lg text-sm font-medium transition-colors ${
+ className={`flex items-center gap-3 mx-2 px-3 py-2.5 rounded-lg text-sm font-medium transition-colors min-w-0 ${
collapsed ? 'lg:justify-center lg:px-2' : 'justify-between'
} ${
isActive(item.to)
@@ -447,7 +447,7 @@ export default function Layout() {
}`}
title={collapsed ? item.label : undefined}
>
- <div className="flex items-center gap-3">
+ <div className="flex items-center gap-3 min-w-0">
<div className="relative">
<Icon size={20} className="shrink-0" />
{/* Badge for collapsed state */}
@@ -457,7 +457,7 @@ export default function Layout() {
</span>
)}
</div>
- <span className={`whitespace-nowrap ${collapsed ? 'lg:hidden' : ''}`}>
+ <span className={`whitespace-nowrap min-w-0 truncate ${collapsed ? 'lg:hidden' : ''}`}>
{item.label}
</span>
</div>
@@ -496,15 +496,15 @@ export default function Layout() {
}`;
return (
- <div key={item.label} className="mx-2">
- <div className={`flex items-stretch ${collapsed ? 'lg:justify-center' : ''}`}>
+ <div key={item.label} className="mx-2 min-w-0">
+ <div className={`flex items-stretch min-w-0 ${collapsed ? 'lg:justify-center' : ''}`}>
<button
type="button"
onClick={navigateToSection}
- className={`flex-1 ${sectionRowClasses} ${collapsed ? 'lg:justify-center lg:px-2' : 'justify-between'}`}
+ className={`flex-1 min-w-0 ${sectionRowClasses} ${collapsed ? 'lg:justify-center lg:px-2' : 'justify-between'}`}
title={collapsed ? item.label : undefined}
>
- <div className="flex items-center gap-3">
+ <div className="flex items-center gap-3 min-w-0">
<div className="relative">
<Icon size={20} className="shrink-0" />
{item.showBadge && unreadCount > 0 && collapsed && (
@@ -513,7 +513,7 @@ export default function Layout() {
</span>
)}
</div>
- <span className={`whitespace-nowrap ${collapsed ? 'lg:hidden' : ''}`}>
+ <span className={`whitespace-nowrap min-w-0 truncate ${collapsed ? 'lg:hidden' : ''}`}>
{item.label}
</span>
</div>
@@ -540,7 +540,7 @@ export default function Layout() {
{/* Children items */}
{expandedSections[item.label] && !collapsed && (
- <div className="ml-4 mt-1">
+ <div className="ml-4 mt-1 min-w-0">
{item.children.map((child, childIndex) => {
if (child.separator) {
return <div key={`child-sep-${childIndex}`} className="mx-3 my-1 border-t border-port-border" />;
@@ -556,11 +556,11 @@ export default function Layout() {
href={childHref}
target="_blank"
rel="noopener noreferrer"
- className="flex items-center justify-between gap-3 px-3 py-2 rounded-lg text-sm transition-colors text-gray-500 hover:text-white hover:bg-port-border/50"
+ className="flex items-center justify-between gap-3 px-3 py-2 rounded-lg text-sm transition-colors text-gray-500 hover:text-white hover:bg-port-border/50 min-w-0"
>
- <div className="flex items-center gap-3">
+ <div className="flex items-center gap-3 min-w-0">
<ChildIcon size={16} />
- <span>{child.label}</span>
+ <span className="min-w-0 truncate">{child.label}</span>
</div>
<ExternalLink size={12} className="text-gray-500" />
</a>
@@ -575,14 +575,14 @@ export default function Layout() {
to={child.to}
end={child.end}
onClick={() => setMobileOpen(false)}
- className={`flex items-center gap-3 px-3 py-2 rounded-lg text-sm transition-colors ${
+ className={`flex items-center gap-3 px-3 py-2 rounded-lg text-sm transition-colors min-w-0 ${
childActive
? 'bg-port-accent/10 text-port-accent'
: 'text-gray-500 hover:text-white hover:bg-port-border/50'
}`}
>
- <ChildIcon size={16} />
- <span>{child.label}</span>
+ <ChildIcon size={16} className="shrink-0" />
+ <span className="min-w-0 truncate">{child.label}</span>
</NavLink>
);
})}
@@ -664,7 +664,7 @@ export default function Layout() {
</div>
{/* Nav items */}
- <nav className="flex-1 py-4 overflow-y-auto">
+ <nav className="flex-1 py-4 overflow-y-auto overflow-x-hidden min-w-0">
{resolvedNavItems.map(renderNavItem)}
</nav>