Skip to content

Conversation

@bolty-from-atl-bitlab
Copy link
Contributor

@bolty-from-atl-bitlab bolty-from-atl-bitlab bot commented Feb 9, 2026

Summary

Refactors the TransactionTable component to separate demo data from the component itself.

Changes

  • Export Transaction interface for external use
  • Add showDemoData prop to explicitly control demo data visibility
  • Move demo transactions to TransactionTable.data.ts
  • Add Storybook stories with multiple variants:
    • WithDemoData - shows demo data
    • Empty - shows empty state
    • WithCustomData - custom transactions passed as props
    • WithFilters - demo data with filter options populated
    • Playground - interactive with all controls

Behavior Change

  • Before: Component showed demo data when no transactions provided
  • After: Component shows empty table by default; set showDemoData={true} for demos/Storybook

Testing

  • Storybook: npm run storybook → Components/TransactionTable
  • Unit tests: Existing tests should pass

Resolves ATL-64

Summary by CodeRabbit

  • New Features

    • TransactionTable component now supports a showDemoData prop to display demo transaction data. Transaction interface extended with optional fields for enhanced functionality.
  • Tests

    • Added Storybook stories for TransactionTable with five predefined scenarios: demo data view, empty state, custom data, filtered view, and interactive playground.
  • Chores

    • Updated ESLint configuration for improved Storybook compatibility.

- Export Transaction interface for reusability
- Add showDemoData prop to control demo data visibility
- Move hardcoded demo transactions to TransactionTable.data.ts
- Add Storybook stories with multiple variants
- Default behavior: empty table unless showDemoData=true or transactions provided

Resolves ATL-64
@vercel
Copy link

vercel bot commented Feb 9, 2026

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

Project Deployment Actions Updated (UTC)
aurora Ready Ready Preview, Comment Feb 9, 2026 3:53pm

Request Review

The rule incorrectly flags the transitive @storybook/react dependency
even though we correctly use @storybook/nextjs-vite framework package.
@sbddesign
Copy link
Contributor

@CodeRabbit review

@coderabbitai
Copy link

coderabbitai bot commented Feb 10, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai
Copy link

coderabbitai bot commented Feb 10, 2026

📝 Walkthrough

Walkthrough

Introduces demo transaction data, a Storybook stories file, and updates TransactionTable to support an optional showDemoData prop and expanded Transaction type. Removes in-file defaults, selecting between provided transactions, demo data, or empty list. Adjusts ESLint config to refine rule ordering and disable a Storybook rule.

Changes

Cohort / File(s) Summary
TransactionTable Module
app/components/TransactionTable.tsx, app/components/TransactionTable.data.ts, app/components/TransactionTable.stories.tsx
Adds demo data export and Storybook stories; extends Transaction interface; introduces showDemoData prop; replaces inline defaults with selection logic using provided data or demo data; updates imports and story args.
Tooling / ESLint
eslint.config.mjs
Refactors flat config into sequential array entries; retains Storybook recommended config; adds override to disable storybook/no-renderer-packages; adjusts rule precedence.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

I thump my paws: new tables gleam,
Demo crumbs for every theme!
Stories hop with prisms bright,
Props expand in moonlit night.
Lint winds calm, no scolding breeze—
Data dances, bugs at ease.
Carrot-approved, ship it please! 🥕✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: extracting demo data to a separate file (TransactionTable.data.ts), which is the primary refactoring described across the modified files.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 bolty/atl-64-transactions-table-demo-data

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

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

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

⚠️ Outside diff range comments (1)
app/components/TransactionTable.tsx (1)

140-149: ⚠️ Potential issue | 🟡 Minor

Guard pagination when there are zero transactions.

With the new empty-by-default behavior, totalPages becomes 0 and the “Next” button remains enabled, allowing currentPage to drop to 0. Clamp the total page count to keep pagination stable.

🛠️ Suggested change
-  const totalPages = Math.ceil(totalTransactions / rowsPerPage);
+  const totalPages = Math.max(1, Math.ceil(totalTransactions / rowsPerPage));
🤖 Fix all issues with AI agents
In `@app/components/TransactionTable.data.ts`:
- Around line 45-50: The demo data contains a real-looking email in the
transaction object (the account field in the record with date '06/2024');
replace that value with a non-identifying placeholder (e.g., "user@example.com"
or "placeholder@example.com") so no PII is checked into the repo and update any
other similar account fields in TransactionTable.data.ts to use the same
placeholder convention.
- Around line 6-33: The demoTransactions array is missing prismId and accountId
fields used by the filtering logic; update each object in the exported
demoTransactions (and ensure it matches the Transaction type) to include prismId
and accountId values that correspond to actual prism/contact IDs used by the
filters so demo rows are returned when a prism or account is selected (e.g., add
prismId: 'bitcoin-pizza' / accountId: 'jamie-smith' or whatever canonical IDs
your filters expect for the three entries).
🧹 Nitpick comments (1)
eslint.config.mjs (1)

15-35: Scope the Storybook renderer override to Storybook files only.

Disabling storybook/no-renderer-packages globally can mask accidental renderer imports in app code. Limit the override to Storybook-related files via a files matcher in the flat config.

♻️ Suggested change
-  {
-    // Disable no-renderer-packages rule - we correctly use `@storybook/nextjs-vite`
-    // but the rule incorrectly flags transitive `@storybook/react` dependency
-    rules: {
-      "storybook/no-renderer-packages": "off",
-    },
-  },
+  {
+    // Disable no-renderer-packages rule only for Storybook files
+    files: ["**/*.stories.@(js|jsx|ts|tsx|mdx)", ".storybook/**/*"],
+    rules: {
+      "storybook/no-renderer-packages": "off",
+    },
+  },

Comment on lines +6 to +33
export const demoTransactions: Transaction[] = [
{
id: '1',
date: '06/2025',
prism: 'bitcoin Pizza',
amount: '$1,250.00',
status: 'Successful',
account: 'Jamie Smith',
isFavorite: false,
},
{
id: '2',
date: '07/2025',
prism: 'Crypto Feast',
amount: '$500.00',
status: 'Pending',
account: 'Alex Johnson',
isFavorite: false,
},
{
id: '3',
date: '09/2025',
prism: 'Tech Summit',
amount: '225078764578.00 sats',
status: 'Successful',
account: 'QHFI8WE8DYHWEBJhbsbdcus...',
isFavorite: true,
},
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Add prismId/accountId to demo rows used by filters.

Filters match on prismId/accountId; without them, selecting a prism/contact filters out all demo rows. Add matching IDs for the demo entries so filters remain meaningful.

🛠️ Suggested change (sample)
   {
     id: '1',
     date: '06/2025',
     prism: 'bitcoin Pizza',
+    prismId: 'prism-1',
     amount: '$1,250.00',
     status: 'Successful',
     account: 'Jamie Smith',
+    accountId: 'contact-1',
     isFavorite: false,
   },
   {
     id: '2',
     date: '07/2025',
     prism: 'Crypto Feast',
+    prismId: 'prism-2',
     amount: '$500.00',
     status: 'Pending',
     account: 'Alex Johnson',
+    accountId: 'contact-2',
     isFavorite: false,
   },
   {
     id: '3',
     date: '09/2025',
     prism: 'Tech Summit',
+    prismId: 'prism-3',
     amount: '225078764578.00 sats',
🤖 Prompt for AI Agents
In `@app/components/TransactionTable.data.ts` around lines 6 - 33, The
demoTransactions array is missing prismId and accountId fields used by the
filtering logic; update each object in the exported demoTransactions (and ensure
it matches the Transaction type) to include prismId and accountId values that
correspond to actual prism/contact IDs used by the filters so demo rows are
returned when a prism or account is selected (e.g., add prismId: 'bitcoin-pizza'
/ accountId: 'jamie-smith' or whatever canonical IDs your filters expect for the
three entries).

Comment on lines +45 to +50
date: '06/2024',
prism: 'The true man show movie...',
amount: '999999999999999 Sats',
status: 'Active',
account: 'deekshasatapathy@twelve.cash',
isFavorite: false,
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Replace real-looking email with placeholder data.

Demo data should avoid real-looking email addresses to prevent accidental PII in the repo.

🛡️ Suggested change
-    account: 'deekshasatapathy@twelve.cash',
+    account: 'deeksha.s@example.com',
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
date: '06/2024',
prism: 'The true man show movie...',
amount: '999999999999999 Sats',
status: 'Active',
account: 'deekshasatapathy@twelve.cash',
isFavorite: false,
date: '06/2024',
prism: 'The true man show movie...',
amount: '999999999999999 Sats',
status: 'Active',
account: 'deeksha.s@example.com',
isFavorite: false,
🤖 Prompt for AI Agents
In `@app/components/TransactionTable.data.ts` around lines 45 - 50, The demo data
contains a real-looking email in the transaction object (the account field in
the record with date '06/2024'); replace that value with a non-identifying
placeholder (e.g., "user@example.com" or "placeholder@example.com") so no PII is
checked into the repo and update any other similar account fields in
TransactionTable.data.ts to use the same placeholder convention.

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