Skip to content

Add calendar time tracking and tighten app routing - #10

Merged
Berget1411 merged 2 commits into
mainfrom
dev
Apr 12, 2026
Merged

Add calendar time tracking and tighten app routing#10
Berget1411 merged 2 commits into
mainfrom
dev

Conversation

@Berget1411

Copy link
Copy Markdown
Owner

Summary

  • Added the calendar time-tracking experience, including the calendar page, event editor, toolbar, active timer card, and supporting mutations/utilities.
  • Moved authenticated app routes under /app and updated redirects, navigation, and route generation accordingly.
  • Hardened auth and environment handling, including session/cookie updates and disabling AI routes/UI when the production key is missing.
  • Refreshed shared UI primitives and theme tokens to better match the app’s design system.
  • Added TanStack Start best-practice guidance and updated deploy workflows and infra wiring.

Testing

  • Not run.
  • Manual checks not performed in this branch snapshot.

- Gate server AI routes on the Gemini API key
- Hide the AI nav item unless AI is enabled
- Switch OAuth icons to react-icons
- Use `process.env.VITE_AI_ENABLED` when wiring web bindings
- Preserve the existing false default when the flag is unset
@greptile-apps

greptile-apps Bot commented Apr 12, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR gates the AI feature behind a VITE_AI_ENABLED / GOOGLE_GENERATIVE_AI_API_KEY flag pair — hiding the nav item on the client and returning 404 on the server when the key is absent — and intentionally disables AI in the prod deployment. The rest of the changes (calendar route, sidebar cleanup, env schema) are straightforward.

The one thing worth addressing before merge is the swap of inline brand-icon SVGs for react-icons/fa, which introduces a new dependency that conflicts with the project's "Lucide React exclusively — never mix" rule (AGENTS.md).

Confidence Score: 5/5

Safe to merge; the only finding is a P2 style/rule violation on the icon library choice.

All remaining findings are P2 — the react-icons import violates the design-system guideline but does not affect correctness, data integrity, or runtime behaviour. Per confidence guidance, P2-only PRs default to 5/5.

apps/web/src/features/auth/components/oauth-buttons.tsx and apps/web/package.json — the react-icons dependency should be reconsidered.

Important Files Changed

Filename Overview
apps/web/src/features/auth/components/oauth-buttons.tsx Replaces inline multi-colour SVG icons with react-icons FaGoogle/FaGithub; violates icon library rule, loses Google brand colours, and drops explicit size-4 class.
apps/web/package.json Adds react-icons dependency, which conflicts with the "Lucide React exclusively" icon-library guideline in AGENTS.md.
apps/server/src/rest/routes/rest-router.ts Conditionally mounts AI routes only when the API key is present; returns 404 via c.notFound() otherwise.
packages/env/src/web.ts Adds VITE_AI_ENABLED as optional string→boolean transform; handles undefined/empty-string correctly via emptyStringAsUndefined.
packages/infra/alchemy.run.ts Makes GOOGLE_GENERATIVE_AI_API_KEY binding optional and wires VITE_AI_ENABLED (defaults to "false") into the Vite worker.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Deploy / alchemy.run.ts] -->|GOOGLE_GENERATIVE_AI_API_KEY set?| B{Key present?}
    B -->|Yes| C[Bind key to Hono server\nVITE_AI_ENABLED = 'true']
    B -->|No| D[Omit key binding\nVITE_AI_ENABLED = 'false']

    C --> E[restRouter mounts\n/ai routes via aiRouter]
    D --> F[restRouter returns 404\nfor /ai and /ai/*]

    C --> G[Web client:\nenv.VITE_AI_ENABLED = true\n→ AI Chat nav item shown]
    D --> H[Web client:\nenv.VITE_AI_ENABLED = false\n→ AI Chat nav item hidden]
Loading

Fix All in Codex Fix All in Claude Code Fix All in Cursor

Reviews (1): Last reviewed commit: "Read AI flag from process env in web bin..." | Re-trigger Greptile

</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

@Berget1411
Berget1411 merged commit 3408b2a into main Apr 12, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant