Route app auth through workspace client
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
+1
-1
@@ -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:
|
||||
|
||||
|
||||
+4
-4
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user