From 4508d956dce4e283110ed6c731816b738b5f33cd Mon Sep 17 00:00:00 2001 From: Jason Date: Wed, 15 Jul 2026 16:21:19 -0500 Subject: [PATCH] Route app auth through workspace client --- CHANGELOG.md | 1 + ROADMAP.md | 2 +- src/App.tsx | 8 ++++---- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 202320f..c899d1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - Recorded the active development direction: use the local HotView/hot-reload setup for iterative app work and defer web/local builds and hosted deployment unless explicitly requested. - Started Phase 4 shared app core cleanup by adding an explicit `StudyDataClient` contract and browser/Tauri data adapters behind the existing study client API. - Added explicit workspace/auth client contracts so local HotView storage and hosted workspace persistence sit behind the same app-core boundary. +- Routed the app shell's hosted-login checks through the auth client instead of reading the hosted environment flag directly. ## 0.1.31 - 2026-07-15 diff --git a/ROADMAP.md b/ROADMAP.md index c5a26e5..67fe81d 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -118,7 +118,7 @@ Definition of done: Goal: stop treating local preview, hosted web, and Tauri as separate code paths. -Current foundation note: `src/studyDataClient.ts` now defines the app-level resource/query contract, and `src/studyClient.ts` routes existing UI calls through browser and Tauri adapters. `src/workspace.ts` also defines workspace/auth client contracts so local HotView storage and hosted persistence share the same app-facing boundary. The browser adapter still owns the HotView JSON/JSONL package loading path, but the UI no longer needs to know which adapter is active. +Current foundation note: `src/studyDataClient.ts` now defines the app-level resource/query contract, and `src/studyClient.ts` routes existing UI calls through browser and Tauri adapters. `src/workspace.ts` also defines workspace/auth client contracts so local HotView storage and hosted persistence share the same app-facing boundary. The app shell now uses the auth client instead of reading the hosted environment flag directly. The browser adapter still owns the HotView JSON/JSONL package loading path, but the UI no longer needs to know which adapter is active. Tasks: diff --git a/src/App.tsx b/src/App.tsx index 458b4ca..c07bad3 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -14,7 +14,7 @@ import { import { createSession, defaultTranslationId, - hostedWorkspaceEnabled, + getAuthClient, loadHostedSession, loadWorkspaceSnapshot, loginHostedWorkspace, @@ -461,7 +461,7 @@ function App() { setAuthRequired(false) workspaceHydrated.current = false - if (hostedWorkspaceEnabled()) { + if (getAuthClient().enabled) { const session = await loadHostedSession() if (cancelled()) return setHostedUser(session.user) @@ -521,7 +521,7 @@ function App() { studySettings: studySettingsSnapshot, }).catch((reason) => { console.warn( - hostedWorkspaceEnabled() + getAuthClient().enabled ? 'Unable to save hosted workspace.' : 'Unable to save local workspace.', reason, @@ -2547,7 +2547,7 @@ function App() { const splitTemplate = `${splitPercent}fr 6px ${100 - splitPercent}fr` - if (authRequired && hostedWorkspaceEnabled()) { + if (authRequired && getAuthClient().enabled) { return renderHostedLogin() }