Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
131 changes: 131 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"@tauri-apps/plugin-os": "^2",
"@tauri-apps/plugin-process": "^2",
"@tauri-apps/plugin-shell": "^2.3.0",
"@tauri-apps/plugin-updater": "^2.9.0",
"@types/prismjs": "^1.26.5",
"clsx": "^2.1.1",
"fast-deep-equal": "^3.1.3",
Expand Down
1 change: 1 addition & 0 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ tauri-plugin-os = "2"
tauri-plugin-process = "2"
tauri-plugin-shell = "2"
tauri-plugin-store = "2"
tauri-plugin-updater = "2"
tokio = { version = "1.0", features = ["full"] }
tokio-tungstenite = "0.24"
tree-sitter = "0.25.8"
Expand Down
9 changes: 9 additions & 0 deletions src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"bundle": {
"active": true,
"targets": "all",
"createUpdaterArtifacts": true,
"icon": [
"icons/32x32.png",
"icons/128x128.png",
Expand All @@ -56,6 +57,14 @@
"plugins": {
"fs": {
"requireLiteralLeadingDot": false
},
"updater": {
"active": true,
"endpoints": [
"https://athas.dev/updates/{{target}}/{{current_version}}"
],
"dialog": true,
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEUxRDJGNTM3M0M0M0U3NzEKUldSeDUwTThOL1hTNFRlYVNycS9QSFFaa29Rdy9xZUVRUU80Wi8wekxHS2EvWkk5dG5Xb1gxbnoK"
}
}
}
30 changes: 29 additions & 1 deletion src/components/editor-footer.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AlertCircle, Terminal as TerminalIcon } from "lucide-react";
import { AlertCircle, Terminal as TerminalIcon, Download } from "lucide-react";
import { useBufferStore } from "../stores/buffer-store";
import { useFileSystemStore } from "../stores/file-system/store";
import { useGitStore } from "../stores/git-store";
Expand All @@ -7,6 +7,7 @@ import { useUIState } from "../stores/ui-state-store";
import { getFilenameFromPath, getLanguageFromFilename } from "../utils/file-utils";
import { getGitStatus } from "../utils/git";
import GitBranchManager from "./git/git-branch-manager";
import { useUpdater } from "../hooks/use-updater";

const EditorFooter = () => {
const buffers = useBufferStore.use.buffers();
Expand All @@ -16,6 +17,7 @@ const EditorFooter = () => {
const uiState = useUIState();
const { rootFolderPath } = useFileSystemStore();
const { gitStatus, actions } = useGitStore();
const { available, downloading, installing, updateInfo, downloadAndInstall } = useUpdater(false);
return (
<div className="flex min-h-[32px] items-center justify-between border-border border-t bg-secondary-bg px-2 py-1">
<div className="flex items-center gap-0.5 font-mono text-text-lighter text-xs">
Expand Down Expand Up @@ -70,6 +72,32 @@ const EditorFooter = () => {
<AlertCircle size={12} />
</div>
)}

{/* Update indicator */}
{available && (
<button
onClick={downloadAndInstall}
disabled={downloading || installing}
className={`flex items-center gap-0.5 rounded px-1 py-0.5 transition-colors ${
downloading || installing
? "text-text-lighter cursor-not-allowed"
: "text-blue-400 hover:bg-hover hover:text-blue-300"
}`}
style={{ minHeight: 0, minWidth: 0 }}
title={
downloading
? "Downloading update..."
: installing
? "Installing update..."
: `Update available: ${updateInfo?.version}`
}
>
<Download
size={12}
className={downloading || installing ? "animate-pulse" : ""}
/>
</button>
)}
</div>
<div className="flex items-center gap-0.5 font-mono text-[10px] text-text-lighter">
{activeBuffer && (
Expand Down
44 changes: 44 additions & 0 deletions src/components/settings/tabs/general-settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ import KeybindingBadge from "@/components/ui/keybinding-badge";
import Section, { SettingRow } from "@/components/ui/section";
import Switch from "@/components/ui/switch";
import { useSettingsStore } from "@/stores/settings-store";
import { useUpdater } from "@/hooks/use-updater";
import Button from "@/components/ui/button";

const isMac = typeof navigator !== "undefined" && navigator.platform.includes("Mac");

export const GeneralSettings = () => {
const { settings, updateSetting } = useSettingsStore();
const { available, checking, downloading, installing, error, updateInfo, checkForUpdates, downloadAndInstall } = useUpdater(false);

const sidebarOptions = [
{ value: "left", label: "Left" },
Expand Down Expand Up @@ -69,6 +72,47 @@ export const GeneralSettings = () => {
<KeybindingBadge keys={isMac ? ["⌘", "0"] : ["Ctrl", "0"]} />
</SettingRow>
</Section>

<Section title="Updates">
<SettingRow
label="Check for Updates"
description={
available
? `Version ${updateInfo?.version} available`
: error
? "Failed to check for updates"
: "App is up to date"
}
>
<div className="flex gap-2">
<Button
onClick={checkForUpdates}
disabled={checking || downloading || installing}
variant="ghost"
size="xs"
className="px-2 py-1"
>
{checking ? "Checking..." : "Check"}
</Button>
{available && (
<Button
onClick={downloadAndInstall}
disabled={downloading || installing}
variant="ghost"
size="xs"
className="px-2 py-1"
>
{downloading ? "Downloading..." : installing ? "Installing..." : "Install"}
</Button>
)}
</div>
</SettingRow>
{error && (
<div className="mt-2 text-xs text-red-500">
{error}
</div>
)}
</Section>
</div>
);
};
Loading