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
2 changes: 1 addition & 1 deletion .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
# Secrets — same for dev and prod
BETTER_AUTH_SECRET: ${{ secrets.BETTER_AUTH_SECRET }}
POLAR_ACCESS_TOKEN: ${{ secrets.POLAR_ACCESS_TOKEN }}
GOOGLE_GENERATIVE_AI_API_KEY: ${{ secrets.GOOGLE_GENERATIVE_AI_API_KEY }}
# GOOGLE_GENERATIVE_AI_API_KEY intentionally omitted — AI is disabled in prod
GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }}
GITHUB_CLIENT_SECRET: ${{ secrets.GITHUB_CLIENT_SECRET }}
GMAIL_APP_PASSWORD: ${{ secrets.GMAIL_APP_PASSWORD }}
Expand Down
8 changes: 7 additions & 1 deletion apps/server/src/rest/routes/rest-router.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import { Hono } from "hono";

import { aiRouter } from "../../modules/ai";
import { env } from "@open-learn/env/server";

export const restRouter = new Hono();

restRouter.route("/ai", aiRouter);
if (env.GOOGLE_GENERATIVE_AI_API_KEY) {
restRouter.route("/ai", aiRouter);
} else {
restRouter.all("/ai/*", (c) => c.notFound());
restRouter.all("/ai", (c) => c.notFound());
}
1 change: 1 addition & 0 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"react": "^19.2.3",
"react-big-calendar": "^1.19.4",
"react-dom": "^19.2.3",
"react-icons": "^5.6.0",
"sonner": "catalog:",
"streamdown": "^1.6.10",
"zod": "catalog:"
Expand Down
36 changes: 3 additions & 33 deletions apps/web/src/features/auth/components/oauth-buttons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,7 @@ import { toast } from "sonner";

import { authClient } from "@/lib/auth-client";
import { AUTH_REDIRECT } from "../constants";

function GoogleIcon() {
return (
<svg viewBox="0 0 24 24" className="size-4" aria-hidden="true">
<path
d="M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"
fill="#4285F4"
/>
<path
d="M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"
fill="#34A853"
/>
<path
d="M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"
fill="#FBBC05"
/>
<path
d="M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"
fill="#EA4335"
/>
</svg>
);
}

function GitHubIcon() {
return (
<svg viewBox="0 0 24 24" className="size-4 fill-current" aria-hidden="true">
<path d="M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z" />
</svg>
);
}
import { FaGoogle, FaGithub } from "react-icons/fa";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 react-icons violates the project's icon library rule

AGENTS.md states "Icon library: Lucide React exclusively — never mix." Importing react-icons/fa for two icons adds a ~500-icon dependency that contradicts this rule. Two specific side effects also land with this change: (1) FaGoogle is monochrome, whereas the removed inline SVG rendered the authentic multi-colour Google brand mark; (2) neither FaGoogle nor FaGithub carry an explicit size class, so they fall back to 1em instead of the previous size-4 (16 px).

The prior inline-SVG implementation was the correct compliant approach for brand icons that Lucide doesn't ship. Consider restoring it, or explicitly requesting a design-system exception before merging.

Context Used: AGENTS.md (source)

Fix in Codex Fix in Claude Code Fix in Cursor


export default function OAuthButtons({ invitationId }: { invitationId?: string }) {
const [loadingProvider, setLoadingProvider] = useState<"google" | "github" | null>(null);
Expand Down Expand Up @@ -71,7 +41,7 @@ export default function OAuthButtons({ invitationId }: { invitationId?: string }
disabled={loadingProvider !== null}
onClick={() => handleOAuth("google")}
>
<GoogleIcon />
<FaGoogle />
{loadingProvider === "google" ? "Connecting..." : "Google"}
</Button>
<Button
Expand All @@ -81,7 +51,7 @@ export default function OAuthButtons({ invitationId }: { invitationId?: string }
disabled={loadingProvider !== null}
onClick={() => handleOAuth("github")}
>
<GitHubIcon />
<FaGithub />
{loadingProvider === "github" ? "Connecting..." : "GitHub"}
</Button>
</div>
Expand Down
18 changes: 12 additions & 6 deletions apps/web/src/features/navigation/components/app-sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ import { TeamSwitcher } from "./team-switcher";
import NavMain from "./nav-main";
import NavUser from "./nav-user";
import NavManage from "./nav-manage";
import { env } from "@open-learn/env/web";

const navMainItems = [
const baseNavMainItems = [
{
title: "Dashboard",
to: "/app",
Expand All @@ -50,13 +51,18 @@ const navMainItems = [
to: "/app/calendar",
icon: CalendarIcon,
},
{
title: "AI Chat",
to: "/app/ai",
icon: BotIcon,
},
] as const;

const aiNavItem = {
title: "AI Chat",
to: "/app/ai",
icon: BotIcon,
} as const;

const navMainItems = env.VITE_AI_ENABLED
? ([...baseNavMainItems, aiNavItem] as const)
: baseNavMainItems;

const navManageItems = [
{
title: "Projects",
Expand Down
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.

4 changes: 4 additions & 0 deletions packages/env/src/web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ export const env = createEnv({
clientPrefix: "VITE_",
client: {
VITE_SERVER_URL: z.url(),
VITE_AI_ENABLED: z
.string()
.optional()
.transform((v) => v === "true"),
},
runtimeEnv: (import.meta as any).env,
emptyStringAsUndefined: true,
Expand Down
5 changes: 4 additions & 1 deletion packages/infra/alchemy.run.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ export const server = await Worker("server", {
CORS_ORIGIN: alchemy.env.CORS_ORIGIN!,
BETTER_AUTH_SECRET: alchemy.secret.env.BETTER_AUTH_SECRET!,
BETTER_AUTH_URL: alchemy.env.BETTER_AUTH_URL!,
GOOGLE_GENERATIVE_AI_API_KEY: alchemy.secret.env.GOOGLE_GENERATIVE_AI_API_KEY!,
...(process.env.GOOGLE_GENERATIVE_AI_API_KEY
? { GOOGLE_GENERATIVE_AI_API_KEY: alchemy.secret.env.GOOGLE_GENERATIVE_AI_API_KEY! }
: {}),
POLAR_ACCESS_TOKEN: alchemy.secret.env.POLAR_ACCESS_TOKEN!,
POLAR_SUCCESS_URL: alchemy.env.POLAR_SUCCESS_URL!,
GOOGLE_CLIENT_ID: alchemy.env.GOOGLE_CLIENT_ID!,
Expand All @@ -49,6 +51,7 @@ export const web = await Vite("web", {
assets: "dist",
bindings: {
VITE_SERVER_URL: server.url,
VITE_AI_ENABLED: process.env.VITE_AI_ENABLED ?? "false",
DEV_PORT: "3001",
},
});
Expand Down
Loading