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
1 change: 0 additions & 1 deletion src/components/CommandPalette.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,6 @@ const styles: Record<string, CSSProperties> = {
fontWeight: 700,
letterSpacing: "0.08em",
color: "var(--color-text-muted)",
textTransform: "uppercase",
},
row: {
display: "flex",
Expand Down
1 change: 0 additions & 1 deletion src/components/CompletionFlourish.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@ const styles: Record<string, CSSProperties> = {
fontSize: 11,
color: "var(--color-text-muted)",
letterSpacing: "0.12em",
textTransform: "uppercase",
opacity: 0.7,
},
};
Expand Down
1 change: 0 additions & 1 deletion src/components/DcaSchedulesPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ const styles: Record<string, CSSProperties> = {
fontSize: 10,
fontWeight: 600,
color: "var(--color-text-muted)",
textTransform: "uppercase",
letterSpacing: "0.14em",
},
headerCount: {
Expand Down
4 changes: 0 additions & 4 deletions src/components/ExecutionPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1636,7 +1636,6 @@ const VerifiedMark: FC<{ verified: boolean }> = ({ verified }) => (
fontSize: 9,
fontWeight: 700,
letterSpacing: "0.04em",
textTransform: "uppercase",
color: verified ? "var(--color-success)" : "var(--color-warn)",
background: verified
? "rgba(34, 197, 94, 0.12)"
Expand Down Expand Up @@ -2258,7 +2257,6 @@ const styles: Record<string, CSSProperties> = {
fontVariantNumeric: "tabular-nums",
marginLeft: "auto",
letterSpacing: "0.04em",
textTransform: "uppercase",
},
formCardBody: {
display: "flex",
Expand All @@ -2271,7 +2269,6 @@ const styles: Record<string, CSSProperties> = {
fontWeight: 600,
color: THEME.textMuted,
letterSpacing: "0.08em",
textTransform: "uppercase",
marginTop: 4,
},
formCardFootnote: {
Expand Down Expand Up @@ -2912,7 +2909,6 @@ const styles: Record<string, CSSProperties> = {
fontWeight: 600,
color: THEME.textMuted,
letterSpacing: "0.05em",
textTransform: "uppercase",
marginTop: 4,
},
heroStatHint: {
Expand Down
2 changes: 0 additions & 2 deletions src/components/ExecutionReplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,6 @@ const styles: Record<string, CSSProperties> = {
fontSize: 11,
fontWeight: 700,
color: "var(--color-5-strong)",
textTransform: "uppercase",
letterSpacing: "0.1em",
},
title: {
Expand Down Expand Up @@ -450,7 +449,6 @@ const styles: Record<string, CSSProperties> = {
fontFamily: MONO,
fontSize: 11,
color: "var(--color-text-muted)",
textTransform: "uppercase",
letterSpacing: "0.04em",
},
tickerValue: {
Expand Down
4 changes: 0 additions & 4 deletions src/components/ExecutionStack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,6 @@ const styles: Record<string, CSSProperties> = {
fontSize: 13,
fontWeight: 700,
color: "var(--color-text-muted)",
textTransform: "uppercase",
letterSpacing: "0.08em",
},
titleHint: {
Expand All @@ -354,7 +353,6 @@ const styles: Record<string, CSSProperties> = {
fontSize: 11,
fontWeight: 700,
letterSpacing: "0.1em",
textTransform: "uppercase",
padding: "2px 7px",
borderRadius: 999,
background: "var(--color-accent-bg-soft)",
Expand Down Expand Up @@ -440,7 +438,6 @@ const styles: Record<string, CSSProperties> = {
fontSize: 12,
fontWeight: 600,
color: "var(--color-text-muted)",
textTransform: "uppercase",
letterSpacing: "0.05em",
},
tally: {
Expand All @@ -452,7 +449,6 @@ const styles: Record<string, CSSProperties> = {
fontFamily: MONO,
fontSize: 13,
color: "var(--color-text-muted)",
textTransform: "uppercase",
letterSpacing: "0.05em",
},
tallyValue: {
Expand Down
1 change: 0 additions & 1 deletion src/components/ExecutionTimeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,6 @@ const styles: Record<string, CSSProperties> = {
color: "var(--color-text-muted)",
width: 64,
flexShrink: 0,
textTransform: "uppercase",
letterSpacing: "0.04em",
fontSize: 12,
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/HeaderBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ const MevPopover: FC<{ strategy: ReturnType<typeof getMevStrategy> }> = ({
fontSize: 12,
}}
>
· {layer.active ? "ACTIVE" : "READY"}
· {layer.active ? "Active" : "Ready"}
</span>
</div>
<div style={styles.mevPopoverLayerDesc}>{layer.description}</div>
Expand Down
4 changes: 0 additions & 4 deletions src/components/LeaderboardTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,6 @@ const styles: Record<string, CSSProperties> = {
fontSize: 12,
fontWeight: 700,
color: "var(--color-text-muted)",
textTransform: "uppercase",
letterSpacing: "0.06em",
},
yourCardRank: {
Expand Down Expand Up @@ -333,7 +332,6 @@ const styles: Record<string, CSSProperties> = {
fontFamily: MONO,
fontSize: 11,
color: "var(--color-text-muted)",
textTransform: "uppercase",
letterSpacing: "0.04em",
},
emptyState: {
Expand All @@ -353,7 +351,6 @@ const styles: Record<string, CSSProperties> = {
fontSize: 12,
fontWeight: 700,
color: "var(--color-text-muted)",
textTransform: "uppercase",
letterSpacing: "0.06em",
},
boardHint: {
Expand Down Expand Up @@ -406,7 +403,6 @@ const styles: Record<string, CSSProperties> = {
fontSize: 9,
fontWeight: 700,
letterSpacing: "0.06em",
textTransform: "uppercase",
border: "1px solid",
borderRadius: 4,
},
Expand Down
2 changes: 0 additions & 2 deletions src/components/PairQueuePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,6 @@ const styles: Record<string, CSSProperties> = {
fontSize: 13,
fontWeight: 700,
color: "var(--color-text-muted)",
textTransform: "uppercase",
letterSpacing: "0.06em",
},
headerIcon: { fontSize: 14 },
Expand Down Expand Up @@ -302,7 +301,6 @@ const styles: Record<string, CSSProperties> = {
fontSize: 10,
fontWeight: 700,
letterSpacing: "0.05em",
textTransform: "uppercase",
border: "1px solid",
borderRadius: 999,
fontFamily: MONO,
Expand Down
2 changes: 0 additions & 2 deletions src/components/ProfileSetup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,6 @@ const styles: Record<string, CSSProperties> = {
letterSpacing: "0.12em",
fontWeight: 700,
color: "var(--color-5-strong)",
textTransform: "uppercase",
},
title: {
fontFamily: SANS,
Expand Down Expand Up @@ -388,7 +387,6 @@ const styles: Record<string, CSSProperties> = {
fontSize: 13,
fontWeight: 600,
letterSpacing: "0.12em",
textTransform: "uppercase",
color: "var(--color-text-muted)",
animation: "liminal-fade-in 200ms var(--ease-out, ease)",
},
Expand Down
2 changes: 0 additions & 2 deletions src/components/ProgressRingsCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ const styles: Record<string, CSSProperties> = {
fontSize: 13,
fontWeight: 700,
color: "var(--color-text-muted)",
textTransform: "uppercase",
letterSpacing: "0.08em",
},
body: {
Expand Down Expand Up @@ -236,7 +235,6 @@ const styles: Record<string, CSSProperties> = {
fontWeight: 600,
color: "var(--color-text-muted)",
letterSpacing: "0.04em",
textTransform: "uppercase",
},
legendValue: {
fontFamily: SANS,
Expand Down
1 change: 0 additions & 1 deletion src/components/RiskAdvisor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ const styles: Record<string, CSSProperties> = {
fontSize: 13,
fontWeight: 700,
color: "var(--color-text-muted)",
textTransform: "uppercase",
letterSpacing: "0.06em",
},
headerIcon: {
Expand Down
1 change: 0 additions & 1 deletion src/components/Tutorial.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,6 @@ const styles: Record<string, CSSProperties> = {
fontSize: 11,
letterSpacing: "0.1em",
fontWeight: 700,
textTransform: "uppercase",
color: "var(--color-5-strong)",
marginBottom: 6,
},
Expand Down
2 changes: 0 additions & 2 deletions src/pages/AnalyticsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ const styles: Record<string, CSSProperties> = {
fontFamily: MONO,
fontSize: 11,
letterSpacing: "0.14em",
textTransform: "uppercase",
color: "var(--color-text-muted)",
},
heroTitle: {
Expand Down Expand Up @@ -229,7 +228,6 @@ const styles: Record<string, CSSProperties> = {
fontFamily: MONO,
fontSize: 10,
letterSpacing: "0.12em",
textTransform: "uppercase",
color: "var(--color-text-muted)",
},
statValue: {
Expand Down
2 changes: 0 additions & 2 deletions src/pages/WalletPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,6 @@ const styles: Record<string, CSSProperties> = {
fontFamily: MONO,
fontSize: 11,
letterSpacing: "0.14em",
textTransform: "uppercase",
color: "var(--color-text-muted)",
marginBottom: 4,
},
Expand Down Expand Up @@ -269,7 +268,6 @@ const styles: Record<string, CSSProperties> = {
fontFamily: MONO,
fontSize: 10,
letterSpacing: "0.12em",
textTransform: "uppercase",
color: "var(--color-text-muted)",
},
statValue: {
Expand Down
58 changes: 22 additions & 36 deletions src/services/serviceWorker.ts
Original file line number Diff line number Diff line change
@@ -1,53 +1,39 @@
/**
* LIMINAL — Service Worker registration
*
* Wraps the navigator.serviceWorker.register() call with the guards
* we need:
* - Skipped in dev (import.meta.env.DEV) so HMR isn't intercepted
* - Skipped when the browser doesn't support service workers (older
* Safari, file:// origin, etc.)
* - Logs the result via console.warn on failure but never throws —
* a missing offline shell is not a fatal error
* - Listens for `controllerchange` (new SW activated) and reloads
* once so users always run the freshest deploy
* Disabled for hackathon submission. Previous SW versions kept caching
* stale bundles on the production domain, masking new deploys until
* users manually cleared storage. To prevent that footgun during demo
* + judging, we:
*
* The actual SW lives in `public/sw.js` so Vite copies it verbatim
* to the build output. We don't bundle it through the JS pipeline
* because workers are loaded by URL, not module-graph.
* 1. No longer register a service worker.
* 2. Actively unregister any SW that a previous visit installed.
* 3. Clear every cache the previous SW seeded (CacheStorage entries).
*
* Effect: every page load fetches the freshest bundle from Vercel.
* Slightly higher network use, much better deploy-to-user latency.
* Re-enable after submission once the cadence settles and we want
* offline support back.
*/

const SW_PATH = "/sw.js";

let reloaded = false;

export async function registerServiceWorker(): Promise<void> {
if (typeof window === "undefined") return;
// Vite injects DEV at build time; on production builds it's false.
if (import.meta.env.DEV) return;
if (!("serviceWorker" in navigator)) return;

try {
const reg = await navigator.serviceWorker.register(SW_PATH, {
scope: "/",
});
// When a new SW activates, the browser is ready to use it but the
// current page still runs the old one. Reload exactly once so the
// user immediately sees the new deploy.
navigator.serviceWorker.addEventListener("controllerchange", () => {
if (reloaded) return;
reloaded = true;
window.location.reload();
});
if (reg.waiting) {
// A SW is already waiting on first load — likely an update from
// a previous session. Tell it to take over now.
reg.waiting.postMessage({ type: "SKIP_WAITING" });
const regs = await navigator.serviceWorker.getRegistrations();
for (const reg of regs) {
await reg.unregister();
}
if (typeof caches !== "undefined") {
const keys = await caches.keys();
for (const key of keys) {
await caches.delete(key);
}
}
} catch (err) {
// Don't toast / Sentry — service worker absence is benign. Just
// a console warn so devs can see if registration fails.
console.warn(
`[LIMINAL/sw] register failed: ${err instanceof Error ? err.message : String(err)}`,
`[LIMINAL/sw] cleanup failed: ${err instanceof Error ? err.message : String(err)}`,
);
}
}
Loading