remove the onboarding flow and the accountMode leftover

Onboarding was dead in three layers:

- The OnboardingAdmin screen was only reachable from a route block in App.tsx
  that has been commented out, so it never rendered. Its ServerTypeCard carried
  accountMode ('organization' | 'single'), inherited from the codebase this was
  based on and meaningless for a single-user platform.
- Two /onboarding-complete endpoints, one public and one protected, that no
  frontend code called. Both read a server_config key that was never written, so
  both answered false while the app's own path defaulted to true.
- HomeScreen gated on settings.onboarding.complete to show a welcome panel, and
  seedHomeDir created an Onboarding folder from DATA_PATH/Onboarding and
  /Onboarding_Admin — neither seed directory exists, so it only ever produced an
  empty folder.

Also drops the onboarding key from UserSettings and the now-empty home-header
panel from the default home layout.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
brunorezio
2026-07-25 23:30:20 +01:00
co-authored by Claude Opus 5
parent 10400310c5
commit 1ac79f9c68
15 changed files with 1825 additions and 382 deletions
+2 -22
View File
@@ -18,10 +18,8 @@ async function getUserTtsVoice(userId: number): Promise<string | null> {
return null;
}
const DEFAULT_HOME_DIRS = ['Downloads', 'Documents', 'Music', 'Videos', 'Pictures', 'Onboarding'];
const DEFAULT_HOME_DIRS = ['Downloads', 'Documents', 'Music', 'Videos', 'Pictures'];
const OLD_CACHE_DIRS = ['ocr', 'tts', 'transcriptions', 'audio', 'video'];
const ONBOARDING_SEED = join(DATA_PATH, 'Onboarding');
const ONBOARDING_ADMIN_SEED = join(DATA_PATH, 'Onboarding_Admin');
async function cleanOldCacheDirs(userDataDir: string) {
for (const dir of OLD_CACHE_DIRS) {
@@ -30,28 +28,10 @@ async function cleanOldCacheDirs(userDataDir: string) {
}
}
async function syncSeedDir(seedDir: string, targetDir: string) {
if (!existsSync(seedDir)) return;
await mkdir(targetDir, { recursive: true });
const seedEntries = await readdir(seedDir, { withFileTypes: true });
for (const entry of seedEntries) {
const dest = join(targetDir, entry.name);
if (existsSync(dest)) continue;
await cp(join(seedDir, entry.name), dest, { recursive: true });
}
}
async function seedHomeDir(homeDir: string) {
for (const dir of DEFAULT_HOME_DIRS) {
const target = join(homeDir, dir);
if (dir === 'Onboarding') {
await syncSeedDir(ONBOARDING_ADMIN_SEED, join(homeDir, 'Onboarding'));
await syncSeedDir(ONBOARDING_SEED, join(homeDir, 'Onboarding', 'User_Onboarding'));
} else if (!existsSync(target)) {
await mkdir(target, { recursive: true });
}
if (!existsSync(target)) await mkdir(target, { recursive: true });
}
}
@@ -26,11 +26,6 @@ serverSettingsRouter.get('/settings', async (ctx) => {
return ctx.json(await readServerSettings());
});
serverSettingsRouter.get('/onboarding-complete', async (ctx) => {
const settings = await readServerSettings();
return ctx.json({ onboardingComplete: !!settings.onboardingComplete });
});
serverSettingsRouter.put('/', async (ctx) => {
const body = await ctx.req.json();
const settings = await readServerSettings();