Skip to content

fix(web): improve ui - #800

Merged
AmanVarshney01 merged 5 commits into
mainfrom
improvce-ui
Jan 4, 2026
Merged

AmanVarshney01 merged 5 commits into
mainfrom
improvce-ui

Conversation

@AmanVarshney01

@AmanVarshney01 AmanVarshney01 commented Jan 4, 2026 •

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • Style

    • Updated backgrounds across homepage, analytics and showcase cards; added monospaced typography to many headers, labels, metric values, and counters; improved spacing, hover effects and card visual hierarchy.
  • New Features

    • Added a Live Logs panel with collapsible, animated event list, timestamps and package‑manager badges; shows recent activity (≈30‑minute view).
    • Horizontal scrollbar added to scrollable areas.
  • Refactor

    • Redesigned analytics header and page layout, surfaced legacy data block, and simplified analytics flow (removed range selector and streamlined data rendering).

✏️ Tip: You can customize this high-level summary in your review settings.

@vercel

vercel Bot commented Jan 4, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
create-better-t-stack-web Ready Ready Preview, Comment Jan 4, 2026 10:20pm

@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working labels Jan 4, 2026
@coderabbitai

coderabbitai Bot commented Jan 4, 2026 •

Copy link
Copy Markdown
Contributor

Caution

Review failed

The pull request is closed.

Walkthrough

Presentation-wide styling updates (bg-fd-background, font-mono) across home/showcase UI; significant analytics dashboard refactor (header, page, chart/metric card layouts), addition of client-side LiveLogs, removal of range-based analytics client logic, and backend changes replacing getAllEvents with a no-arg getRecentEvents that returns events from the last 30 minutes.

Changes

Cohort / File(s) Summary
Analytics — dashboard, charts & LiveLogs
apps/web/src/app/(home)/analytics/_components/analytics-header.tsx, apps/web/src/app/(home)/analytics/_components/analytics-page.tsx, apps/web/src/app/(home)/analytics/_components/live-logs.tsx, apps/web/src/app/(home)/analytics/_components/dev-environment-charts.tsx, apps/web/src/app/(home)/analytics/_components/metrics-cards.tsx, apps/web/src/app/(home)/analytics/_components/stack-configuration-charts.tsx, apps/web/src/app/(home)/analytics/_components/timeline-charts.tsx
AnalyticsHeader signature changed (removed totalProjects), AnalyticsPage props simplified (removed range/onRangeChange/isLoading), new client-side LiveLogs component added and placed above timeline, Chart/Metric card layouts reworked and many className/style changes (group, bg-fd-background, font-mono, hover effects).
Analytics — client & data flow
apps/web/src/app/(home)/analytics/analytics-client.tsx
Removed range state, aggregation helpers, and live-event aggregation paths; now returns precomputed stats or a default dataset (stateless/simplified path). Public signature unchanged but internal behavior simplified.
Backend — analytics handlers
packages/backend/convex/analytics.ts
Replaced getAllEvents with getRecentEvents() (no args) returning events from the last 30 minutes filtered by _creationTime; ingestEvent now fetches inserted event to use its _creationTime; getDailyStats date-window logic adjusted. Signatures/behavior for recent-events and stats changed.
Home — feature & utility components
apps/web/src/app/(home)/_components/FeatureCard.tsx, apps/web/src/app/(home)/_components/command-section.tsx, apps/web/src/app/(home)/_components/stats-section.tsx, apps/web/src/app/(home)/_components/testimonials.tsx
Presentation-only className updates: added bg-fd-background, applied font-mono to labels/headers, adjusted hover/background styles; no logic or public API changes.
New / showcase / stack pages
apps/web/src/app/(home)/new/_components/stack-builder.tsx, apps/web/src/app/(home)/showcase/_components/ShowcaseItem.tsx, apps/web/src/app/(home)/showcase/_components/showcase-page.tsx, apps/web/src/app/(home)/stack/_components/stack-display.tsx
Card/header styling and typography updates (monospace headers, bg-fd-background), icon/padding tweaks; UI-only changes.
Global UI — misc components
apps/web/src/components/ui/scroll-area.tsx, apps/web/src/app/not-found.tsx, apps/web/src/app/(home)/_components/command-section.tsx
Added horizontal scrollbar in ScrollArea, and styling-only updates (bg-fd-background, font-mono) to various panels and headings.

Possibly related PRs

Pre-merge checks

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ❓ Inconclusive The title 'fix(web): improve ui' is vague and generic, using non-descriptive terms that don't clearly convey the specific changes made throughout the codebase. Consider a more specific title that highlights the main styling improvements, such as 'refactor(web): update component styling and add dark background theme' or similar.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f589e15 and 643b341.

📒 Files selected for processing (4)
  • apps/web/src/app/(home)/analytics/_components/analytics-page.tsx
  • apps/web/src/app/(home)/analytics/_components/live-logs.tsx
  • apps/web/src/app/(home)/analytics/analytics-client.tsx
  • packages/backend/convex/analytics.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (4)
apps/web/src/app/(home)/showcase/_components/ShowcaseItem.tsx (1)

7-15: Use type alias instead of interface declaration.

According to the coding guidelines, TypeScript type aliases should be used instead of interface declarations.

Based on coding guidelines: "Use TypeScript type aliases instead of interface declarations"

🔎 Proposed fix
-export interface ShowcaseItemProps {
+export type ShowcaseItemProps = {
   title: string;
   description: string;
   imageUrl: string;
   liveUrl?: string;
   sourceUrl?: string;
   tags: string[];
   index?: number;
-}
+};
apps/web/src/app/(home)/new/_components/stack-builder.tsx (2)

49-51: Remove explicit return type.

The function has an explicit return type which violates the coding guidelines.

As per coding guidelines, TypeScript files should not use explicit return types.

🔎 Proposed fix
-function formatProjectName(name: string): string {
+function formatProjectName(name: string) {
   return name.replace(/\s+/g, "-");
 }

53-53: Convert arrow function to standard function declaration.

The component is defined as an arrow function, which violates the coding guidelines.

As per coding guidelines, functions should be defined using the standard function declaration syntax, not arrow functions.

🔎 Proposed fix
-const StackBuilder = () => {
+function StackBuilder() {

And at the end of the file (line 892):

-export default StackBuilder;
+export default StackBuilder
apps/web/src/app/(home)/_components/testimonials.tsx (1)

319-321: Missing font-mono class for consistency.

The TWEET_TESTIMONIALS.ARCHIVE label in the large breakpoint section (lg:block) is missing the font-mono class that was added to the equivalent labels on lines 215 and 267.

🔎 Proposed fix
-              <span className="font-semibold text-muted-foreground text-sm">
+              <span className="font-semibold font-mono text-muted-foreground text-sm">
                 TWEET_TESTIMONIALS.ARCHIVE
               </span>
🧹 Nitpick comments (3)
apps/web/src/app/(home)/_components/testimonials.tsx (2)

24-63: Arrow function components should use standard function declarations.

Per coding guidelines, define functions using standard function declaration syntax instead of arrow functions.

🔎 Proposed refactor
-const VideoCard = ({
-  video,
-  index,
-}: {
-  video: { embedId: string; title: string };
-  index: number;
-}) => (
+function VideoCard({
+  video,
+  index,
+}: {
+  video: { embedId: string; title: string };
+  index: number;
+}) {
+  return (
   <motion.div
     ...
   </motion.div>
-);
+  );
+}

65-92: Convert TweetCard to standard function declaration.

Same as VideoCard above—use a function declaration for consistency with coding guidelines.

🔎 Proposed refactor
-const TweetCard = ({ tweetId, index }: { tweetId: string; index: number }) => (
+function TweetCard({ tweetId, index }: { tweetId: string; index: number }) {
+  return (
   <motion.div
     ...
   </motion.div>
-);
+  );
+}
apps/web/src/app/(home)/analytics/_components/analytics-page.tsx (1)

46-50: Grid wrapper could be simplified.

The grid container with lg:grid-cols-3 and a single child with lg:col-span-3 is redundant—the child already spans full width. Consider simplifying:

🔎 Proposed simplification
-        <div className="grid grid-cols-1 gap-8 lg:grid-cols-3">
-          <div className="lg:col-span-3">
-            <LiveLogs />
-          </div>
+        <div className="mb-8">
+          <LiveLogs />
         </div>
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 04aa331 and 462cd58.

📒 Files selected for processing (17)
  • apps/web/src/app/(home)/_components/FeatureCard.tsx
  • apps/web/src/app/(home)/_components/command-section.tsx
  • apps/web/src/app/(home)/_components/stats-section.tsx
  • apps/web/src/app/(home)/_components/testimonials.tsx
  • apps/web/src/app/(home)/analytics/_components/analytics-header.tsx
  • apps/web/src/app/(home)/analytics/_components/analytics-page.tsx
  • apps/web/src/app/(home)/analytics/_components/dev-environment-charts.tsx
  • apps/web/src/app/(home)/analytics/_components/live-logs.tsx
  • apps/web/src/app/(home)/analytics/_components/metrics-cards.tsx
  • apps/web/src/app/(home)/analytics/_components/stack-configuration-charts.tsx
  • apps/web/src/app/(home)/analytics/_components/timeline-charts.tsx
  • apps/web/src/app/(home)/new/_components/stack-builder.tsx
  • apps/web/src/app/(home)/showcase/_components/ShowcaseItem.tsx
  • apps/web/src/app/(home)/showcase/_components/showcase-page.tsx
  • apps/web/src/app/(home)/stack/_components/stack-display.tsx
  • apps/web/src/app/not-found.tsx
  • packages/template-generator/src/templates.generated.ts
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/better-t-stack-repo.mdc)

Define functions using the standard function declaration syntax, not arrow functions

Files:

  • apps/web/src/app/(home)/_components/stats-section.tsx
  • apps/web/src/app/(home)/analytics/_components/metrics-cards.tsx
  • apps/web/src/app/(home)/analytics/_components/live-logs.tsx
  • apps/web/src/app/(home)/_components/FeatureCard.tsx
  • apps/web/src/app/(home)/analytics/_components/timeline-charts.tsx
  • apps/web/src/app/(home)/_components/command-section.tsx
  • apps/web/src/app/not-found.tsx
  • apps/web/src/app/(home)/analytics/_components/stack-configuration-charts.tsx
  • apps/web/src/app/(home)/analytics/_components/dev-environment-charts.tsx
  • apps/web/src/app/(home)/new/_components/stack-builder.tsx
  • apps/web/src/app/(home)/showcase/_components/ShowcaseItem.tsx
  • apps/web/src/app/(home)/showcase/_components/showcase-page.tsx
  • apps/web/src/app/(home)/_components/testimonials.tsx
  • apps/web/src/app/(home)/analytics/_components/analytics-header.tsx
  • apps/web/src/app/(home)/analytics/_components/analytics-page.tsx
  • apps/web/src/app/(home)/stack/_components/stack-display.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/better-t-stack-repo.mdc)

**/*.{ts,tsx}: Use TypeScript type aliases instead of interface declarations
Do not use explicit return types

Files:

  • apps/web/src/app/(home)/_components/stats-section.tsx
  • apps/web/src/app/(home)/analytics/_components/metrics-cards.tsx
  • apps/web/src/app/(home)/analytics/_components/live-logs.tsx
  • apps/web/src/app/(home)/_components/FeatureCard.tsx
  • apps/web/src/app/(home)/analytics/_components/timeline-charts.tsx
  • apps/web/src/app/(home)/_components/command-section.tsx
  • apps/web/src/app/not-found.tsx
  • apps/web/src/app/(home)/analytics/_components/stack-configuration-charts.tsx
  • apps/web/src/app/(home)/analytics/_components/dev-environment-charts.tsx
  • apps/web/src/app/(home)/new/_components/stack-builder.tsx
  • apps/web/src/app/(home)/showcase/_components/ShowcaseItem.tsx
  • apps/web/src/app/(home)/showcase/_components/showcase-page.tsx
  • apps/web/src/app/(home)/_components/testimonials.tsx
  • apps/web/src/app/(home)/analytics/_components/analytics-header.tsx
  • apps/web/src/app/(home)/analytics/_components/analytics-page.tsx
  • apps/web/src/app/(home)/stack/_components/stack-display.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

**/*.{ts,tsx,js,jsx}: Use bun <file> instead of node <file> or ts-node <file> for running TypeScript/JavaScript files
Bun automatically loads .env files, so don't use the dotenv package
Use Bun.serve() which supports WebSockets, HTTPS, and routes instead of express
Use bun:sqlite module for SQLite instead of better-sqlite3
Use Bun.redis for Redis instead of ioredis
Use Bun.sql for Postgres instead of pg or postgres.js
Use built-in WebSocket instead of the ws package
Prefer Bun.file over node:fs readFile/writeFile methods
Use Bun.$ template literal syntax instead of execa for shell command execution
Import .css files directly in TypeScript/JavaScript files; Bun's CSS bundler will handle bundling
Run server with bun --hot <file> to enable hot reloading during development

Files:

  • apps/web/src/app/(home)/_components/stats-section.tsx
  • apps/web/src/app/(home)/analytics/_components/metrics-cards.tsx
  • apps/web/src/app/(home)/analytics/_components/live-logs.tsx
  • apps/web/src/app/(home)/_components/FeatureCard.tsx
  • apps/web/src/app/(home)/analytics/_components/timeline-charts.tsx
  • apps/web/src/app/(home)/_components/command-section.tsx
  • apps/web/src/app/not-found.tsx
  • apps/web/src/app/(home)/analytics/_components/stack-configuration-charts.tsx
  • apps/web/src/app/(home)/analytics/_components/dev-environment-charts.tsx
  • apps/web/src/app/(home)/new/_components/stack-builder.tsx
  • apps/web/src/app/(home)/showcase/_components/ShowcaseItem.tsx
  • apps/web/src/app/(home)/showcase/_components/showcase-page.tsx
  • apps/web/src/app/(home)/_components/testimonials.tsx
  • apps/web/src/app/(home)/analytics/_components/analytics-header.tsx
  • apps/web/src/app/(home)/analytics/_components/analytics-page.tsx
  • apps/web/src/app/(home)/stack/_components/stack-display.tsx
**/*.{ts,tsx,js,jsx,css}

📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

Use bun build <file> instead of webpack or esbuild for bundling TypeScript, JavaScript, and CSS files

Files:

  • apps/web/src/app/(home)/_components/stats-section.tsx
  • apps/web/src/app/(home)/analytics/_components/metrics-cards.tsx
  • apps/web/src/app/(home)/analytics/_components/live-logs.tsx
  • apps/web/src/app/(home)/_components/FeatureCard.tsx
  • apps/web/src/app/(home)/analytics/_components/timeline-charts.tsx
  • apps/web/src/app/(home)/_components/command-section.tsx
  • apps/web/src/app/not-found.tsx
  • apps/web/src/app/(home)/analytics/_components/stack-configuration-charts.tsx
  • apps/web/src/app/(home)/analytics/_components/dev-environment-charts.tsx
  • apps/web/src/app/(home)/new/_components/stack-builder.tsx
  • apps/web/src/app/(home)/showcase/_components/ShowcaseItem.tsx
  • apps/web/src/app/(home)/showcase/_components/showcase-page.tsx
  • apps/web/src/app/(home)/_components/testimonials.tsx
  • apps/web/src/app/(home)/analytics/_components/analytics-header.tsx
  • apps/web/src/app/(home)/analytics/_components/analytics-page.tsx
  • apps/web/src/app/(home)/stack/_components/stack-display.tsx
**/*.{html,tsx,ts,jsx,js}

📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

Use HTML imports with Bun.serve() for frontend instead of Vite

Files:

  • apps/web/src/app/(home)/_components/stats-section.tsx
  • apps/web/src/app/(home)/analytics/_components/metrics-cards.tsx
  • apps/web/src/app/(home)/analytics/_components/live-logs.tsx
  • apps/web/src/app/(home)/_components/FeatureCard.tsx
  • apps/web/src/app/(home)/analytics/_components/timeline-charts.tsx
  • apps/web/src/app/(home)/_components/command-section.tsx
  • apps/web/src/app/not-found.tsx
  • apps/web/src/app/(home)/analytics/_components/stack-configuration-charts.tsx
  • apps/web/src/app/(home)/analytics/_components/dev-environment-charts.tsx
  • apps/web/src/app/(home)/new/_components/stack-builder.tsx
  • apps/web/src/app/(home)/showcase/_components/ShowcaseItem.tsx
  • apps/web/src/app/(home)/showcase/_components/showcase-page.tsx
  • apps/web/src/app/(home)/_components/testimonials.tsx
  • apps/web/src/app/(home)/analytics/_components/analytics-header.tsx
  • apps/web/src/app/(home)/analytics/_components/analytics-page.tsx
  • apps/web/src/app/(home)/stack/_components/stack-display.tsx
🧬 Code graph analysis (1)
apps/web/src/app/(home)/analytics/_components/analytics-page.tsx (1)
apps/web/src/app/(home)/analytics/_components/live-logs.tsx (1)
  • LiveLogs (11-122)
🪛 Biome (2.1.2)
apps/web/src/app/(home)/analytics/_components/live-logs.tsx

[error] 111-111: Wrap comments inside children within braces.

Unsafe fix: Wrap the comments with braces

(lint/suspicious/noCommentText)

🔇 Additional comments (23)
apps/web/src/app/(home)/showcase/_components/showcase-page.tsx (1)

29-32: LGTM! Clean UI improvements that enhance the showcase page.

The changes improve visual hierarchy and responsive behavior:

  • Larger Terminal icon (h-5 w-5) improves visibility in the header
  • Monospaced font aligns with the terminal/CLI aesthetic and matches the broader typography updates in this PR
  • Responsive divider (hidden on mobile, visible on sm+) provides a cleaner mobile experience

All changes are presentation-only with no functional impact.

apps/web/src/app/(home)/analytics/_components/metrics-cards.tsx (2)

19-49: Well-executed styling improvements!

The card restructuring enhances the visual hierarchy effectively:

  • Grouping the icon and title in a single row creates better information density
  • The monospace font (font-mono) is an excellent choice for displaying metrics and numerical data
  • The hover transition and bordered subtitle section add polish
  • Using cursor-default appropriately prevents showing a pointer cursor on non-interactive content

These changes align well with modern dashboard UI patterns.


67-113: Consistent icon sizing across all metrics.

The uniform reduction of icon sizes (h-4 w-4 → h-3 w-3) maintains visual consistency across all metric cards and complements the restructured header layout.

apps/web/src/app/(home)/_components/FeatureCard.tsx (1)

60-60: LGTM! Consistent styling update.

The background class change from bg-card to bg-fd-background aligns with the PR-wide UI refresh.

apps/web/src/app/(home)/stack/_components/stack-display.tsx (1)

115-115: LGTM! Consistent styling improvements.

The addition of font-mono typography and the background class changes from bg-muted/20 to bg-fd-background align well with the PR's unified design system update.

Also applies to: 123-123, 168-168

apps/web/src/app/(home)/showcase/_components/ShowcaseItem.tsx (1)

29-29: LGTM! Enhanced visual interactions.

The styling updates—adding group, bg-fd-background, hover transitions, and font-mono typography—create a cohesive visual experience that aligns with the broader UI refresh.

Also applies to: 33-35, 38-38

apps/web/src/app/not-found.tsx (1)

14-14: LGTM! Cohesive error page styling.

The monospace typography and bg-fd-background updates create a unified terminal-inspired aesthetic that matches the rest of the application.

Also applies to: 22-22, 26-26, 32-32, 45-45, 49-49, 57-57

apps/web/src/app/(home)/analytics/_components/live-logs.tsx (2)

11-122: Well-structured component with good UX patterns.

The component effectively handles loading, empty, and data states. The use of AnimatePresence with motion animations, responsive design, and scroll handling creates a polished user experience. The separation of concerns is clear and maintainable.


53-60: The event.frontend type is properly defined in the Convex schema as v.optional(v.array(v.string())), which means it can be undefined or an array of strings. The code correctly handles both states: it checks if event.frontend exists before accessing .length and then safely accesses [0]. The type contract and code implementation are aligned—no changes needed.

apps/web/src/app/(home)/_components/stats-section.tsx (2)

35-35: LGTM! Consistent background styling applied.

The bg-fd-background class has been consistently applied to all three card containers, creating a unified visual appearance across the analytics cards.

Also applies to: 90-90, 142-142


38-38: LGTM! Monospace typography enhances the technical aesthetic.

The font-mono class has been applied consistently to all card labels, reinforcing the technical/developer-focused theme of the UI.

Also applies to: 93-93, 145-145

apps/web/src/app/(home)/_components/command-section.tsx (2)

34-34: LGTM! Unified background styling applied.

The bg-fd-background class has been consistently applied across all command-related containers, creating visual cohesion with the rest of the application.

Also applies to: 73-73, 95-95, 107-107


38-38: LGTM! Monospace styling enhances readability.

The font-mono class applied to CLI_COMMAND and STACK_BUILDER labels maintains consistency with the technical theme.

Also applies to: 99-99

apps/web/src/app/(home)/new/_components/stack-builder.tsx (2)

614-614: LGTM! Monospace typography applied to category headers.

The font-mono class has been consistently applied to both desktop and mobile category headers, maintaining visual consistency across responsive layouts.

Also applies to: 773-773


677-677: LGTM! Enhanced option tile styling.

The updated card styling with border-border bg-fd-background hover:border-muted hover:bg-muted/10 provides clear visual feedback and aligns with the design system updates across the PR.

apps/web/src/app/(home)/analytics/_components/stack-configuration-charts.tsx (1)

40-54: LGTM! Improved ChartCard layout and styling.

The restructured ChartCard component now features:

  • Grouped container with hover effects for better interactivity
  • Consistent background styling with bg-fd-background
  • Enhanced header with monospace title and dollar sign prefix
  • Better visual hierarchy with description integrated into the header

These changes maintain the component's API while improving the presentation.

apps/web/src/app/(home)/analytics/_components/timeline-charts.tsx (1)

32-46: LGTM! Consistent ChartCard restructuring.

The ChartCard component has been updated with the same improvements seen in the stack-configuration-charts file:

  • Interactive hover states with grouped container
  • Unified background styling
  • Technical aesthetic with monospace typography and dollar sign prefix
  • Streamlined layout with integrated description

This consistency across analytics components creates a cohesive user experience.

apps/web/src/app/(home)/_components/testimonials.tsx (1)

41-41: Background styling updates look good.

The addition of bg-fd-background to both VideoCard and TweetCard wrappers aligns with the broader PR styling direction.

Also applies to: 76-76

apps/web/src/app/(home)/analytics/_components/analytics-page.tsx (1)

80-106: RangeSelector styling improvements look good.

The updated styling with monospace typography, bordered container, and improved loading indicator aligns well with the terminal-inspired design language across the analytics components.

apps/web/src/app/(home)/analytics/_components/dev-environment-charts.tsx (2)

9-28: Consider converting to standard function declaration.

Per coding guidelines, prefer standard function declarations over arrow functions. This applies to CustomYAxisTick here.

🔎 Proposed refactor
-function CustomYAxisTick({
+function CustomYAxisTick({
   x,
   y,
   payload,
   maxChars = 10,
 }: {
   x: number;
   y: number;
   payload: { value: string };
   maxChars?: number;
 }) {

Note: This function already uses standard declaration syntax—no changes needed here. The pattern is correct.

Actually, upon closer inspection, this already uses standard function declaration syntax. No issue here.


68-82: ChartCard styling updates look good.

The restructured ChartCard with bg-fd-background, hover effects, and monospace title styling aligns with the consistent visual language being applied across analytics components.

apps/web/src/app/(home)/analytics/_components/analytics-header.tsx (2)

22-22: Consider defensive parsing for legacy.lastUpdatedIso.

While lastUpdated is safely guarded with a conditional, legacy.lastUpdatedIso is parsed directly. If the string is malformed or empty, new Date() will produce an invalid date, causing format() to throw.

Consider adding validation similar to formattedDate:

🔎 Proposed defensive approach
-  const legacyDate = format(new Date(legacy.lastUpdatedIso), "MMM d, yyyy 'at' HH:mm");
+  const legacyDate = legacy.lastUpdatedIso
+    ? format(new Date(legacy.lastUpdatedIso), "MMM d, yyyy 'at' HH:mm")
+    : "Unknown";

Then update line 97 to handle the fallback gracefully.


26-105: Header restructure looks well-organized.

The new sectioned layout with status, legacy data, and informational blocks provides a cleaner information hierarchy. The consistent use of font-mono, bg-fd-background, and terminal-style prefixes ($, >, #) maintains the design language across the analytics dashboard.

@dosubot dosubot Bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Jan 4, 2026

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
apps/web/src/app/(home)/showcase/_components/ShowcaseItem.tsx (1)

7-15: Convert interface to type alias per coding guidelines.

The coding guidelines specify using TypeScript type aliases instead of interface declarations for .tsx files.

🔎 Proposed fix
-export interface ShowcaseItemProps {
+export type ShowcaseItemProps = {
   title: string;
   description: string;
   imageUrl: string;
   liveUrl?: string;
   sourceUrl?: string;
   tags: string[];
   index?: number;
-}
+};

As per coding guidelines.

apps/web/src/app/(home)/analytics/_components/analytics-header.tsx (1)

22-22: Add defensive null check for legacy.lastUpdatedIso.

Line 22 formats legacy.lastUpdatedIso without checking if it's valid, unlike the defensive check for lastUpdated on lines 19-21. If legacy.lastUpdatedIso is null, undefined, or an invalid date string, this will throw a runtime error.

🔎 Proposed fix
-  const legacyDate = format(new Date(legacy.lastUpdatedIso), "MMM d, yyyy 'at' HH:mm");
+  const legacyDate = legacy.lastUpdatedIso
+    ? format(new Date(legacy.lastUpdatedIso), "MMM d, yyyy 'at' HH:mm")
+    : "N/A";

Then handle the potential "N/A" value in the rendering at line 92, or add conditional rendering similar to lines 45-50.

🧹 Nitpick comments (2)
packages/backend/convex/analytics.ts (2)

274-284: Explicit branches improve readability.

The refactored cutoff logic using explicit if-else branches is more maintainable than arithmetic calculations. The logic correctly handles all range values.

Optional: Make the else case explicit for "30m"

While the else clause is currently safe due to the union type constraint, making it explicit would improve future maintainability if the range union is extended:

     if (args.range === "30d") {
       cutoff = now - 30 * 24 * 60 * 60 * 1000;
     } else if (args.range === "7d") {
       cutoff = now - 7 * 24 * 60 * 60 * 1000;
     } else if (args.range === "1d") {
       cutoff = now - 24 * 60 * 60 * 1000;
-    } else {
+    } else if (args.range === "30m") {
       cutoff = now - 30 * 60 * 1000; // 30 mins
     }

286-292: Consider adding a maximum limit cap for defensive programming.

The limit enforcement correctly uses a default of 100 and breaks when the limit is reached. However, the limit parameter accepts any number without bounds, allowing callers to request arbitrarily large values (e.g., 1,000,000).

While the query will still terminate early based on the time cutoff, adding an explicit maximum limit improves predictability and protects against unintended performance overhead.

Optional: Add maximum limit cap
-    const limit = args.limit ?? 100;
+    const MAX_LIMIT = 1000;
+    const limit = Math.min(args.limit ?? 100, MAX_LIMIT);
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 462cd58 and c485fd4.

📒 Files selected for processing (5)
  • apps/web/src/app/(home)/analytics/_components/analytics-header.tsx
  • apps/web/src/app/(home)/analytics/_components/live-logs.tsx
  • apps/web/src/app/(home)/showcase/_components/ShowcaseItem.tsx
  • apps/web/src/app/(home)/showcase/_components/showcase-page.tsx
  • packages/backend/convex/analytics.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/web/src/app/(home)/analytics/_components/live-logs.tsx
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/better-t-stack-repo.mdc)

Define functions using the standard function declaration syntax, not arrow functions

Files:

  • apps/web/src/app/(home)/showcase/_components/showcase-page.tsx
  • packages/backend/convex/analytics.ts
  • apps/web/src/app/(home)/analytics/_components/analytics-header.tsx
  • apps/web/src/app/(home)/showcase/_components/ShowcaseItem.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/better-t-stack-repo.mdc)

**/*.{ts,tsx}: Use TypeScript type aliases instead of interface declarations
Do not use explicit return types

Files:

  • apps/web/src/app/(home)/showcase/_components/showcase-page.tsx
  • packages/backend/convex/analytics.ts
  • apps/web/src/app/(home)/analytics/_components/analytics-header.tsx
  • apps/web/src/app/(home)/showcase/_components/ShowcaseItem.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

**/*.{ts,tsx,js,jsx}: Use bun <file> instead of node <file> or ts-node <file> for running TypeScript/JavaScript files
Bun automatically loads .env files, so don't use the dotenv package
Use Bun.serve() which supports WebSockets, HTTPS, and routes instead of express
Use bun:sqlite module for SQLite instead of better-sqlite3
Use Bun.redis for Redis instead of ioredis
Use Bun.sql for Postgres instead of pg or postgres.js
Use built-in WebSocket instead of the ws package
Prefer Bun.file over node:fs readFile/writeFile methods
Use Bun.$ template literal syntax instead of execa for shell command execution
Import .css files directly in TypeScript/JavaScript files; Bun's CSS bundler will handle bundling
Run server with bun --hot <file> to enable hot reloading during development

Files:

  • apps/web/src/app/(home)/showcase/_components/showcase-page.tsx
  • packages/backend/convex/analytics.ts
  • apps/web/src/app/(home)/analytics/_components/analytics-header.tsx
  • apps/web/src/app/(home)/showcase/_components/ShowcaseItem.tsx
**/*.{ts,tsx,js,jsx,css}

📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

Use bun build <file> instead of webpack or esbuild for bundling TypeScript, JavaScript, and CSS files

Files:

  • apps/web/src/app/(home)/showcase/_components/showcase-page.tsx
  • packages/backend/convex/analytics.ts
  • apps/web/src/app/(home)/analytics/_components/analytics-header.tsx
  • apps/web/src/app/(home)/showcase/_components/ShowcaseItem.tsx
**/*.{html,tsx,ts,jsx,js}

📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

Use HTML imports with Bun.serve() for frontend instead of Vite

Files:

  • apps/web/src/app/(home)/showcase/_components/showcase-page.tsx
  • packages/backend/convex/analytics.ts
  • apps/web/src/app/(home)/analytics/_components/analytics-header.tsx
  • apps/web/src/app/(home)/showcase/_components/ShowcaseItem.tsx
🧬 Code graph analysis (1)
apps/web/src/app/(home)/showcase/_components/ShowcaseItem.tsx (1)
apps/web/src/components/ui/file-tree.tsx (1)
  • File (313-313)
🔇 Additional comments (7)
apps/web/src/app/(home)/showcase/_components/ShowcaseItem.tsx (2)

29-41: LGTM! Clean styling updates.

The addition of bg-fd-background, group, hover effects, and monospace fonts creates a cohesive visual update. The padding restructure properly separates the header area while maintaining the component's structure.


54-115: LGTM! Consistent styling refinements.

The padding adjustments and visual treatments align well with the updated header structure. The monospace fonts and background classes maintain consistency with the broader UI refresh.

apps/web/src/app/(home)/showcase/_components/showcase-page.tsx (2)

29-36: LGTM! Improved responsive header layout.

The icon size increase, monospace font, and responsive divider (hidden on mobile) create a cleaner, more polished header. The conditional divider visibility prevents layout crowding on smaller screens.


40-52: LGTM! Consistent background styling.

Adding bg-fd-background to both the empty state and action card aligns with the broader UI refresh across the showcase section, creating visual consistency with other components.

Also applies to: 62-69

apps/web/src/app/(home)/analytics/_components/analytics-header.tsx (2)

76-99: LGTM! Clean layout for legacy data section.

The nested card structure with responsive grid layout effectively presents the legacy analytics data. The number formatting using toLocaleString() and toFixed(1) is appropriate.

Note: The rendering of legacyDate on line 92 depends on properly handling the potential null/invalid value in legacy.lastUpdatedIso (see comment on line 22).


64-71: The GitHub link path is correct and the file exists at apps/cli/src/utils/analytics.ts in the repository.

packages/backend/convex/analytics.ts (1)

244-245: LGTM: Schema enhancements for live event monitoring.

The addition of the "30m" range and optional limit parameter enables efficient querying of recent events with controlled result sizes, which aligns well with the LiveLogs UI requirements.

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 0

🧹 Nitpick comments (3)
apps/web/src/app/(home)/analytics/_components/live-logs.tsx (3)

105-117: Consider extracting package manager badge styling.

The nested ternary for package manager colors works but could be more maintainable as a helper function or constant mapping.

🔎 Example refactor using a mapping object

At the top of the file, add:

const PACKAGE_MANAGER_STYLES = {
  bun: "bg-orange-500/10 text-orange-500",
  pnpm: "bg-yellow-500/10 text-yellow-500",
  yarn: "bg-red-500/10 text-red-500",
} as const;

Then simplify the badge:

 {event.packageManager && (
   <span
-    className={`text-[10px] uppercase font-bold px-1.5 py-0.5 rounded ${
-      event.packageManager === "bun"
-        ? "bg-orange-500/10 text-orange-500"
-        : event.packageManager === "pnpm"
-          ? "bg-yellow-500/10 text-yellow-500"
-          : "bg-red-500/10 text-red-500"
-    }`}
+    className={cn(
+      "text-[10px] uppercase font-bold px-1.5 py-0.5 rounded",
+      PACKAGE_MANAGER_STYLES[event.packageManager as keyof typeof PACKAGE_MANAGER_STYLES]
+    )}
   >
     {event.packageManager}
   </span>
 )}

127-200: Consider reducing duplication in property rendering.

The event properties follow a repetitive pattern that could be extracted for better maintainability. While the current implementation works correctly, consolidating this logic would make future additions easier.

🔎 Example refactor using a configuration array

Define a configuration array:

const EVENT_FIELDS = [
  { key: 'frontend', label: 'frontend', isArray: true },
  { key: 'backend', label: 'backend' },
  { key: 'database', label: 'database' },
  { key: 'orm', label: 'orm' },
  { key: 'api', label: 'api' },
  { key: 'auth', label: 'auth' },
  { key: 'runtime', label: 'runtime' },
  { key: 'platform', label: 'platform' },
  { key: 'dbSetup', label: 'db_setup' },
  { key: 'addons', label: 'addons', isArray: true, colSpan: 2 },
  { key: 'examples', label: 'examples', isArray: true, colSpan: 2 },
  { key: 'cli_version', label: 'cli' },
] as const;

Then render dynamically:

<div className="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-2 text-[11px]">
  {EVENT_FIELDS.map(({ key, label, isArray, colSpan }) => {
    const value = event[key];
    if (!value || (isArray && value.length === 0)) return null;
    
    return (
      <div 
        key={key}
        className={cn(
          "flex items-center gap-1.5",
          colSpan && `col-span-${colSpan}`
        )}
      >
        <span className="text-muted-foreground">{label}:</span>
        <span className="text-accent">
          {isArray ? value.join(", ") : value}
        </span>
      </div>
    );
  })}
</div>

59-77: Consider explicit error handling for better UX.

The current implementation treats loading, error, and empty states the same way (showing the "no activity" message). While this is functional, users might benefit from knowing if an actual error occurred versus simply having no data.

Consider checking the query's error state:

const events = useQuery(api.analytics.getAllEvents, isOpen ? { range: "30m" } : "skip");

Convex's useQuery returns undefined during loading and errors. You could enhance the UX by distinguishing these states if needed, though the current approach of showing an empty state is acceptable for a live logs view.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c485fd4 and 7019c65.

📒 Files selected for processing (1)
  • apps/web/src/app/(home)/analytics/_components/live-logs.tsx
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/better-t-stack-repo.mdc)

Define functions using the standard function declaration syntax, not arrow functions

Files:

  • apps/web/src/app/(home)/analytics/_components/live-logs.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/better-t-stack-repo.mdc)

**/*.{ts,tsx}: Use TypeScript type aliases instead of interface declarations
Do not use explicit return types

Files:

  • apps/web/src/app/(home)/analytics/_components/live-logs.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

**/*.{ts,tsx,js,jsx}: Use bun <file> instead of node <file> or ts-node <file> for running TypeScript/JavaScript files
Bun automatically loads .env files, so don't use the dotenv package
Use Bun.serve() which supports WebSockets, HTTPS, and routes instead of express
Use bun:sqlite module for SQLite instead of better-sqlite3
Use Bun.redis for Redis instead of ioredis
Use Bun.sql for Postgres instead of pg or postgres.js
Use built-in WebSocket instead of the ws package
Prefer Bun.file over node:fs readFile/writeFile methods
Use Bun.$ template literal syntax instead of execa for shell command execution
Import .css files directly in TypeScript/JavaScript files; Bun's CSS bundler will handle bundling
Run server with bun --hot <file> to enable hot reloading during development

Files:

  • apps/web/src/app/(home)/analytics/_components/live-logs.tsx
**/*.{ts,tsx,js,jsx,css}

📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

Use bun build <file> instead of webpack or esbuild for bundling TypeScript, JavaScript, and CSS files

Files:

  • apps/web/src/app/(home)/analytics/_components/live-logs.tsx
**/*.{html,tsx,ts,jsx,js}

📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

Use HTML imports with Bun.serve() for frontend instead of Vite

Files:

  • apps/web/src/app/(home)/analytics/_components/live-logs.tsx
🧬 Code graph analysis (1)
apps/web/src/app/(home)/analytics/_components/live-logs.tsx (2)
apps/web/src/components/ui/button.tsx (1)
  • Button (56-56)
apps/web/src/lib/utils.ts (1)
  • cn (4-6)
🔇 Additional comments (4)
apps/web/src/app/(home)/analytics/_components/live-logs.tsx (4)

13-16: LGTM! Smart conditional data fetching.

The component structure is well-designed. The conditional query pattern (isOpen ? { range: "30m" } : "skip") is excellent for performance—data is only fetched when the panel is expanded, reducing unnecessary backend calls.


19-47: LGTM! Polished interactive header.

The collapsible header is well-implemented with:

  • Proper semantic button for accessibility
  • Smooth icon rotation transition
  • Eye-catching animated ONLINE indicator
  • Clear expand/collapse affordances

49-96: LGTM! Smooth and professional animations.

The animation implementation is excellent:

  • Proper AnimatePresence usage with initial={false} prevents initial animation
  • Smooth height transitions with easeInOut
  • mode="popLayout" on the inner AnimatePresence prevents layout shift
  • Per-event layout prop enables automatic reordering animations

82-88: LGTM! Proper hydration warning handling.

The use of suppressHydrationWarning on time displays (lines 120-122) correctly handles the expected client/server mismatch for time-sensitive content. The time formatting logic is appropriately scoped within the component.

Also applies to: 120-122

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1

🧹 Nitpick comments (6)
apps/web/src/components/ui/scroll-area.tsx (1)

8-26: Consider making scrollbar directions configurable.

The component now always renders both vertical and horizontal scrollbars. While they only appear when content overflows, hardcoding both directions reduces flexibility for consumers who may only need one direction or want to control this behavior.

Consider accepting props to configure which scrollbars to render, for example:

🔎 Proposed enhancement for configurable scrollbars
-function ScrollArea({ className, children, ...props }: ScrollAreaPrimitive.Root.Props) {
+type ScrollAreaProps = ScrollAreaPrimitive.Root.Props & {
+  showVerticalScrollbar?: boolean;
+  showHorizontalScrollbar?: boolean;
+};
+
+function ScrollArea({ 
+  className, 
+  children, 
+  showVerticalScrollbar = true,
+  showHorizontalScrollbar = true,
+  ...props 
+}: ScrollAreaProps) {
   return (
     <ScrollAreaPrimitive.Root
       data-slot="scroll-area"
       className={cn("relative", className)}
       {...props}
     >
       <ScrollAreaPrimitive.Viewport
         data-slot="scroll-area-viewport"
         className="focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1"
       >
         {children}
       </ScrollAreaPrimitive.Viewport>
-      <ScrollBar />
-      <ScrollBar orientation="horizontal" />
+      {showVerticalScrollbar && <ScrollBar />}
+      {showHorizontalScrollbar && <ScrollBar orientation="horizontal" />}
       <ScrollAreaPrimitive.Corner />
     </ScrollAreaPrimitive.Root>
   );
 }
apps/web/src/app/(home)/analytics/_components/live-logs.tsx (3)

53-73: Loading state conflated with empty state.

When isOpen is true and the query is still fetching, events will be undefined. The current condition !events || events.length === 0 treats both "loading" and "no data" the same way, showing the "NO_RECENT_ACTIVITY" placeholder. Users may briefly see this before data loads, which could be confusing.

Consider distinguishing between loading and empty states:

🔎 Proposed approach
+            {events === undefined ? (
+              <div className="flex items-center justify-center h-[300px] border-t border-border/10">
+                <div className="flex items-center gap-2 text-muted-foreground/60 font-mono text-xs">
+                  <span className="animate-pulse">Loading...</span>
+                </div>
+              </div>
+            ) : events.length === 0 ? (
-            {!events || events.length === 0 ? (
               <div className="flex flex-col items-center justify-center h-[300px] border-t border-border/10">
                 {/* existing empty state content */}
               </div>
+            ) : (

89-94: Animation delay scales linearly with event count.

The stagger delay index * 0.05 means the 100th event takes ~5 seconds to fully animate in. For a 30-minute window, this could involve many events. Consider capping the delay:

🔎 Proposed fix
                           initial={{ opacity: 0, x: -5 }}
                           animate={{ opacity: 1, x: 0 }}
-                          transition={{ duration: 0.2, delay: index * 0.05 }}
+                          transition={{ duration: 0.2, delay: Math.min(index * 0.05, 0.5) }}

78-86: Minor: Unused destructured variable.

_creationTime is destructured on line 86 but never used—the time calculation on line 79 uses event._creationTime directly. This is just cleanup:

🔎 Proposed fix
-                        const { _id, _creationTime, ...logData } = event;
+                        const { _id, ...logData } = event;
packages/backend/convex/analytics.ts (2)

242-267: Missing explicit returns schema.

Based on project learnings, Convex functions should use the new function syntax with explicit args, returns, and handler properties. The returns validator was removed from getAllEvents. Consider adding it back for type safety and documentation:

🔎 Proposed addition
 export const getAllEvents = query({
   args: {
     range: v.union(v.literal("30d"), v.literal("7d"), v.literal("1d"), v.literal("30m")),
   },
+  returns: v.array(
+    v.object({
+      _id: v.id("analyticsEvents"),
+      _creationTime: v.number(),
+      database: v.optional(v.string()),
+      orm: v.optional(v.string()),
+      backend: v.optional(v.string()),
+      runtime: v.optional(v.string()),
+      frontend: v.optional(v.array(v.string())),
+      addons: v.optional(v.array(v.string())),
+      examples: v.optional(v.array(v.string())),
+      auth: v.optional(v.string()),
+      payments: v.optional(v.string()),
+      git: v.optional(v.boolean()),
+      packageManager: v.optional(v.string()),
+      install: v.optional(v.boolean()),
+      dbSetup: v.optional(v.string()),
+      api: v.optional(v.string()),
+      webDeploy: v.optional(v.string()),
+      serverDeploy: v.optional(v.string()),
+      cli_version: v.optional(v.string()),
+      node_version: v.optional(v.string()),
+      platform: v.optional(v.string()),
+    }),
+  ),
   handler: async (ctx, args) => {

Based on learnings, Convex functions should always use explicit args, returns, and handler properties.


248-258: Consider a lookup object for range-to-cutoff mapping.

The if/else chain works but could be simplified:

🔎 Proposed refactor
   handler: async (ctx, args) => {
     const now = Date.now();
-    let cutoff: number;
-
-    if (args.range === "30d") {
-      cutoff = now - 30 * 24 * 60 * 60 * 1000;
-    } else if (args.range === "7d") {
-      cutoff = now - 7 * 24 * 60 * 60 * 1000;
-    } else if (args.range === "1d") {
-      cutoff = now - 24 * 60 * 60 * 1000;
-    } else {
-      cutoff = now - 30 * 60 * 1000; // 30 mins
-    }
+    const rangeMs: Record<string, number> = {
+      "30d": 30 * 24 * 60 * 60 * 1000,
+      "7d": 7 * 24 * 60 * 60 * 1000,
+      "1d": 24 * 60 * 60 * 1000,
+      "30m": 30 * 60 * 1000,
+    };
+    const cutoff = now - rangeMs[args.range];
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7019c65 and f589e15.

📒 Files selected for processing (5)
  • apps/web/src/app/(home)/analytics/_components/analytics-header.tsx
  • apps/web/src/app/(home)/analytics/_components/analytics-page.tsx
  • apps/web/src/app/(home)/analytics/_components/live-logs.tsx
  • apps/web/src/components/ui/scroll-area.tsx
  • packages/backend/convex/analytics.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • apps/web/src/app/(home)/analytics/_components/analytics-page.tsx
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{js,jsx,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/better-t-stack-repo.mdc)

Define functions using the standard function declaration syntax, not arrow functions

Files:

  • apps/web/src/components/ui/scroll-area.tsx
  • packages/backend/convex/analytics.ts
  • apps/web/src/app/(home)/analytics/_components/analytics-header.tsx
  • apps/web/src/app/(home)/analytics/_components/live-logs.tsx
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/better-t-stack-repo.mdc)

**/*.{ts,tsx}: Use TypeScript type aliases instead of interface declarations
Do not use explicit return types

Files:

  • apps/web/src/components/ui/scroll-area.tsx
  • packages/backend/convex/analytics.ts
  • apps/web/src/app/(home)/analytics/_components/analytics-header.tsx
  • apps/web/src/app/(home)/analytics/_components/live-logs.tsx
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

**/*.{ts,tsx,js,jsx}: Use bun <file> instead of node <file> or ts-node <file> for running TypeScript/JavaScript files
Bun automatically loads .env files, so don't use the dotenv package
Use Bun.serve() which supports WebSockets, HTTPS, and routes instead of express
Use bun:sqlite module for SQLite instead of better-sqlite3
Use Bun.redis for Redis instead of ioredis
Use Bun.sql for Postgres instead of pg or postgres.js
Use built-in WebSocket instead of the ws package
Prefer Bun.file over node:fs readFile/writeFile methods
Use Bun.$ template literal syntax instead of execa for shell command execution
Import .css files directly in TypeScript/JavaScript files; Bun's CSS bundler will handle bundling
Run server with bun --hot <file> to enable hot reloading during development

Files:

  • apps/web/src/components/ui/scroll-area.tsx
  • packages/backend/convex/analytics.ts
  • apps/web/src/app/(home)/analytics/_components/analytics-header.tsx
  • apps/web/src/app/(home)/analytics/_components/live-logs.tsx
**/*.{ts,tsx,js,jsx,css}

📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

Use bun build <file> instead of webpack or esbuild for bundling TypeScript, JavaScript, and CSS files

Files:

  • apps/web/src/components/ui/scroll-area.tsx
  • packages/backend/convex/analytics.ts
  • apps/web/src/app/(home)/analytics/_components/analytics-header.tsx
  • apps/web/src/app/(home)/analytics/_components/live-logs.tsx
**/*.{html,tsx,ts,jsx,js}

📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)

Use HTML imports with Bun.serve() for frontend instead of Vite

Files:

  • apps/web/src/components/ui/scroll-area.tsx
  • packages/backend/convex/analytics.ts
  • apps/web/src/app/(home)/analytics/_components/analytics-header.tsx
  • apps/web/src/app/(home)/analytics/_components/live-logs.tsx
🧠 Learnings (1)
📚 Learning: 2025-12-03T07:48:14.714Z
Learnt from: CR
Repo: AmanVarshney01/create-better-t-stack PR: 0
File: .cursor/rules/convex_rules.mdc:0-0
Timestamp: 2025-12-03T07:48:14.714Z
Learning: Applies to convex/**/*.ts : ALWAYS use the new function syntax for Convex functions with explicit args, returns, and handler properties

Applied to files:

  • packages/backend/convex/analytics.ts
🧬 Code graph analysis (1)
apps/web/src/app/(home)/analytics/_components/live-logs.tsx (3)
apps/web/src/components/ui/button.tsx (1)
  • Button (56-56)
apps/web/src/lib/utils.ts (1)
  • cn (4-6)
apps/web/src/components/ui/scroll-area.tsx (1)
  • ScrollArea (52-52)
🔇 Additional comments (1)
apps/web/src/app/(home)/analytics/_components/analytics-header.tsx (1)

5-20: LGTM! Clean implementation with good defensive handling for lastUpdated.

The component properly guards against null lastUpdated with a conditional check on line 17-19. The inline type definition follows the project's guidelines for type aliases. The restructured UI with the terminal-style aesthetic is well-organized.

One minor consideration: if legacy.lastUpdatedIso could ever be an invalid date string, the format() call on line 20 would produce unexpected results. If the data source is trusted, this is fine as-is.

Comment thread packages/backend/convex/analytics.ts Outdated
Comment on lines +260 to +264
const events = await ctx.db
.query("analyticsEvents")
.order("desc")
.filter((q) => q.gte(q.field("_creationTime"), cutoff))
.collect();

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.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

find . -name "schema.ts" -o -name "schema.js" | head -20

Repository: AmanVarshney01/create-better-t-stack

Length of output: 115


🏁 Script executed:

# Find convex directory and list structure
fd -t f "convex" -x ls -la {} \; 2>/dev/null | head -30

Repository: AmanVarshney01/create-better-t-stack

Length of output: 412


🏁 Script executed:

# Look for schema files in convex directory
find . -path "*/convex/*" -name "*.ts" | grep -i schema

Repository: AmanVarshney01/create-better-t-stack

Length of output: 115


🏁 Script executed:

cat ./packages/backend/convex/schema.ts

Repository: AmanVarshney01/create-better-t-stack

Length of output: 2479


🏁 Script executed:

cat -n ./packages/backend/convex/analytics.ts | sed -n '250,275p'

Repository: AmanVarshney01/create-better-t-stack

Length of output: 907


Use index instead of filter for time-range queries on analyticsEvents.

The analyticsEvents table lacks an index on _creationTime. Using .filter() applies filtering after fetching documents, causing a full table scan. Define an index on _creationTime in the schema and use .withIndex("by_creationTime", ["_creationTime"]) instead of .filter():

const events = await ctx.db
  .query("analyticsEvents")
  .withIndex("by_creationTime", (q) => q.gte("_creationTime", cutoff))
  .order("desc")
  .collect();

Then add to schema:

analyticsEvents: defineTable({
  // existing fields...
}).index("by_creationTime", ["_creationTime"]),

This branch was successfully deployed

1 active deployment
Preview — 643b3413 Deployed Jan 4, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant