Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
6cd3b20
fix: Plan name shows as undefined on upgrade page
claude Dec 23, 2025
d603236
design: Usage metrics card with all states
claude Dec 24, 2025
8e08490
docs: Add detailed Test 1 and 2 results for fine-tuning
claude Dec 24, 2025
91a6616
verify: Plausible Analytics API verified via Researcher Agent
claude Dec 24, 2025
eef2415
plan: Usage analytics feature implementation plan
claude Dec 24, 2025
1461859
test: Set up Playwright E2E testing
claude Dec 24, 2025
a34c903
perf: Add performance audit document
claude Dec 24, 2025
e6f0fff
a11y: Add accessibility audit document
claude Dec 24, 2025
00fc13e
devops: Set up CI/CD and deployment documentation
claude Dec 24, 2025
4350f87
mobile: Create React Native companion app with Expo
claude Dec 24, 2025
d52b5af
docs: Update README with comprehensive documentation
claude Dec 24, 2025
674b6b0
feat: Add last updated timestamp to billing overview
claude Dec 24, 2025
bdc648f
batch: Process task queue items
claude Dec 24, 2025
fd02ddc
docs: Add comprehensive V7.7 system test report
claude Dec 24, 2025
a9bcf72
wip(planning): checkpoint 2025-12-24 03:28
claude Dec 24, 2025
37e8496
checkpoint: Update scratchpad timestamp
claude Dec 24, 2025
6025515
fix: Resolve CI pipeline failures
claude Dec 24, 2025
192578c
docs: Document CI failure as V7.8 improvement area
claude Dec 24, 2025
6b7a615
docs: Add comprehensive V7.8 improvements specification
claude Dec 24, 2025
79ed463
docs: Complete honest test report with root causes and recommendations
claude Dec 24, 2025
3b9b2ef
checkpoint: Final session state
claude Dec 24, 2025
6ac5a2b
docs: Update scratchpad with checkpoint timestamps
claude Dec 24, 2025
5bcc383
wip(planning): checkpoint 2025-12-24 03:51
claude Dec 24, 2025
8111180
docs: Add checkpoint timestamp
claude Dec 24, 2025
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
7 changes: 7 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "next/core-web-vitals",
"rules": {
"@typescript-eslint/no-unused-vars": "warn",
"@typescript-eslint/no-explicit-any": "warn"
}
}
101 changes: 101 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: CI

on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]

jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
- run: npm ci
- run: npm run lint

test:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
- run: npm ci
- run: npm test -- --coverage
- uses: codecov/codecov-action@v3
with:
fail_ci_if_error: false

e2e:
name: E2E Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
- run: npm ci
- run: npx playwright install --with-deps
- run: npm run build
- run: npm run test:e2e
- uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-report
path: playwright-report/
retention-days: 7

build:
name: Build
runs-on: ubuntu-latest
needs: [lint, test]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
- run: npm ci
- run: npm run build
- uses: actions/upload-artifact@v4
with:
name: build
path: .next/
retention-days: 1

deploy-preview:
name: Deploy Preview
runs-on: ubuntu-latest
needs: build
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
- uses: amondnet/vercel-action@v25
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}

deploy-production:
name: Deploy Production
runs-on: ubuntu-latest
needs: [build, e2e]
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
environment: production
steps:
- uses: actions/checkout@v4
- uses: amondnet/vercel-action@v25
with:
vercel-token: ${{ secrets.VERCEL_TOKEN }}
vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}
vercel-args: "--prod"
15 changes: 15 additions & 0 deletions .log
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Execution Log

## 2024-12-23 fix: Plan name shows as undefined on upgrade page

- **Root cause:** Components passed undefined planId directly to getPlanById(), which returns undefined. This undefined value was rendered as text "undefined" in the UI when users had no subscription.
- **Solution:** Added two new helper functions:
- `getDisplayPlanName(planId)` - Returns "Free" for undefined/null/unknown planIds
- `getPlanOrDefault(planId)` - Returns Free plan object for undefined/null/unknown planIds
- Updated UpgradePage.tsx and BillingOverview.tsx to use getPlanOrDefault()
- **Files changed:**
- src/lib/plans.ts (added helper functions)
- src/components/UpgradePage.tsx (use getPlanOrDefault)
- src/components/BillingOverview.tsx (use getPlanOrDefault)
- tests/plan-display.test.ts (added verification tests)
- **Tests:** 19 passing
8 changes: 4 additions & 4 deletions .tasks
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

## Format
# [ ] Not started
# [~] In progress
# [~] In progress
# [x] Done (YYYY-MM-DD)
# [!] Stuck - needs help
# [REVIEW] tag = Claude stops for approval

## Tasks

[ ] First feature to build
[ ] Second feature
[ ] Payment integration [REVIEW]
[x] Add aria-label to upgrade button in UpgradePage (2024-12-23)
[x] Add TypeScript strict null check to tsconfig (2024-12-23)
[x] Update package.json description (2024-12-23)
149 changes: 149 additions & 0 deletions DESIGN-SYSTEM.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
# Design System: Billing Dashboard

> Generated by Claude Code V7.7 on 2024-12-23

## Color Palette

### Semantic Tokens

```css
:root {
/* Primary */
--color-primary: #3b82f6;
--color-primary-hover: #2563eb;

/* Feedback */
--color-success: #22c55e;
--color-warning: #f59e0b;
--color-error: #ef4444;

/* Neutral */
--color-background: #ffffff;
--color-surface: #f9fafb;
--color-text: #111827;
--color-text-muted: #6b7280;
--color-border: #e5e7eb;
}

/* Dark mode */
[data-theme="dark"] {
--color-background: #111827;
--color-surface: #1f2937;
--color-text: #f9fafb;
}
```

## Typography

| Role | Font | Size | Weight |
| --------- | ----- | -------- | ------ |
| Heading 1 | Inter | 2rem | 700 |
| Heading 2 | Inter | 1.5rem | 600 |
| Body | Inter | 1rem | 400 |
| Caption | Inter | 0.875rem | 400 |

## Spacing Scale

```
4px - xs
8px - sm
12px - md
16px - lg
24px - xl
32px - 2xl
48px - 3xl
```

## Component Library

**Choice:** Custom components with Tailwind CSS

**Installed Components:**

- [x] Button
- [x] Card
- [x] BillingOverview
- [x] UpgradePage
- [x] UsageMetrics _(new)_

## Components

### UsageMetricsCard

**Purpose:** Display current usage metrics (API calls, storage, team members) with progress bars.

**File:** `src/components/UsageMetrics.tsx`

**Props:**

```typescript
interface UsageMetricsProps {
metrics: UsageMetrics | null;
planLimits: { apiCalls: number; storageUsed: number; teamMembers: number };
isLoading?: boolean;
error?: string | null;
}
```

**States:**

| State | Component | Description |
| ------- | ----------------- | ---------------------------------------------- |
| Loading | `LoadingSkeleton` | Skeleton placeholders with aria-busy |
| Empty | `EmptyState` | Guidance: "Start using the API to see metrics" |
| Error | `ErrorState` | Error message + "Try Again" button |
| Success | `SuccessState` | Three metric cards with progress bars |

**Metrics Displayed:**

- API Calls (count / limit)
- Storage (GB / limit)
- Team Members (seats / limit)

**Visual Indicators:**

- Green bar: < 80% usage
- Yellow bar: 80-99% usage
- Red bar: 100%+ usage (over limit)

**Accessibility:**

- `aria-busy="true"` on loading state
- `role="alert"` on error state
- `aria-label` on retry button
- `aria-hidden` on decorative icons

**Usage:**

```tsx
<UsageMetricsCard
metrics={usageData}
planLimits={{ apiCalls: 10000, storageUsed: 50, teamMembers: 5 }}
isLoading={isLoading}
error={error}
/>
```

---

### BillingOverview

**Purpose:** Display current plan with upgrade CTA.

**File:** `src/components/BillingOverview.tsx`

**States:** Loading, Success only (simple component)

---

### UpgradePage

**Purpose:** Show plan options and allow upgrades.

**File:** `src/components/UpgradePage.tsx`

**States:** Loading, Success

---

_Last updated: 2024-12-23_
Loading
Loading