generated from nhcarrigan/template
4c46d4c8fd
## Summary This PR adds a collection of productivity features and UI enhancements to improve the Hikari Desktop experience: ### New Features - **Clipboard History** (#25) - Track and manage copied code snippets with language detection, search, filtering, and pinning - **Quick Actions Panel** (#15) - Buttons for common quick actions like "Review PR", "Run tests", "Explain file", with customizable actions - **Git Integration Panel** (#24) - View current branch, changed/staged files, quick git actions (commit, push, pull), and branch management - **Session Import/Export** (#8) - Export conversations to JSON and import previously saved sessions - **Snippet Library** (#22) - Save and reuse common prompts with categories and quick insert - **Session History** (#14) - Auto-save conversations with browsable history and search - **High Contrast Mode** (#20) - Accessibility theme with improved visibility - **Minimize to System Tray** (#11) - System tray support with right-click menu ### UI Enhancements - Trans-pride gradient theme applied across UI elements - Copy button added to code blocks - Linter formatting and eslint-disable comments for cleaner code ## Closes Closes #8 Closes #11 Closes #14 Closes #15 Closes #20 Closes #22 Closes #24 Closes #25 Closes #34 Closes #35 Closes #36 Closes #37 Closes #69 Closes #70 ## Test Plan - [ ] Verify clipboard history captures code from code block copy buttons - [ ] Verify clipboard history captures manually selected text from terminal - [ ] Test snippet library CRUD operations and insertion - [ ] Test quick actions panel with default and custom actions - [ ] Test git panel shows correct status, branch, and performs git operations - [ ] Test session history auto-save and restore - [ ] Test session import/export roundtrip - [ ] Verify high contrast mode provides adequate contrast - [ ] Test minimize to tray functionality and tray menu - [ ] Verify trans-pride gradient theme displays correctly in all themes --- *✨ This PR was created with help from Hikari~ 🌸* Co-authored-by: Naomi Carrigan <commits@nhcarrigan.com> Reviewed-on: #68 Co-authored-by: Hikari <hikari@nhcarrigan.com> Co-committed-by: Hikari <hikari@nhcarrigan.com>
90 lines
2.7 KiB
Svelte
90 lines
2.7 KiB
Svelte
<script lang="ts">
|
|
import { invoke } from "@tauri-apps/api/core";
|
|
import { openUrl } from "@tauri-apps/plugin-opener";
|
|
import type { UpdateInfo } from "$lib/types/messages";
|
|
import { configStore } from "$lib/stores/config";
|
|
|
|
let updateInfo = $state<UpdateInfo | null>(null);
|
|
let dismissed = $state(false);
|
|
|
|
export async function checkForUpdates() {
|
|
// Check if update checks are enabled
|
|
const config = configStore.getConfig();
|
|
if (!config.update_checks_enabled) {
|
|
return;
|
|
}
|
|
|
|
try {
|
|
const info = await invoke<UpdateInfo>("check_for_updates");
|
|
if (info.has_update) {
|
|
updateInfo = info;
|
|
dismissed = false;
|
|
}
|
|
} catch (err) {
|
|
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
console.error("Failed to check for updates:", errorMessage);
|
|
}
|
|
}
|
|
|
|
function dismiss() {
|
|
dismissed = true;
|
|
}
|
|
|
|
async function openRelease() {
|
|
if (updateInfo?.release_url) {
|
|
await openUrl(updateInfo.release_url);
|
|
}
|
|
}
|
|
</script>
|
|
|
|
{#if updateInfo && !dismissed}
|
|
<div
|
|
class="fixed bottom-4 right-4 max-w-sm bg-[var(--bg-tertiary)] border border-[var(--accent-primary)] rounded-lg shadow-lg p-4 z-50"
|
|
>
|
|
<div class="flex items-start gap-3">
|
|
<div class="text-2xl">🎉</div>
|
|
<div class="flex-1">
|
|
<h3 class="text-[var(--text-primary)] font-semibold mb-1">Update Available!</h3>
|
|
<p class="text-[var(--text-secondary)] text-sm mb-2">
|
|
A new version of Hikari Desktop is available:
|
|
<span class="text-[var(--accent-primary)] font-mono">{updateInfo.latest_version}</span>
|
|
</p>
|
|
<p class="text-[var(--text-muted)] text-xs mb-3">
|
|
Current version: {updateInfo.current_version}
|
|
</p>
|
|
<div class="flex gap-2">
|
|
<button onclick={openRelease} class="btn-trans-gradient px-3 py-1.5 rounded text-sm">
|
|
View Release
|
|
</button>
|
|
<button
|
|
onclick={dismiss}
|
|
class="px-3 py-1.5 bg-[var(--bg-secondary)] text-[var(--text-secondary)] rounded text-sm hover:bg-[var(--bg-primary)] transition-all"
|
|
>
|
|
Later
|
|
</button>
|
|
</div>
|
|
</div>
|
|
<button
|
|
onclick={dismiss}
|
|
class="text-[var(--text-muted)] hover:text-[var(--text-primary)] transition-colors"
|
|
aria-label="Dismiss"
|
|
>
|
|
<svg
|
|
class="w-4 h-4"
|
|
fill="none"
|
|
stroke="currentColor"
|
|
viewBox="0 0 24 24"
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
>
|
|
<path
|
|
stroke-linecap="round"
|
|
stroke-linejoin="round"
|
|
stroke-width="2"
|
|
d="M6 18L18 6M6 6l12 12"
|
|
></path>
|
|
</svg>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
{/if}
|