M10 (task 2013): integrated AppImage — app self-integration (OOBE + Account toggle)
CI & Build / Python lint (push) Successful in 3s
CI & Build / TypeScript typecheck (push) Successful in 6s
CI & Build / Python tests (push) Successful in 9s
Desktop (Tauri) / Tauri desktop (Linux) (push) Failing after 26s
CI & Build / Build & push image (push) Successful in 33s
CI & Build / Python lint (push) Successful in 3s
CI & Build / TypeScript typecheck (push) Successful in 6s
CI & Build / Python tests (push) Successful in 9s
Desktop (Tauri) / Tauri desktop (Linux) (push) Failing after 26s
CI & Build / Build & push image (push) Successful in 33s
The Linux AppImage can now install itself into the applications menu, so it behaves like an installed app instead of a loose file. - Rust (desktop/src-tauri/src/integration.rs): integration_status / integrate_desktop / unintegrate_desktop commands — detect $APPIMAGE, copy the AppImage to ~/Applications, write ~/.local/share/applications/thoughtsync.desktop + embedded icon, update-desktop-database. Registered in lib.rs. - Frontend: withGlobalTauri exposes window.__TAURI__.core.invoke; desktop/bridge.ts (isDesktop + typed invoke, NO @tauri-apps/api dep -> web bundle unaffected); DesktopIntegrationPrompt (first-run OOBE, remembered) mounted in App.vue; AccountView "Desktop app" add/remove control. All desktop-guarded -> no-ops on web. - desktop.yml: upload the .deb + .AppImage as a run artifact (continue-on-error) so the build is downloadable for hand-testing. Verified by CI: ci.yml (vue-tsc) for the frontend, desktop.yml (cargo + tauri build) for the Rust + AppImage. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FRgehjoz7Yv8LkUfADxACm
This commit is contained in:
@@ -5,6 +5,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 { isDesktop, desktop as desktopBridge, type IntegrationStatus } from "../desktop/bridge";
|
||||
|
||||
// Per-user (not admin) management of linked native clients — the Tauri desktop and
|
||||
// Android apps authenticate sync with a device bearer token issued here.
|
||||
@@ -17,6 +18,10 @@ const creating = ref(false);
|
||||
// The freshly-issued plaintext token — shown ONCE (never retrievable again).
|
||||
const freshToken = ref("");
|
||||
|
||||
// Desktop-app self-integration (Linux AppImage only; the card is hidden otherwise).
|
||||
const desktopStatus = ref<IntegrationStatus | null>(null);
|
||||
const desktopBusy = ref(false);
|
||||
|
||||
async function load() {
|
||||
error.value = "";
|
||||
try {
|
||||
@@ -63,7 +68,37 @@ function fmt(iso: string | null): string {
|
||||
return new Date(iso).toLocaleString();
|
||||
}
|
||||
|
||||
onMounted(load);
|
||||
async function loadDesktop() {
|
||||
if (!isDesktop()) return;
|
||||
try {
|
||||
desktopStatus.value = await desktopBridge.integrationStatus();
|
||||
} catch {
|
||||
desktopStatus.value = null;
|
||||
}
|
||||
}
|
||||
|
||||
async function toggleIntegration() {
|
||||
desktopBusy.value = true;
|
||||
try {
|
||||
desktopStatus.value = desktopStatus.value?.is_integrated
|
||||
? await desktopBridge.unintegrate()
|
||||
: await desktopBridge.integrate();
|
||||
ui.showToast(
|
||||
desktopStatus.value?.is_integrated
|
||||
? "Added to your applications menu."
|
||||
: "Removed from your applications menu.",
|
||||
);
|
||||
} catch (e) {
|
||||
ui.showToast((e as { message?: string }).message ?? "Couldn't update the menu entry.");
|
||||
} finally {
|
||||
desktopBusy.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
void load();
|
||||
void loadDesktop();
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -91,6 +126,31 @@ onMounted(load);
|
||||
paste it into the app when it asks to connect. You can revoke a device at any time.
|
||||
</p>
|
||||
|
||||
<!-- Desktop app self-integration (Linux AppImage only) -->
|
||||
<section
|
||||
v-if="desktopStatus?.is_appimage"
|
||||
class="mb-6 flex items-center justify-between gap-4 rounded-xl border border-neutral-200 p-4 dark:border-neutral-800"
|
||||
>
|
||||
<div class="min-w-0">
|
||||
<p class="text-sm font-medium text-neutral-800 dark:text-neutral-100">Desktop app</p>
|
||||
<p class="mt-0.5 text-xs text-neutral-400">
|
||||
{{
|
||||
desktopStatus.is_integrated
|
||||
? "ThoughtSync is in your applications menu."
|
||||
: "Add ThoughtSync to your applications menu to launch it like an installed app."
|
||||
}}
|
||||
</p>
|
||||
</div>
|
||||
<BaseButton
|
||||
:variant="desktopStatus.is_integrated ? 'ghost' : 'primary'"
|
||||
:loading="desktopBusy"
|
||||
class="shrink-0"
|
||||
@click="toggleIntegration"
|
||||
>
|
||||
{{ desktopStatus.is_integrated ? "Remove" : "Add to applications" }}
|
||||
</BaseButton>
|
||||
</section>
|
||||
|
||||
<!-- One-time token reveal -->
|
||||
<div
|
||||
v-if="freshToken"
|
||||
|
||||
Reference in New Issue
Block a user