From 1daadb9673a2820b2f3bff12ad14a438368f7583 Mon Sep 17 00:00:00 2001 From: Bohdan Date: Tue, 2 Jun 2026 23:09:05 +0300 Subject: [PATCH 1/5] fix(extension): hardcode prod URL + fixed extension ID via manifest key --- extension/.env.example | 21 +++++---------------- extension/src/background/index.ts | 6 ++++-- extension/src/manifest.ts | 1 + 3 files changed, 10 insertions(+), 18 deletions(-) diff --git a/extension/.env.example b/extension/.env.example index fd8a15f..45ec750 100644 --- a/extension/.env.example +++ b/extension/.env.example @@ -1,17 +1,6 @@ -# ─── Dashboard URL ───────────────────────────────────────────────────────────── -# Local dev: http://localhost:3000 -# Production: your Vercel deployment URL (e.g. https://worktrace-ecru.vercel.app) -VITE_DASHBOARD_URL="http://localhost:3000" +# Optional overrides — production defaults are hardcoded in background/index.ts +# Only needed for local development against a different dashboard instance. -# ─── Google OAuth ────────────────────────────────────────────────────────────── -# https://console.cloud.google.com → APIs & Services → Credentials -# → "+ CREATE CREDENTIALS" → "OAuth 2.0 Client ID" -# Application type: Chrome Extension -# Application ID: your unpacked extension ID from chrome://extensions -# → copy the generated Client ID here (same value as GOOGLE_CLIENT_ID in dashboard/.env) -VITE_GOOGLE_CLIENT_ID="" - -# ─── Dev mode ─────────────────────────────────────────────────────────────────── -# true → "Sign in" bypasses Google OAuth and stores a fake JWT (for local UI testing) -# false → real Google OAuth flow (requires valid VITE_GOOGLE_CLIENT_ID + GCC setup) -VITE_DEV_MODE="false" +# VITE_DASHBOARD_URL="http://localhost:3000" # defaults to https://worktrace-ecru.vercel.app +# VITE_GOOGLE_CLIENT_ID="" # defaults to the production OAuth client ID +# VITE_DEV_MODE="true" # true = bypass Google OAuth (UI testing only) diff --git a/extension/src/background/index.ts b/extension/src/background/index.ts index 5c20838..dcaaa1e 100644 --- a/extension/src/background/index.ts +++ b/extension/src/background/index.ts @@ -23,8 +23,10 @@ import { } from "./session"; import { initSync, flush, getStatus } from "./sync"; -const DASHBOARD_URL = import.meta.env.VITE_DASHBOARD_URL as string; -const GOOGLE_CLIENT_ID = import.meta.env.VITE_GOOGLE_CLIENT_ID as string; +const DASHBOARD_URL = (import.meta.env.VITE_DASHBOARD_URL as string | undefined) + ?? "https://worktrace-ecru.vercel.app"; +const GOOGLE_CLIENT_ID = (import.meta.env.VITE_GOOGLE_CLIENT_ID as string | undefined) + ?? "574196284059-4go0qqvqvbpjla25hmbp9hc2h3qtvcqi.apps.googleusercontent.com"; const DEV_MODE = import.meta.env.VITE_DEV_MODE === "true"; const EXPIRY_BUFFER_MS = 60_000; diff --git a/extension/src/manifest.ts b/extension/src/manifest.ts index 174da6a..71fdce6 100644 --- a/extension/src/manifest.ts +++ b/extension/src/manifest.ts @@ -4,6 +4,7 @@ import pkg from "../package.json" with { type: "json" }; export default defineManifest({ manifest_version: 3, name: "WorkTrace", + key: "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvSo1/6UBVPUowjH+mwCmWB30I85MGpNqEvf/uDMQqPcC/+VK7iXahcqQcT1xXo3W/6tXeHVWuDfFslkKw6NZSFrlF7+4AUfl2JPKh4Rd/K5iAnM4BoTKQGx9v6wlR1RYIEgGQ+/nDyc7w1zAI+2oNsrUf+Uw10xDWzDR9fFDntpSgnq/ogR3ojrnnlJdbHIqjYIhdbF832I8Cu1+pMPo/BYbEE9/GFUnV7oNTQARF6Z46w4FZXmD5OLHQPBiAnXqO0u4FM2mKT7BjR64jgYtPhbvwJxYtx8BJPNyfukXq3wwVn7Is9a2iHaYaRg2GB6BSwXmG71sgJHvyHUuSRSlVQIDAQAB", version: pkg.version, description: "Capture dev session context for AI-generated reports.", icons: { From 16f98f155af6ea9d734a978246bfd2b8da7a91ca Mon Sep 17 00:00:00 2001 From: Bohdan Date: Tue, 2 Jun 2026 23:30:36 +0300 Subject: [PATCH 2/5] docs: update extension install instructions for prod release --- README.md | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 2eb7313..83c51e6 100644 --- a/README.md +++ b/README.md @@ -91,17 +91,14 @@ The extension card should appear with no errors. For HMR-rebuild during active d ### Load from `.zip` (without source code) -```bash -cd extension -npm run zip # builds and creates worktrace-extension.zip -``` +Download `worktrace-extension.zip` from the [latest GitHub Release](https://github.com/BODMAT/worktrace/releases/latest), then: -Then in Chrome: - -1. Unzip `worktrace-extension.zip` to any folder +1. Unzip to any folder 2. Open `chrome://extensions` → **Developer mode** → **Load unpacked** 3. Select the unzipped folder +No `.env` needed — the production dashboard URL and OAuth client ID are baked into the release build. + ## Verifying it works 1. **Dashboard** — відкрий `http://localhost:3000`, натисни "Sign in with Google" → має відкритись `/dashboard` з даними. From 6d350ed18c0c07c5de32e534a4e95c1c6b242f00 Mon Sep 17 00:00:00 2001 From: Bohdan Date: Tue, 2 Jun 2026 23:33:29 +0300 Subject: [PATCH 3/5] fix(dashboard): call lenis.resize() on route change to fix scroll on direct page load --- dashboard/components/smooth-scroll.tsx | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/dashboard/components/smooth-scroll.tsx b/dashboard/components/smooth-scroll.tsx index e31a492..085edec 100644 --- a/dashboard/components/smooth-scroll.tsx +++ b/dashboard/components/smooth-scroll.tsx @@ -1,14 +1,31 @@ "use client"; -import { ReactLenis } from "lenis/react"; +import { useEffect } from "react"; +import { usePathname } from "next/navigation"; +import { ReactLenis, useLenis } from "lenis/react"; import type { LenisOptions } from "lenis"; const OPTIONS: LenisOptions = { - duration: 1.4, // inertia length in seconds - easing: (t) => Math.min(1, 1.001 - Math.pow(2, -10 * t)), // expo ease-out + duration: 1.4, + easing: (t) => Math.min(1, 1.001 - Math.pow(2, -10 * t)), smoothWheel: true, }; +function LenisResizer() { + const lenis = useLenis(); + const pathname = usePathname(); + useEffect(() => { + lenis?.scrollTo(0, { immediate: true }); + lenis?.resize(); + }, [lenis, pathname]); + return null; +} + export function SmoothScroll({ children }: { children: React.ReactNode }) { - return {children}; + return ( + + + {children} + + ); } From 26f87102c23d5609cb2aac5f9278bc2aca6f008b Mon Sep 17 00:00:00 2001 From: Bohdan Date: Tue, 2 Jun 2026 23:34:44 +0300 Subject: [PATCH 4/5] fix(dashboard): footer link points to releases page --- dashboard/app/dashboard/layout.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboard/app/dashboard/layout.tsx b/dashboard/app/dashboard/layout.tsx index d8c4bc7..aaf25b7 100644 --- a/dashboard/app/dashboard/layout.tsx +++ b/dashboard/app/dashboard/layout.tsx @@ -19,7 +19,7 @@ export default async function DashboardLayout({