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
@@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import { isDesktopShell, isVSCodeRuntime } from '@/lib/desktop';
|
||||
import { isCapacitorApp } from '@/lib/platform';
|
||||
import { isMobileSurfaceRuntime } from '@/lib/runtimeSurface';
|
||||
|
||||
type DeviceType = 'desktop' | 'mobile' | 'tablet';
|
||||
|
||||
@@ -65,8 +65,6 @@ const setRootDeviceAttributes = (
|
||||
}
|
||||
|
||||
const root = document.documentElement;
|
||||
const isMobile = deviceType === 'mobile';
|
||||
const isTablet = deviceType === 'tablet';
|
||||
|
||||
root.classList.remove('device-mobile', 'device-tablet', 'device-desktop');
|
||||
root.classList.add(
|
||||
@@ -79,19 +77,9 @@ const setRootDeviceAttributes = (
|
||||
|
||||
if (isDesktopShellRuntime) {
|
||||
root.classList.add('desktop-runtime');
|
||||
root.style.setProperty('--is-mobile', '0');
|
||||
root.style.setProperty('--device-type', 'desktop');
|
||||
root.style.setProperty('--font-scale', '1');
|
||||
root.style.setProperty('--has-coarse-pointer', '0');
|
||||
root.style.setProperty('--has-touch-input', '0');
|
||||
root.classList.remove('mobile-pointer');
|
||||
} else {
|
||||
root.classList.remove('desktop-runtime');
|
||||
root.style.setProperty('--is-mobile', isMobile ? '1' : '0');
|
||||
root.style.setProperty('--device-type', deviceType);
|
||||
root.style.setProperty('--font-scale', isMobile ? '0.9' : isTablet ? '0.95' : '1');
|
||||
root.style.setProperty('--has-coarse-pointer', hasTouchInput ? '1' : '0');
|
||||
root.style.setProperty('--has-touch-input', hasTouchInput ? '1' : '0');
|
||||
if (hasTouchInput) {
|
||||
root.classList.add('mobile-pointer');
|
||||
} else {
|
||||
@@ -128,10 +116,11 @@ export function getDeviceInfo(): DeviceInfo {
|
||||
isTablet = false;
|
||||
isDesktop = true;
|
||||
deviceType = 'desktop';
|
||||
} else if (isCapacitorApp()) {
|
||||
// The Capacitor shell IS the phone UI: every surface in that bundle is
|
||||
// built mobile-first, so wide devices (iPad, Android tablets) must not
|
||||
// fall into tablet/desktop branches scattered across shared components.
|
||||
} else if (isMobileSurfaceRuntime()) {
|
||||
// The mobile surface (Capacitor shell or hosted MobileApp) IS the phone
|
||||
// UI: every component in that tree is built mobile-first, so wide devices
|
||||
// (iPad, Android tablets, rotated phones) must not fall into
|
||||
// tablet/desktop branches scattered across shared components.
|
||||
// iPad-specific layout upgrades gate on isIPadApp()/orientation instead.
|
||||
isMobile = true;
|
||||
isTablet = false;
|
||||
@@ -288,16 +277,7 @@ const subscribeDeviceInfo = (listener: () => void): (() => void) => {
|
||||
|
||||
export function isMobileDeviceViaCSS(): boolean {
|
||||
if (typeof window === 'undefined') return false;
|
||||
|
||||
if (typeof window !== 'undefined' && isDesktopShell()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const root = document.documentElement;
|
||||
const isMobileValue = root.style.getPropertyValue('--is-mobile') ||
|
||||
getComputedStyle(root).getPropertyValue('--is-mobile');
|
||||
|
||||
return isMobileValue === '1' || isMobileValue === 'true';
|
||||
return readDeviceInfoSnapshot().isMobile;
|
||||
}
|
||||
|
||||
const isStandalonePwaRuntime = (): boolean => {
|
||||
|
||||
Reference in New Issue
Block a user