feat(mobile): mobile app navigation rework and beta-feedback closeout (#2561)
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.
This commit is contained in:
committed by
GitHub
parent
ea8cc5d7b0
commit
86ef96302d
@@ -68,6 +68,7 @@ import { useSessionWorktreeStore } from "./session-worktree-store"
|
||||
import { getAttachedSessionDirectory } from "./session-worktree-contract"
|
||||
import { setSessionOpener } from "./session-navigation"
|
||||
import { getRuntimeKey } from "@/lib/runtime-switch"
|
||||
import { clearLastActiveSession, persistLastActiveSession } from "./last-session-cache"
|
||||
import { persistWorktreeTopology, readPersistedWorktreeTopology } from "./worktree-topology-cache"
|
||||
import { rememberRuntimeLiveStatus } from "./runtime-live-memory"
|
||||
|
||||
@@ -284,7 +285,7 @@ export type SessionUIState = {
|
||||
setCurrentSession: (id: string | null, directoryHint?: string | null) => void
|
||||
prepareForRuntimeSwitch: (apiBaseUrl?: string | null) => void
|
||||
restoreForRuntimeSwitch: (apiBaseUrl?: string | null) => void
|
||||
openNewSessionDraft: (options?: Partial<NewSessionDraftState>) => void
|
||||
openNewSessionDraft: (options?: Partial<NewSessionDraftState> & { automatic?: boolean }) => void
|
||||
closeNewSessionDraft: () => void
|
||||
setNewSessionDraftTarget: (target: { projectId?: string | null; selectedProjectId?: string | null; directoryOverride?: string | null }, options?: { force?: boolean }) => void
|
||||
setDraftPreserveDirectoryOverride: (value: boolean) => void
|
||||
@@ -612,6 +613,12 @@ export const useSessionUIStore = create<SessionUIState>()((set, get) => ({
|
||||
// same child store that send/SSE events will update during startup races.
|
||||
set({ currentSessionId: id, currentSessionDirectory: id ? resolvedDir ?? null : null })
|
||||
writeRuntimeSessionMemory(key, { sessionId: id, directory: resolvedDir ?? null })
|
||||
// Keep the last NON-null session per runtime across app restarts (cold
|
||||
// mobile launches reopen it after the instance reconnects). Going back to
|
||||
// a draft intentionally does not erase it.
|
||||
if (id) {
|
||||
persistLastActiveSession(key, { sessionId: id, directory: resolvedDir ?? null })
|
||||
}
|
||||
|
||||
// Kick off the message fetch on the same tick, before React commits the
|
||||
// state change and fires ChatContainer.useEffect. The fetch is
|
||||
@@ -710,6 +717,15 @@ export const useSessionUIStore = create<SessionUIState>()((set, get) => ({
|
||||
// openNewSessionDraft
|
||||
// ---------------------------------------------------------------------------
|
||||
openNewSessionDraft: (options) => {
|
||||
// A USER-initiated draft open is a navigation choice: the next cold launch
|
||||
// should land on the draft, not re-open the session left behind — drop the
|
||||
// persisted last-session pointer for this runtime. `automatic: true` marks
|
||||
// programmatic fallback opens (e.g. ChatContainer's "no session active"
|
||||
// auto-draft at boot), which must NOT consume the pointer — the cold-launch
|
||||
// restore races exactly that auto-open.
|
||||
if (!options?.automatic) {
|
||||
clearLastActiveSession(runtimeMemoryKey())
|
||||
}
|
||||
const projectsState = useProjectsStore.getState()
|
||||
const projects = projectsState.projects
|
||||
const availableWorktreesByProject = get().availableWorktreesByProject
|
||||
|
||||
Reference in New Issue
Block a user