Skip to content

Dashboard & Landing page updates#203

Merged
izadoesdev merged 0 commit intomainfrom
dev
Dec 3, 2025
Merged

Dashboard & Landing page updates#203
izadoesdev merged 0 commit intomainfrom
dev

Conversation

@ameer2468
Copy link
Contributor

@ameer2468 ameer2468 commented Nov 28, 2025

This PR: Introduces visual fixes, visual improvements, color improvements, and more to the dashboard. Landing page now has a bento box section.

@vercel
Copy link

vercel bot commented Nov 28, 2025

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

Project Deployment Preview Comments Updated (UTC)
dashboard Ready Ready Preview Comment Nov 30, 2025 2:33pm
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
documentation Skipped Skipped Nov 30, 2025 2:33pm

@graphite-app
Copy link
Contributor

graphite-app bot commented Nov 28, 2025

How to use the Graphite Merge Queue

Add the label Main to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 28, 2025

Important

Review skipped

More than 25% of the files skipped due to max files limit. The review is being skipped to prevent a low-quality review.

54 files out of 161 files are above the max files limit of 100. Please upgrade to Pro plan to get higher limits.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dev

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.

Copy link

@vercel vercel bot left a comment

Choose a reason for hiding this comment

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

Additional Suggestion:

Hardcoded database credentials have been committed to source code, which is a critical security vulnerability. The database URL should use the DATABASE_URL environment variable instead.

View Details
📝 Patch Details
diff --git a/packages/db/src/client.ts b/packages/db/src/client.ts
index ab849d54..c9fcdc40 100644
--- a/packages/db/src/client.ts
+++ b/packages/db/src/client.ts
@@ -6,7 +6,7 @@ import * as schema from "./drizzle/schema";
 
 const fullSchema = { ...schema, ...relations };
 
-const databaseUrl = "postgres://databuddy:databuddy_dev_password@localhost:5432/databuddy";
+const databaseUrl = process.env.DATABASE_URL as string;
 
 if (!databaseUrl) {
 	throw new Error("DATABASE_URL is not set");

Analysis

Hardcoded database credentials expose plaintext password in source code

What fails: packages/db/src/client.ts line 9 contains a hardcoded database URL with plaintext credentials (postgres://databuddy:databuddy_dev_password@localhost:5432/databuddy), compromising security of the database connection.

How to reproduce:

# Check the current state of the file
cat packages/db/src/client.ts | grep -A1 "const databaseUrl"
# Will show: const databaseUrl = "postgres://databuddy:databuddy_dev_password@localhost:5432/databuddy";

# Verify credentials are in Git history
git log -p packages/db/src/client.ts | grep -A2 "const databaseUrl"

What happened vs expected behavior:

  • Current (broken): Credentials hardcoded in source code - const databaseUrl = "postgres://databuddy:databuddy_dev_password@localhost:5432/databuddy";
  • Expected: Load from environment variable - const databaseUrl = process.env.DATABASE_URL as string;

The environment variable validation check on lines 11-13 (if (!databaseUrl) throw new Error(...)) becomes ineffective since the hardcoded string is always truthy, preventing proper error detection if DATABASE_URL is not set.

Security impact:

  • Credentials visible in repository and Git history to anyone with code access
  • Development credentials hardcoded instead of using environment-specific configuration
  • Database vulnerable to unauthorized access from code visibility

The environment variable pattern is correctly used elsewhere in the codebase (e.g., drizzle.config.ts uses process.env.DATABASE_URL) and was the previous working implementation per commit 12b191bf.

@ameer2468 ameer2468 marked this pull request as draft November 29, 2025 11:19
@vercel vercel bot temporarily deployed to Preview – documentation November 29, 2025 21:57 Inactive
@vercel vercel bot temporarily deployed to Preview – documentation November 30, 2025 09:51 Inactive
@vercel vercel bot temporarily deployed to Preview – documentation November 30, 2025 13:58 Inactive
@vercel vercel bot temporarily deployed to Preview – documentation November 30, 2025 14:15 Inactive
@ameer2468 ameer2468 marked this pull request as ready for review November 30, 2025 14:17
@vercel vercel bot temporarily deployed to Preview – documentation November 30, 2025 14:17 Inactive
{!isAssistantPage && (
<div
className="fixed top-12 right-0 left-0 z-50 shrink-0 space-y-0 bg-background md:top-0 md:left-76 lg:left-84"
className="sticky top-0 right-0 left-0 z-50 shrink-0 space-y-0 bg-background md:top-0 md:left-84"
Copy link

Choose a reason for hiding this comment

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

The analytics toolbar positioning was changed from fixed to sticky, which breaks toolbar visibility when scrolling page content because the sticky element is not inside the scrolling container.

View Details
📝 Patch Details
diff --git a/apps/dashboard/app/(main)/websites/[id]/layout.tsx b/apps/dashboard/app/(main)/websites/[id]/layout.tsx
index b10d471e..857fce07 100644
--- a/apps/dashboard/app/(main)/websites/[id]/layout.tsx
+++ b/apps/dashboard/app/(main)/websites/[id]/layout.tsx
@@ -3,7 +3,6 @@
 import { useQueryClient } from "@tanstack/react-query";
 import { useAtom } from "jotai";
 import { useParams, usePathname } from "next/navigation";
-import { useLayoutEffect, useRef, useState } from "react";
 import { toast } from "sonner";
 import NotFound from "@/app/not-found";
 import { useTrackingSetup } from "@/hooks/use-tracking-setup";
@@ -25,8 +24,6 @@ export default function WebsiteLayout({ children }: WebsiteLayoutProps) {
 	);
 	const { isLoading: isWebsiteLoading } = useWebsite(id as string);
 	const [isRefreshing, setIsRefreshing] = useAtom(isAnalyticsRefreshingAtom);
-	const toolbarRef = useRef<HTMLDivElement>(null);
-	const [toolbarHeight, setToolbarHeight] = useState(88);
 
 	const isAssistantPage =
 		pathname.includes("/assistant") ||
@@ -36,28 +33,6 @@ export default function WebsiteLayout({ children }: WebsiteLayoutProps) {
 		pathname.includes("/settings") ||
 		pathname.includes("/users");
 
-	useLayoutEffect(() => {
-		const element = toolbarRef.current;
-		if (!element || isAssistantPage) {
-			setToolbarHeight(0);
-			return;
-		}
-
-		const updateHeight = () => {
-			const height = element.getBoundingClientRect().height;
-			setToolbarHeight(height);
-		};
-
-		updateHeight();
-
-		const resizeObserver = new ResizeObserver(updateHeight);
-		resizeObserver.observe(element);
-
-		return () => {
-			resizeObserver.disconnect();
-		};
-	}, [isAssistantPage]);
-
 	if (!id) {
 		return <NotFound />;
 	}
@@ -91,10 +66,7 @@ export default function WebsiteLayout({ children }: WebsiteLayoutProps) {
 	return (
 		<div className="flex h-full flex-col overflow-hidden">
 			{!isAssistantPage && (
-				<div
-					className="sticky top-0 right-0 left-0 z-50 shrink-0 space-y-0 bg-background md:top-0 md:left-84"
-					ref={toolbarRef}
-				>
+				<div className="fixed top-12 right-0 left-0 z-50 shrink-0 space-y-0 bg-background md:top-0 md:left-84">
 					<AnalyticsToolbar
 						isDisabled={isToolbarDisabled}
 						isLoading={isToolbarLoading}
@@ -107,7 +79,7 @@ export default function WebsiteLayout({ children }: WebsiteLayoutProps) {
 			)}
 
 			<div
-				className={`${isAssistantPage ? "min-h-0 flex-1" : "min-h-0 flex-1 overflow-y-auto"}`}
+				className={`${isAssistantPage ? "min-h-0 flex-1" : "min-h-0 flex-1 overflow-y-auto pt-[88px]"}`}
 			>
 				{children}
 			</div>

Analysis

Analytics toolbar disappears when page scrolls due to incorrect sticky positioning

What fails: WebsiteLayout component in apps/dashboard/app/(main)/websites/[id]/layout.tsx line 68. Toolbar with position: sticky; top-0 scrolls off-screen when page content exceeds viewport height.

How to reproduce:

  1. Navigate to an analytics page (e.g., /websites/[id]) with sufficient content to cause page scrolling
  2. Scroll the page vertically downward
  3. Observe: toolbar scrolls away instead of remaining fixed to the top

Result: Toolbar becomes invisible, users lose access to refresh button and analytics filters.

Expected: Toolbar remains fixed at the top of the viewport while page scrolls.

Root cause: Sticky positioning anchors to the nearest ancestor with a scrolling mechanism. Per MDN, overflow: hidden creates a scrolling context. The parent WebsiteLayout has overflow-hidden, so sticky elements anchor there instead of the viewport. When the outer MainLayout container scrolls (which happens due to h-screen overflow-y-auto pt-16 causing content to exceed viewport), the WebsiteLayout moves with it, making the sticky toolbar disappear.

Additionally, toolbarHeight state was computed via ResizeObserver but never used, indicating incomplete refactoring from the previous fixed implementation.

Fix:

  • Changed toolbar from position: sticky back to position: fixed with top-12 (mobile) / top-0 md:left-84 (desktop)
  • Added pt-[88px] padding to content div to prevent content from rendering under the fixed toolbar
  • Removed unused toolbarHeight state, ResizeObserver, and related imports (useLayoutEffect, useRef, useState)

@izadoesdev izadoesdev merged commit 6bfdfa1 into main Dec 3, 2025
10 checks 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.

2 participants