Kill design-only mock surfaces + wire real offline indicator
P1 — cut showcases:
- Delete gallery.tsx (Primitives) and StatesScreen/Specimen from states.tsx
(keep the reusable EmptyState/OfflineBanner/ModelAwayState).
- Delete placeholder-screen.tsx ('built in a later phase' stub).
- app-shell: drop the states/primitives views, the dev-rail block, the
PHASE/TITLE maps, the INBOX_UNREAD=3 fixture fallback, and the now-dead demo state.
P2 — real connectivity:
- Replace the fake 'toggle the connection (demo)' button with a live status dot
derived from the reconcile: green online, red when serving the stale cache
(gitea unreachable), amber while connecting. OfflineBanner + chat offline now
reflect real state, not a manual toggle.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -13,6 +13,7 @@ import { dirname, join } from 'node:path'
|
||||
import {
|
||||
appendDirective,
|
||||
createGiteaClient,
|
||||
discoverRepos,
|
||||
GiteaApiError,
|
||||
type DirectiveEntry,
|
||||
type GiteaClient,
|
||||
@@ -359,6 +360,17 @@ export function registerGiteaIpc(): void {
|
||||
return { ok: true as const }
|
||||
})
|
||||
|
||||
// Discover the owners + repos a token can reach, so onboarding can offer them
|
||||
// as dropdowns. Token-scoped (not repo-scoped) — no owner/repo needed yet.
|
||||
ipcMain.handle('config:discover', async (_event, conn: { baseUrl: string; token: string }) => {
|
||||
try {
|
||||
const found = await discoverRepos({ baseUrl: conn.baseUrl.replace(/\/+$/, ''), token: conn.token }, fetch)
|
||||
return { ok: true as const, ...found }
|
||||
} catch (e) {
|
||||
return { ok: false as const, error: e instanceof GiteaApiError ? `${e.status}` : e instanceof Error ? e.message : String(e) }
|
||||
}
|
||||
})
|
||||
|
||||
// Validate a token + repo before saving: any authed read on the repo proves access.
|
||||
ipcMain.handle('config:test', async (_event, cfg: AppConfig) => {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user