Skip to content

Commit 3d2e7e5

Browse files
committed
chore: transition to single-account system and migrate legacy data
- Remove all multi-account and guest-mode UI components (AuthScreen, GuestSyncPopup, dashboard banners). - Refactor AuthManager to automatically login/create a single local user based on the OS username. - Rewrite migration sweep to robustly merge all legacy guest and multi-account data into the active local profile. - Overhaul SettingsPage to replace password change/logout with a simple username modifier. - Bump version to 3.8.10-alpha.
1 parent e6d011a commit 3d2e7e5

14 files changed

Lines changed: 256 additions & 1236 deletions

File tree

frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "stasis",
33
"private": true,
4-
"version": "3.8.10-alpha",
4+
"version": "3.8.11-alpha",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",

frontend/src-tauri/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "stasis"
3-
version = "3.8.10-alpha"
3+
version = "3.8.11-alpha"
44
description = "Stasis Desktop App"
55
authors = ["you"]
66
edition = "2021"

frontend/src-tauri/tauri.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://schema.tauri.app/config/2",
33
"productName": "Stasis",
4-
"version": "3.8.10-alpha",
4+
"version": "3.8.11-alpha",
55
"identifier": "com.arsh.stasis",
66
"build": {
77
"beforeDevCommand": "npm run dev",

frontend/src/App.jsx

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { invoke } from "@tauri-apps/api/core";
44
import { load } from "@tauri-apps/plugin-store";
55
import { useState, useEffect, useRef } from 'react';
66
import { AuthProvider, useAuth } from './context/AuthContext';
7-
import AuthScreen from './pages/AuthScreen';
87

98
/**
109
* Startup transition flow:
@@ -35,7 +34,7 @@ function AppContent() {
3534
const [backendReady, setBackendReady] = useState(false);
3635
// Ref to hold prefetched data from the LoadingScreen during the auth-loading phase
3736
const cachedDataRef = useRef(null);
38-
const { user, isGuest, loading: authLoading } = useAuth();
37+
const { user, loading: authLoading } = useAuth();
3938

4039
const doTransition = async (prefetchedData) => {
4140
setInitialData(prefetchedData || null);
@@ -67,37 +66,32 @@ function AppContent() {
6766
setTimeout(() => setStage("done"), 750);
6867
};
6968

69+
7070
// ── Effect: When authLoading flips to false AND backend is already ready,
7171
// immediately start the dashboard transition (no second health-check needed).
7272
useEffect(() => {
73-
if (!authLoading && (user || isGuest) && backendReady && stage === "idle") {
73+
if (!authLoading && user && backendReady && stage === "idle") {
7474
doTransition(cachedDataRef.current);
7575
}
76-
}, [authLoading, user, isGuest, backendReady]);
76+
}, [authLoading, user, backendReady, stage]);
7777

7878
// ── Show LoadingScreen while auth is still resolving ──
7979
// This runs the backend health-check polling concurrently with auth validation.
80-
if (authLoading) {
80+
if (authLoading || !user) {
8181
return (
8282
<LoadingScreen
8383
onReady={(data) => {
8484
// Backend is healthy — cache the data. We'll use it once auth resolves.
8585
cachedDataRef.current = data;
8686
setBackendReady(true);
87-
// Note: we do NOT call doTransition here because we don't know yet
88-
// whether auth will succeed (user) or fail (show AuthScreen).
8987
}}
9088
/>
9189
);
9290
}
9391

94-
// ── Auth resolved: no valid user and not guest → show login screen ──
95-
if (!user && !isGuest) {
96-
return <AuthScreen />;
97-
}
98-
99-
// ── Auth resolved: valid user or guest present ──
92+
// ── Auth resolved: valid user present ──
10093
return (
94+
10195
<>
10296
{/* Dashboard renders underneath as soon as the API is ready */}
10397
{stage !== "idle" && (

frontend/src/WellbeingDashboard.jsx

Lines changed: 3 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ import DaySummary from "./pages/DaySummary";
1010
import { Skeleton, SkeletonCard, TabPanel, AppIcon } from "./shared/components";
1111
import { localYMD, fmtTime, fmtTimeFull } from "./shared/utils";
1212
import { useLiveClock, useVisibilityPolling } from "./shared/hooks";
13-
import { useAuth } from "./context/AuthContext";
14-
import GuestSyncPopup from "./components/GuestSyncPopup";
1513

1614
// ─── useReducer — atomic state for all dashboard data ─────────────────────────
1715

@@ -265,7 +263,6 @@ function trimDashboardCache(cache, keepDates = []) {
265263

266264
export default function WellbeingDashboard({ onDisconnect, initialData = null }) {
267265
const BASE = import.meta.env.VITE_API_URL || "http://127.0.0.1:7432";
268-
const { isGuest, logout } = useAuth();
269266

270267
const [dashState, dispatch] = useReducer(dashReducer, {
271268
...initialDashState,
@@ -597,34 +594,6 @@ export default function WellbeingDashboard({ onDisconnect, initialData = null })
597594
}
598595
`}</style>
599596

600-
{isGuest && (
601-
<div style={{
602-
position: "absolute", top: 0, left: 0, right: 0, zIndex: 10,
603-
background: "rgba(248, 113, 113, 0.15)", borderBottom: "1px solid rgba(248, 113, 113, 0.3)",
604-
backdropFilter: "blur(8px)", padding: "8px 24px",
605-
display: "flex", alignItems: "center", justifyContent: "space-between",
606-
fontSize: "12px", fontFamily: "'DM Sans', sans-serif"
607-
}}>
608-
<div style={{ display: "flex", alignItems: "center", gap: "8px", color: "#f8fafc" }}>
609-
<span style={{ color: "#f87171" }}></span>
610-
<strong>Guest Mode:</strong> Your data is not being saved to an account.
611-
</div>
612-
<button
613-
onClick={logout}
614-
style={{
615-
background: "transparent", border: "1px solid rgba(255,255,255,0.2)",
616-
color: "#f8fafc", borderRadius: "6px", padding: "4px 12px",
617-
cursor: "pointer", fontSize: "11px", fontWeight: 600,
618-
transition: "background 0.2s"
619-
}}
620-
onMouseEnter={e => e.target.style.background = "rgba(255,255,255,0.1)"}
621-
onMouseLeave={e => e.target.style.background = "transparent"}
622-
>
623-
Sign In
624-
</button>
625-
</div>
626-
)}
627-
628597
{/* ── AMBIENT ORBS — shift to indigo in historical mode ── */}
629598
<div className="orb-float" style={{
630599
position: "fixed", top: "-10%", left: "-5%", width: 500, height: 500,
@@ -661,8 +630,9 @@ export default function WellbeingDashboard({ onDisconnect, initialData = null })
661630
<div ref={scrollRef} className="db-scroll-wrapper"
662631
style={{ height: "100%", width: "100%", overflowY: "auto", overflowX: "hidden", position: "relative", zIndex: 4 }}>
663632
<div style={{
664-
maxWidth: 1280, width: "100%", margin: "0 auto", padding: "28px 24px",
665-
paddingTop: isGuest ? "48px" : "28px",
633+
maxWidth: "1400px", margin: "0 auto", minHeight: "100vh", position: "relative",
634+
paddingTop: "28px",
635+
paddingLeft: "24px", paddingRight: "24px", paddingBottom: "40px",
666636
opacity: mounted ? 1 : 0, transform: mounted ? "none" : "translateY(20px)",
667637
transition: "opacity 0.7s ease, transform 0.7s ease",
668638
}}>
@@ -939,7 +909,6 @@ export default function WellbeingDashboard({ onDisconnect, initialData = null })
939909
{showSettings && showSettings !== "drawer" && (
940910
<SettingsPage key={showSettings} initialSection={showSettings} onClose={() => setShowSettings(null)} />
941911
)}
942-
<GuestSyncPopup />
943912
</div>
944913
);
945914
}

frontend/src/components/GuestSyncPopup.jsx

Lines changed: 0 additions & 214 deletions
This file was deleted.

0 commit comments

Comments
 (0)