Bump app version to 0.5.1 and add auto-update support

- Implemented auto-update logic in `ScribeTopBar` with update notification and user interaction.
- Integrated `@tauri-apps/plugin-updater` and `@tauri-apps/plugin-process` for updater functionality.
- Added automatic migration feature with `autoMigrateElectron` support and UI feedback.
- Refactored app architecture with new routing, components, and layout for better modularity.
- Enhanced JSON response handling in API client for robust data parsing.
- Updated locales to include new translations for update and migration-related UI.
This commit is contained in:
natreex
2026-04-07 16:09:35 -04:00
parent 687c1d582c
commit 5c7e71ce9e
19 changed files with 461 additions and 46 deletions

View File

@@ -1,5 +1,5 @@
'use client'
import {ArrowRightLeft, ExternalLink, Feather, Globe, Info, MapPin, MessageCircle, Users, Wand2, X} from 'lucide-react';
import {ExternalLink, Feather, Globe, Info, MapPin, MessageCircle, Users, Wand2, X} from 'lucide-react';
import React, {lazy, Suspense, useContext, useEffect, useState} from "react";
import {BookContext, BookContextProps} from "@/context/BookContext";
import {PanelComponent} from "@/lib/types/editor";
@@ -12,8 +12,6 @@ import InsetPanel from "@/components/ui/InsetPanel";
import IconButton from "@/components/ui/IconButton";
import OfflineContext, {OfflineContextType} from "@/context/OfflineContext";
import {isDesktop} from '@/lib/configs';
import MigrationModal from '@/components/migration/MigrationModal';
// Lazy loaded Editor components
const WorldEditor = lazy(function () {
return import('@/components/book/settings/world/editor/WorldEditor');
@@ -54,11 +52,6 @@ export default function ComposerRightBar(): React.JSX.Element {
const [panelHidden, setPanelHidden] = useState<boolean>(false);
const [currentPanel, setCurrentPanel] = useState<PanelComponent | undefined>();
const [showAbout, setShowAbout] = useState<boolean>(false);
const [showMigration, setShowMigration] = useState<boolean>(false);
const migrationDone: boolean = localStorage.getItem('electron_migration_done') === 'true';
const migrationDismissed: boolean = localStorage.getItem('electron_migration_dismissed') === 'true';
const showMigrationButton: boolean = isDesktop && !migrationDone;
function togglePanel(component: PanelComponent): void {
if (panelHidden) {
@@ -110,16 +103,6 @@ export default function ComposerRightBar(): React.JSX.Element {
];
const homeComponents: PanelComponent[] = [
...(showMigrationButton ? [{
id: 0,
title: t("composerRightBar.homeComponents.migration.title"),
description: t("composerRightBar.homeComponents.migration.description"),
badge: 'IMPORT',
icon: ArrowRightLeft,
action: function (): void {
setShowMigration(true);
}
}] : []),
{
id: 1,
title: t("composerRightBar.homeComponents.about.title"),
@@ -241,10 +224,6 @@ export default function ComposerRightBar(): React.JSX.Element {
{showAbout && <AboutEditors onClose={function (): void {
setShowAbout(false);
}}/>}
{showMigration && <MigrationModal
onClose={function (): void { setShowMigration(false); }}
onSuccess={function (): void { setShowMigration(false); window.location.reload(); }}
/>}
</div>
);
}