Skip to content

Commit 2a8f6cd

Browse files
CjLogicCrewCode Test
authored andcommitted
feat: Mobile version
MobileShell (src/renderer/src/components/ui/MobileShell.tsx): numeric z-index (var() invalid for zIndex), stale closure in useMobileShell, proper drag reset, a11y, single-active-sheet logic. Responsive CSS (styles.css bottom): app → 100dvh, no border on mobile, drawer becomes bottom sheet, terminal hidden on mobile (sheet-only), grid/composer/thread adapt, sheet keyframes. PWA (src/renderer/index.html + src/renderer/public/ + public/): viewport-fit=cover, theme-color, manifest, 192/512 icons (from build/icons/512), sw.js cache-first + SW registration in main.tsx (browser only) — verified out/renderer/manifest.json & icons present.
1 parent fb75719 commit 2a8f6cd

14 files changed

Lines changed: 873 additions & 79 deletions

File tree

‎public/icons/icon-192.png‎

23.9 KB
Loading

‎public/icons/icon-512.png‎

87.1 KB
Loading

‎public/manifest.json‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "CrewCode",
3+
"short_name": "CrewCode",
4+
"description": "Desktop ACE for orchestrating AI coding agents",
5+
"start_url": "/",
6+
"display": "standalone",
7+
"background_color": "#0f120f",
8+
"theme_color": "#0f120f",
9+
"orientation": "any",
10+
"icons": [
11+
{ "src": "/icons/icon-192.png", "sizes": "192x192", "type": "image/png", "purpose": "any maskable" },
12+
{ "src": "/icons/icon-512.png", "sizes": "512x512", "type": "image/png", "purpose": "any maskable" }
13+
]
14+
}

‎public/sw.js‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
const CACHE = 'crewcode-v1'
2+
const ASSETS = ['/', '/manifest.json']
3+
self.addEventListener('install', e => {
4+
e.waitUntil(caches.open(CACHE).then(c => c.addAll(ASSETS)).then(() => self.skipWaiting()))
5+
})
6+
self.addEventListener('activate', e => {
7+
e.waitUntil(caches.keys().then(keys => Promise.all(keys.filter(k => k !== CACHE).map(k => caches.delete(k)))).then(() => self.clients.claim()))
8+
})
9+
self.addEventListener('fetch', e => {
10+
if (e.request.method !== 'GET') return
11+
const url = new URL(e.request.url)
12+
if (url.origin !== location.origin) return
13+
if (e.request.headers.get('accept')?.includes('text/html')) {
14+
e.respondWith(fetch(e.request).then(r => { const c = r.clone(); caches.open(CACHE).then(cache => cache.put(e.request, c)); return r }).catch(() => caches.match(e.request).then(r => r || caches.match('/'))))
15+
return
16+
}
17+
e.respondWith(caches.match(e.request).then(cached => cached || fetch(e.request).then(r => { if (r.ok) { const c = r.clone(); caches.open(CACHE).then(cache => cache.put(e.request, c)) } return r })))
18+
})

‎src/renderer/index.html‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />
5-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover, maximum-scale=1, user-scalable=no" />
6+
<meta name="theme-color" content="#0f120f" />
7+
<meta name="apple-mobile-web-app-capable" content="yes" />
8+
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
9+
<link rel="manifest" href="/manifest.json" />
10+
<link rel="apple-touch-icon" href="/icons/icon-192.png" />
611
<title>CrewCode</title>
712
</head>
813
<body class="dark">
23.9 KB
Loading
87.1 KB
Loading

‎src/renderer/public/manifest.json‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "CrewCode",
3+
"short_name": "CrewCode",
4+
"description": "Desktop ACE for orchestrating AI coding agents",
5+
"start_url": "/",
6+
"display": "standalone",
7+
"background_color": "#0f120f",
8+
"theme_color": "#0f120f",
9+
"orientation": "any",
10+
"icons": [
11+
{ "src": "/icons/icon-192.png", "sizes": "192x192", "type": "image/png", "purpose": "any maskable" },
12+
{ "src": "/icons/icon-512.png", "sizes": "512x512", "type": "image/png", "purpose": "any maskable" }
13+
]
14+
}

‎src/renderer/public/sw.js‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
const CACHE = 'crewcode-v1'
2+
const ASSETS = ['/', '/manifest.json']
3+
self.addEventListener('install', e => {
4+
e.waitUntil(caches.open(CACHE).then(c => c.addAll(ASSETS)).then(() => self.skipWaiting()))
5+
})
6+
self.addEventListener('activate', e => {
7+
e.waitUntil(caches.keys().then(keys => Promise.all(keys.filter(k => k !== CACHE).map(k => caches.delete(k)))).then(() => self.clients.claim()))
8+
})
9+
self.addEventListener('fetch', e => {
10+
if (e.request.method !== 'GET') return
11+
const url = new URL(e.request.url)
12+
if (url.origin !== location.origin) return
13+
if (e.request.headers.get('accept')?.includes('text/html')) {
14+
e.respondWith(fetch(e.request).then(r => { const c = r.clone(); caches.open(CACHE).then(cache => cache.put(e.request, c)); return r }).catch(() => caches.match(e.request).then(r => r || caches.match('/'))))
15+
return
16+
}
17+
e.respondWith(caches.match(e.request).then(cached => cached || fetch(e.request).then(r => { if (r.ok) { const c = r.clone(); caches.open(CACHE).then(cache => cache.put(e.request, c)) } return r })))
18+
})

‎src/renderer/src/App.tsx‎

Lines changed: 344 additions & 78 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)