[PULSE-4] Goals & Events dashboard block and settings UI #5

Merged
uz1mani merged 8 commits from staging into main 2026-02-04 15:04:10 +00:00
7 changed files with 379 additions and 2 deletions
Showing only changes of commit 11802cb558 - Show all commits

View File

@@ -1,6 +1,8 @@
'use client'
greptile-apps[bot] commented 2026-02-04 14:34:49 +00:00 (Migrated from github.com)
Review

displays transformed event_name instead of goal's display name. The API returns GoalCountStat with only event_name and count, but goals have a separate name field (display name). Users define goals with friendly names like "User Signups" for event "signup_click", but this shows "signup click" (transformed event name).

Verify if the backend should return goal names with the counts, or if showing transformed event names is intentional.

Prompt To Fix With AI
This is a comment left during a code review.
Path: components/dashboard/GoalStats.tsx
Line: 36:36

Comment:
displays transformed `event_name` instead of goal's display name. The API returns `GoalCountStat` with only `event_name` and `count`, but goals have a separate `name` field (display name). Users define goals with friendly names like "User Signups" for event "signup_click", but this shows "signup click" (transformed event name).

Verify if the backend should return goal names with the counts, or if showing transformed event names is intentional.

How can I resolve this? If you propose a fix, please make it concise.
displays transformed `event_name` instead of goal's display name. The API returns `GoalCountStat` with only `event_name` and `count`, but goals have a separate `name` field (display name). Users define goals with friendly names like "User Signups" for event "signup_click", but this shows "signup click" (transformed event name). Verify if the backend should return goal names with the counts, or if showing transformed event names is intentional. <details><summary>Prompt To Fix With AI</summary> `````markdown This is a comment left during a code review. Path: components/dashboard/GoalStats.tsx Line: 36:36 Comment: displays transformed `event_name` instead of goal's display name. The API returns `GoalCountStat` with only `event_name` and `count`, but goals have a separate `name` field (display name). Users define goals with friendly names like "User Signups" for event "signup_click", but this shows "signup click" (transformed event name). Verify if the backend should return goal names with the counts, or if showing transformed event names is intentional. How can I resolve this? If you propose a fix, please make it concise. ````` </details>
greptile-apps[bot] commented 2026-02-04 14:46:23 +00:00 (Migrated from github.com)
Review

siteId and dateRange props are unused - can remove from interface and component

Prompt To Fix With AI
This is a comment left during a code review.
Path: components/dashboard/GoalStats.tsx
Line: 10:11

Comment:
`siteId` and `dateRange` props are unused - can remove from interface and component

How can I resolve this? If you propose a fix, please make it concise.
`siteId` and `dateRange` props are unused - can remove from interface and component <details><summary>Prompt To Fix With AI</summary> `````markdown This is a comment left during a code review. Path: components/dashboard/GoalStats.tsx Line: 10:11 Comment: `siteId` and `dateRange` props are unused - can remove from interface and component How can I resolve this? If you propose a fix, please make it concise. ````` </details>
import Link from 'next/link'
import { formatNumber } from '@/lib/utils/format'
import { BookOpenIcon, ArrowRightIcon } from '@ciphera-net/ui'
import type { GoalCountStat } from '@/lib/api/stats'
interface GoalStatsProps {
@@ -39,10 +41,25 @@ export default function GoalStats({ goalCounts, siteId, dateRange }: GoalStatsPr
</div>
))
) : (
<div className="h-full flex flex-col items-center justify-center text-center px-4">
<p className="text-neutral-500 dark:text-neutral-400 text-sm">
No custom events in this period. Track goals with <code className="px-1.5 py-0.5 rounded bg-neutral-200 dark:bg-neutral-700 text-xs">pulse.track(&apos;event_name&apos;)</code> in your snippet.
</p>
<div className="h-full flex flex-col items-center justify-center text-center px-6 py-8">
<div className="max-w-sm w-full rounded-xl border-2 border-dashed border-neutral-200 dark:border-neutral-700 p-8 flex flex-col items-center gap-4">
<div className="rounded-full bg-neutral-100 dark:bg-neutral-800 p-4">
<BookOpenIcon className="w-8 h-8 text-neutral-500 dark:text-neutral-400" />
</div>
<h4 className="font-semibold text-neutral-900 dark:text-white">
Need help tracking goals?
</h4>
<p className="text-sm text-neutral-500 dark:text-neutral-400">
Add <code className="px-1.5 py-0.5 rounded bg-neutral-200 dark:bg-neutral-700 text-xs font-mono">pulse.track(&apos;event_name&apos;)</code> where actions happen on your site, then see counts here. Check our guide for step-by-step instructions.
</p>
<Link
href="/installation"
className="inline-flex items-center gap-1.5 text-sm font-medium text-brand-orange hover:text-brand-orange/90 hover:underline focus:outline-none focus:ring-2 focus:ring-brand-orange/20 rounded"
>
Read documentation
<ArrowRightIcon className="w-4 h-4" />
</Link>
</div>
</div>
)}
</div>