Swadhin Biswas

[email protected]
2026-03-31 15:06:56 +0600 committed NaN years ago
b45ed3f
commit b45ed3f
8 files changed
+57 -25
▼src-tauri/icons/128x128.png
+0-0
Binary file not shown.
▼src-tauri/icons/[email protected]
+0-0
Binary file not shown.
▼src-tauri/icons/32x32.png
+0-0
Binary file not shown.
▼src-tauri/icons/icon.png
+0-0
Binary file not shown.
▼src-tauri/src/updater.rs
+17-5
27
27
28
28
let cmd = Command::new_sidecar(UPDATE_TOOL)
29
29
.map_err(|e| format!("Failed to create sidecar command: {}", e))?;
30
-
30
+
31
31
let output = cmd.args(["--check-for-update", &path]).output();
32
32
33
33
match output {
35
35
let _ = window.emit("install-progress", "Done");
36
36
37
37
if out.status.success() || out.status.code() == Some(1) {
38
- Ok(update_check_indicates_available(out.status.code(), &out.stdout, &out.stderr))
38
+ Ok(update_check_indicates_available(
39
+ out.status.code(),
40
+ &out.stdout,
41
+ &out.stderr,
42
+ ))
39
43
} else {
40
44
Err(format!("Update check failed: {}", out.stderr.trim()))
41
45
}
53
57
54
58
let cmd = Command::new_sidecar(UPDATE_TOOL)
55
59
.map_err(|e| format!("Failed to create sidecar command: {}", e))?;
56
-
60
+
57
61
let output = cmd.args([&path]).output();
58
62
59
63
match output {
81
85
82
86
#[test]
83
87
fn detects_update_from_output_text() {
84
- assert!(update_check_indicates_available(Some(0), "An update is available", ""));
88
+ assert!(update_check_indicates_available(
89
+ Some(0),
90
+ "An update is available",
91
+ ""
92
+ ));
85
93
}
86
94
87
95
#[test]
88
96
fn reports_no_update_when_signal_absent() {
89
- assert!(!update_check_indicates_available(Some(0), "already up to date", ""));
97
+ assert!(!update_check_indicates_available(
98
+ Some(0),
99
+ "already up to date",
100
+ ""
101
+ ));
90
102
}
91
103
}
92
104
▼src/App.tsx
+7-11
129
129
130
130
const unlistenDetected = listen<string>("appimage-detected", (event) => {
131
131
const fullPath = event.payload;
132
- const ignored = JSON.parse(localStorage.getItem('ignoredAppImages') || '[]');
132
+ const ignored = JSON.parse(localStorage.getItem("ignoredAppImages") || "[]");
133
133
if (ignored.includes(fullPath)) return;
134
134
135
135
const fileName = fullPath.split("/").pop() || fullPath;
137
137
title: "Install Detected AppImage",
138
138
message: `New AppImage detected:\n${fileName}\n\nInstall it to your library?`,
139
139
actions: [
140
- {
141
- label: "Later",
140
+ {
141
+ label: "Later",
142
142
variant: "secondary",
143
143
onClick: () => {
144
144
ignored.push(fullPath);
145
- localStorage.setItem('ignoredAppImages', JSON.stringify(ignored));
146
- }
145
+ localStorage.setItem("ignoredAppImages", JSON.stringify(ignored));
146
+ },
147
147
},
148
148
{
149
149
label: "Install",
538
538
fontSize: "13px",
539
539
marginTop: "10px",
540
540
padding: "10px",
541
- background: firejailInstalled
542
- ? "var(--accent-bg)"
543
- : "var(--danger-bg)",
541
+ background: firejailInstalled ? "var(--accent-bg)" : "var(--danger-bg)",
544
542
borderRadius: "6px",
545
543
}}
546
544
>
588
586
fontSize: "13px",
589
587
marginTop: "10px",
590
588
padding: "10px",
591
- background: updateToolInstalled
592
- ? "var(--accent-bg)"
593
- : "var(--danger-bg)",
589
+ background: updateToolInstalled ? "var(--accent-bg)" : "var(--danger-bg)",
594
590
borderRadius: "6px",
595
591
}}
596
592
>
597
593
▼src/components/Sidebar.tsx
+15-4
37
37
...btnStyle,
38
38
background: currentView === "library" ? "var(--accent-bg)" : "transparent",
39
39
color: currentView === "library" ? "var(--accent-color)" : "var(--text-secondary)",
40
- borderRight: currentView === "library" ? "3px solid var(--accent-color)" : "3px solid transparent",
40
+ borderRight:
41
+ currentView === "library" ? "3px solid var(--accent-color)" : "3px solid transparent",
41
42
}}
42
43
onClick={() => onViewChange("library")}
43
44
>
49
50
...btnStyle,
50
51
background: currentView === "discover" ? "var(--accent-bg)" : "transparent",
51
52
color: currentView === "discover" ? "var(--accent-color)" : "var(--text-secondary)",
52
- borderRight: currentView === "discover" ? "3px solid var(--accent-color)" : "3px solid transparent",
53
+ borderRight:
54
+ currentView === "discover" ? "3px solid var(--accent-color)" : "3px solid transparent",
53
55
}}
54
56
onClick={() => onViewChange("discover")}
55
57
>
61
63
...btnStyle,
62
64
background: currentView === "settings" ? "var(--accent-bg)" : "transparent",
63
65
color: currentView === "settings" ? "var(--accent-color)" : "var(--text-secondary)",
64
- borderRight: currentView === "settings" ? "3px solid var(--accent-color)" : "3px solid transparent",
66
+ borderRight:
67
+ currentView === "settings" ? "3px solid var(--accent-color)" : "3px solid transparent",
65
68
}}
66
69
onClick={() => onViewChange("settings")}
67
70
>
70
73
71
74
<div style={{ flex: 1 }} />
72
75
73
- <button style={{ ...btnStyle, background: "transparent", color: "var(--text-secondary)", borderRight: "3px solid transparent" }} onClick={onRefresh}>
76
+ <button
77
+ style={{
78
+ ...btnStyle,
79
+ background: "transparent",
80
+ color: "var(--text-secondary)",
81
+ borderRight: "3px solid transparent",
82
+ }}
83
+ onClick={onRefresh}
84
+ >
74
85
<RefreshCw size={18} style={{ marginRight: 10 }} /> Refresh
75
86
</button>
76
87
</div>
77
88
▼src/styles/main.css
+18-5
8
8
--text-secondary: hsl(220, 15%, 75%);
9
9
--text-muted: hsl(220, 15%, 55%);
10
10
--border-color: hsl(224, 15%, 20%);
11
-
11
+
12
12
/* Vibrant Accents */
13
13
--accent-color: hsl(145, 65%, 45%);
14
14
--accent-hover: hsl(145, 65%, 52%);
18
18
/* Translucent Backgrounds for Alerts */
19
19
--accent-bg: hsla(145, 65%, 45%, 0.15);
20
20
--danger-bg: hsla(0, 85%, 65%, 0.15);
21
-
21
+
22
22
--shadow-card: 0 8px 30px rgba(0, 0, 0, 0.4);
23
23
}
24
24
32
32
--text-secondary: hsl(220, 15%, 35%);
33
33
--text-muted: hsl(220, 10%, 50%);
34
34
--border-color: hsl(220, 10%, 85%);
35
-
35
+
36
36
--accent-color: hsl(150, 75%, 35%);
37
37
--accent-hover: hsl(150, 75%, 42%);
38
38
--danger-color: hsl(0, 75%, 45%);
56
56
background-color: var(--bg-main);
57
57
color: var(--text-primary);
58
58
/* Use a premium, modern font stack */
59
- font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
60
- transition: background-color 0.4s ease, color 0.4s ease;
59
+ font-family:
60
+ "Inter",
61
+ -apple-system,
62
+ BlinkMacSystemFont,
63
+ "Segoe UI",
64
+ Roboto,
65
+ Helvetica,
66
+ Arial,
67
+ sans-serif,
68
+ "Apple Color Emoji",
69
+ "Segoe UI Emoji",
70
+ "Segoe UI Symbol";
71
+ transition:
72
+ background-color 0.4s ease,
73
+ color 0.4s ease;
61
74
-webkit-font-smoothing: antialiased;
62
75
-moz-osx-font-smoothing: grayscale;
63
76
}
64
77