Navigation model rebuilt around two full-width drawers and a minimal header (sessions / title-switcher / usage ring / workspace): - Left sessions drawer: cross-project tree with live status indicators, swipe actions on sessions (rename/archive/delete) and on group headers (project edit / two-step close, worktree delete), reorder-only edit mode with collapsible project cards and draggable worktrees, app-level footer (connected instance, settings, pending web update). - Right workspace drawer: Changes / Files / Terminal / Notes / MCP as pill tabs (inactive tabs icon-only); panes stay mounted once visited. The full desktop file editor serves the Files tab; read/skill tool taps in chat open the file there at the requested line. - Header session switcher on title tap: 10 cross-project recents with live busy/attention indicators and project · branch metadata; the usage ring opens a metadata overlay with an explicit loading state. - The overflow menu is gone on phones (its destinations moved into the drawers); iPad keeps it until its dedicated layout pass. Correctness and continuity: - /auth/session answers bearer-first, so a stale WebView cookie can no longer mask a revoked device token; cold launches classify failures fast and land on an explicit connect screen. - Authoritative session snapshots raise frozen ordering baselines and stale live ranks — recents stay truthful after the app slept. - Cold launches reopen the last active session per instance (persisted pointer, confirmed against a sessions snapshot; a user-opened draft clears it), with a logo hold instead of a draft flash. Also: collapsed pill composer gains the stop control; chat tool rows share one 36px rhythm; Task subtool rows truncate; larger bottom safe area so the composer clears big-screen corner radii; Capacitor build hides About/Update (store updates apply there); widgets link to the sessions drawer with a list icon; MobileApp split into focused modules; five mobile-surface detectors unified; translucent borders normalized to 70%; all new strings translated across the 10 locales. iPad and foldable layouts are intentionally untouched - separate next version PR.
63 lines
2.0 KiB
TypeScript
63 lines
2.0 KiB
TypeScript
import React from 'react';
|
|
|
|
import { ProjectNotesTodoPanel } from '@/components/session/ProjectNotesTodoPanel';
|
|
import { useGitStore } from '@/stores/useGitStore';
|
|
import { useProjectsStore } from '@/stores/useProjectsStore';
|
|
import { useDirectoryStore } from '@/stores/useDirectoryStore';
|
|
import { formatDirectoryName } from '@/lib/utils';
|
|
|
|
export const ProjectContextPanel: React.FC<{
|
|
onActionComplete?: () => void;
|
|
onOpenPlan?: (plan: { path: string; title: string }) => void;
|
|
}> = ({ onActionComplete, onOpenPlan }) => {
|
|
const activeProjectId = useProjectsStore((state) => state.activeProjectId);
|
|
const projects = useProjectsStore((state) => state.projects);
|
|
const homeDirectory = useDirectoryStore((state) => state.homeDirectory);
|
|
const gitDirectories = useGitStore((state) => state.directories);
|
|
|
|
const activeProject = React.useMemo(() => {
|
|
if (activeProjectId) {
|
|
return projects.find((project) => project.id === activeProjectId) ?? projects[0] ?? null;
|
|
}
|
|
return projects[0] ?? null;
|
|
}, [activeProjectId, projects]);
|
|
|
|
const projectRef = React.useMemo(() => {
|
|
if (!activeProject) {
|
|
return null;
|
|
}
|
|
return {
|
|
id: activeProject.id,
|
|
path: activeProject.path,
|
|
};
|
|
}, [activeProject]);
|
|
|
|
const projectLabel = React.useMemo(() => {
|
|
if (!activeProject) {
|
|
return null;
|
|
}
|
|
return activeProject.label?.trim()
|
|
|| formatDirectoryName(activeProject.path, homeDirectory)
|
|
|| activeProject.path;
|
|
}, [activeProject, homeDirectory]);
|
|
|
|
const canCreateWorktree = React.useMemo(() => {
|
|
if (!activeProject) {
|
|
return false;
|
|
}
|
|
return gitDirectories.get(activeProject.path)?.isGitRepo === true;
|
|
}, [activeProject, gitDirectories]);
|
|
|
|
return (
|
|
<div className="h-full min-h-0 overflow-auto bg-background">
|
|
<ProjectNotesTodoPanel
|
|
projectRef={projectRef}
|
|
projectLabel={projectLabel}
|
|
canCreateWorktree={canCreateWorktree}
|
|
onActionComplete={onActionComplete}
|
|
onOpenPlan={onOpenPlan}
|
|
/>
|
|
</div>
|
|
);
|
|
};
|