desktop: Import and Export work offline; the menu toggle is reachable; errors say why
CI & Build / Build now, or wait for Android? (push) Successful in 4s
Android / Build, or is the channel already serving this? (push) Successful in 4s
CI & Build / Python lint (push) Successful in 2s
CI & Build / Web typecheck and unit tests (push) Successful in 12s
Desktop (Tauri) / Build, or is the channel already serving this? (push) Successful in 2s
CI & Build / Python tests (push) Successful in 13s
CI & Build / integration (push) Successful in 48s
CI & Build / Build & push image (push) Skipped
Desktop (Tauri) / Web tests, clippy, Rust tests and rustfmt (push) Successful in 4m26s
Desktop (Tauri) / Windows installer (cross-compiled) (push) Successful in 3m32s
Desktop (Tauri) / Tauri desktop (Linux) (push) Successful in 4m10s
Desktop (Tauri) / Update manifest (push) Successful in 4s
Android / Kotlin + Rust (APK) (push) Successful in 12m42s
CI & Build / Build now, or wait for Android? (push) Successful in 4s
Android / Build, or is the channel already serving this? (push) Successful in 4s
CI & Build / Python lint (push) Successful in 2s
CI & Build / Web typecheck and unit tests (push) Successful in 12s
Desktop (Tauri) / Build, or is the channel already serving this? (push) Successful in 2s
CI & Build / Python tests (push) Successful in 13s
CI & Build / integration (push) Successful in 48s
CI & Build / Build & push image (push) Skipped
Desktop (Tauri) / Web tests, clippy, Rust tests and rustfmt (push) Successful in 4m26s
Desktop (Tauri) / Windows installer (cross-compiled) (push) Successful in 3m32s
Desktop (Tauri) / Tauri desktop (Linux) (push) Successful in 4m10s
Desktop (Tauri) / Update manifest (push) Successful in 4s
Android / Kotlin + Rust (APK) (push) Successful in 12m42s
Export and Import were a link to the server and a reject("needs a server") on the
desktop. Both now run in the core with no server:
- core/src/local/portable.rs builds the same zip the server writes (notes.json,
a Markdown file per note, each attachment this device holds) and reads either
export marker or a Google Keep Takeout zip, with the server's decompression
budget and an all-or-nothing transaction. Export saves to Downloads (no new
plugin) and the sidebar says where; Import takes the archive as raw IPC bytes.
- core/testdata/portable.json pins the format for both copies: the server runs
its Keep and native readers against it (test_portable_fixture.py) and checks
its real export's keys (test_integration.py); the core runs the same cases.
- Found on the way: both importers skipped a Keep note that is only a photo as
"empty". It now imports, on the server and in the core.
- New dependency, approved: `zip` (deflate only) plus `flate2` on its pure-Rust
backend, both already in the lockfile.
The AppImage applications-menu toggle moves from Account, which the desktop
never shows, to the Sync page; the first-run prompt now says so.
errorMessage (#5236) replaces the hand-rolled `.error ?? …` / `.message ?? e`
reads at the remaining catch sites, so a desktop failure shows its real reason.
Task #5170.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,7 @@ import { useUiStore } from "../stores/ui";
|
||||
import BaseButton from "../components/BaseButton.vue";
|
||||
import BaseInput from "../components/BaseInput.vue";
|
||||
import Icon from "../components/Icon.vue";
|
||||
import DesktopMenuEntry from "../components/DesktopMenuEntry.vue";
|
||||
import {
|
||||
SUGGESTED_CAPTURE_SHORTCUT,
|
||||
capture as captureBridge,
|
||||
@@ -20,6 +21,7 @@ import {
|
||||
type UpdateChannel,
|
||||
type UpdateStatus,
|
||||
} from "../desktop/bridge";
|
||||
import { errorMessage } from "../api/errors";
|
||||
|
||||
// Opt-in server sync for the desktop app. Being UNLINKED is the normal resting
|
||||
// state, not an incomplete setup — the app is local-first and fully usable having
|
||||
@@ -111,7 +113,7 @@ async function saveShortcut(value: string) {
|
||||
// The message comes from the core and names the actual reason — "something
|
||||
// else is already using it" reads very differently from "that is not a
|
||||
// shortcut this system understands", and both are things you can act on.
|
||||
shortcutError.value = String((e as { message?: string }).message ?? e);
|
||||
shortcutError.value = errorMessage(e, "Couldn't save the shortcut.");
|
||||
} finally {
|
||||
savingShortcut.value = false;
|
||||
}
|
||||
@@ -124,7 +126,7 @@ async function checkUpdates() {
|
||||
update.value = await updateBridge.check();
|
||||
channel.value = update.value.channel;
|
||||
} catch (e) {
|
||||
updateError.value = String((e as Error)?.message ?? e);
|
||||
updateError.value = errorMessage(e, "The update check failed.");
|
||||
} finally {
|
||||
checking.value = false;
|
||||
checkedOnce.value = true;
|
||||
@@ -141,7 +143,7 @@ async function switchChannel(next: UpdateChannel) {
|
||||
checkedOnce.value = false;
|
||||
await checkUpdates();
|
||||
} catch (e) {
|
||||
updateError.value = String((e as Error)?.message ?? e);
|
||||
updateError.value = errorMessage(e, "The update check failed.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,7 +155,7 @@ async function installUpdate() {
|
||||
// means it failed.
|
||||
await updateBridge.install();
|
||||
} catch (e) {
|
||||
updateError.value = String((e as Error)?.message ?? e);
|
||||
updateError.value = errorMessage(e, "The update check failed.");
|
||||
} finally {
|
||||
installing.value = false;
|
||||
}
|
||||
@@ -191,7 +193,7 @@ async function runProbe() {
|
||||
try {
|
||||
probe.value = await syncBridge.probe(url.value);
|
||||
} catch (e) {
|
||||
probeError.value = String((e as Error)?.message ?? e);
|
||||
probeError.value = errorMessage(e, "Couldn't reach that server.");
|
||||
} finally {
|
||||
probing.value = false;
|
||||
}
|
||||
@@ -219,7 +221,7 @@ async function connect() {
|
||||
ui.showToast(`Connected to ${result.status.server_url}.`);
|
||||
await syncNow();
|
||||
} catch (e) {
|
||||
linkError.value = String((e as Error)?.message ?? e);
|
||||
linkError.value = errorMessage(e, "Couldn't link to that server.");
|
||||
} finally {
|
||||
linking.value = false;
|
||||
}
|
||||
@@ -261,7 +263,7 @@ async function syncNow() {
|
||||
showOutcome(await syncBridge.now());
|
||||
pending.value = await syncBridge.hasPending();
|
||||
} catch (e) {
|
||||
syncError.value = String((e as Error)?.message ?? e);
|
||||
syncError.value = errorMessage(e, "Sync failed.");
|
||||
} finally {
|
||||
syncing.value = false;
|
||||
}
|
||||
@@ -303,7 +305,7 @@ async function disconnect() {
|
||||
: "Disconnected. This device now works offline only.",
|
||||
);
|
||||
} catch (e) {
|
||||
ui.showToast(String((e as Error)?.message ?? e));
|
||||
ui.showToast(errorMessage(e, "Couldn't disconnect."));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -676,5 +678,9 @@ onBeforeUnmount(() => stopSyncListener?.());
|
||||
</BaseButton>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- The AppImage's menu entry, which the first-run prompt says can be undone
|
||||
from here. Hides itself on every other build. -->
|
||||
<DesktopMenuEntry />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user