Skip to content

Commit 6c5e13f

Browse files
committed
feat(mobile): update logo assets and enhance app configuration
- Added colored and no-background logo images for branding. - Updated app.json to reference the new logo assets. - Modified AppNavbar component to display the new logo. - Improved configuration handling for the sunspotGoDir path. - Enhanced error handling in useRelaySession hook for better network error messages.
1 parent 36127f2 commit 6c5e13f

13 files changed

Lines changed: 185 additions & 50 deletions

File tree

backend/src/config.ts

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os from "node:os";
2+
import fs from "node:fs/promises";
23
import { fileURLToPath } from "node:url";
34

45
function parseEnvFile(contents: string): Record<string, string> {
@@ -59,6 +60,26 @@ function envString(name: string, fallback: string): string {
5960
return getEnv(name) || fallback;
6061
}
6162

63+
async function resolveExistingDir(
64+
candidate: string | undefined,
65+
fallback: string,
66+
): Promise<string> {
67+
if (candidate) {
68+
try {
69+
await fs.access(candidate);
70+
return candidate;
71+
} catch {
72+
// Fall back to the bundled repo path when the override is stale.
73+
}
74+
}
75+
76+
return fallback;
77+
}
78+
79+
const defaultSunspotGoDir = fileURLToPath(
80+
new URL("../../vendor/sunspot-sdk/sunspot/go", import.meta.url),
81+
);
82+
6283
export const config = {
6384
host: envString("HOST", "0.0.0.0"),
6485
port: envNumber("PORT", 3001),
@@ -156,9 +177,9 @@ export const config = {
156177
magicblockCommitThreshold: envNumber("MAGICBLOCK_COMMIT_THRESHOLD", 10),
157178
magicblockCommitIntervalMs: envNumber("MAGICBLOCK_COMMIT_INTERVAL_MS", 60_000),
158179
registrySyncIntervalMs: envNumber("REGISTRY_SYNC_INTERVAL_MS", 30_000),
159-
sunspotGoDir: envString(
160-
"SUNSPOT_GO_DIR",
161-
fileURLToPath(new URL("../../vendor/sunspot-sdk/sunspot/go", import.meta.url)),
180+
sunspotGoDir: await resolveExistingDir(
181+
getEnv("SUNSPOT_GO_DIR"),
182+
defaultSunspotGoDir,
162183
),
163184
goBinaryPath: getEnv("GO_BINARY_PATH"),
164185
redisConnectTimeoutMs: 5_000,

backend/src/services/root-submit-support.ts

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,8 @@ async function getGoBinaryPath() {
298298
if (!goBinaryPathPromise) {
299299
goBinaryPathPromise = (async () => {
300300
const candidates = [
301-
config.goBinaryPath,
301+
config.goBinaryPath?.trim(),
302+
"go",
302303
Bun.which("go"),
303304
"/usr/local/go/bin/go",
304305
"/opt/homebrew/bin/go",
@@ -307,8 +308,20 @@ async function getGoBinaryPath() {
307308

308309
for (const candidate of candidates) {
309310
try {
310-
await fs.access(candidate);
311-
return candidate;
311+
if (candidate.includes("/")) {
312+
await fs.access(candidate, fs.constants.X_OK);
313+
}
314+
315+
const command = Bun.spawn({
316+
cmd: [candidate, "version"],
317+
stdout: "ignore",
318+
stderr: "ignore",
319+
});
320+
const exitCode = await command.exited;
321+
322+
if (exitCode === 0) {
323+
return candidate;
324+
}
312325
} catch {
313326
// Try the next candidate.
314327
}

bun.lock

Lines changed: 56 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

frontend/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
/>
99
<meta name="theme-color" content="#f4efe3" />
1010
<title>Enmarch</title>
11+
<link rel="icon" type="image/png" href="/enmarch-logo-colored.png" />
1112
<link rel="preconnect" href="https://fonts.googleapis.com" />
1213
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
1314
<link
915 KB
Loading
890 KB
Loading

frontend/src/components/messenger/app-navbar.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,16 @@ export function AppNavbar({ onDisconnect }: AppNavbarProps) {
5151

5252
<div className="relative z-10 mx-auto flex max-w-[1600px] items-center justify-between gap-3 px-3 py-3 sm:px-4">
5353
<div className="min-w-0">
54-
<p className="font-display text-3xl tracking-[-0.08em] text-(--color-ink)">
55-
Enmarch
56-
</p>
54+
<div className="flex items-center gap-3">
55+
<img
56+
src="/enmarch-logo-colored.png"
57+
alt="Enmarch"
58+
className="h-11 w-11 rounded-2xl border border-(--color-line) shadow-[0_16px_30px_-20px_rgba(9,18,28,0.45)]"
59+
/>
60+
<p className="font-display text-3xl tracking-[-0.08em] text-(--color-ink)">
61+
Enmarch
62+
</p>
63+
</div>
5764
</div>
5865

5966
<div ref={menuAreaRef} className="relative flex items-center gap-2">

mobile/app.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"slug": "enmarch-mobile",
55
"scheme": "enmarch",
66
"version": "0.1.0",
7+
"icon": "./assets/enmarch-logo-colored.png",
78
"orientation": "portrait",
89
"platforms": ["android"],
910
"userInterfaceStyle": "automatic",
@@ -23,7 +24,8 @@
2324
"android": {
2425
"package": "com.enmarch.mobile",
2526
"adaptiveIcon": {
26-
"backgroundColor": "#0f172a"
27+
"foregroundImage": "./assets/enmarch-logo-colored.png",
28+
"backgroundColor": "#041128"
2729
},
2830
"edgeToEdgeEnabled": true,
2931
"intentFilters": [
915 KB
Loading
890 KB
Loading

0 commit comments

Comments
 (0)