Skip to content

feat: integrate website-hook-sdk with auto-screenshot capture component#9

Merged
prdai merged 21 commits intomainfrom
CROW-106-client-side-website-hook-sdk-integration-with-html-2-canvas
Dec 24, 2025
Merged

feat: integrate website-hook-sdk with auto-screenshot capture component#9
prdai merged 21 commits intomainfrom
CROW-106-client-side-website-hook-sdk-integration-with-html-2-canvas

Conversation

@Methika1234
Copy link
Copy Markdown
Contributor

@Methika1234 Methika1234 commented Dec 2, 2025

  • Link to local website-hook-sdk package for development
  • Add AutoScreenshotCapture component to root layout
  • Enable automatic screenshot capture functionality

Summary by CodeRabbit

  • New Features

    • Background interaction tracking is now active across the app, capturing pointer interactions and periodic screenshots with detailed logging; runs silently with no visible UI changes.
  • Chores

    • Switched local development and build tooling commands and updated container build flow to use the project's chosen package manager.
    • Removed an experimental server minification setting from configuration.

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

@cloudflare-workers-and-pages
Copy link
Copy Markdown
Contributor

cloudflare-workers-and-pages bot commented Dec 2, 2025

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
crow-rogue-store-dev bb8e322 Commit Preview URL

Branch Preview URL
Dec 24 2025, 01:45 PM

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Dec 2, 2025

Warning

Rate limit exceeded

@prdai has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 1 minutes and 5 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between d0c4150 and bb8e322.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • .github/workflows/playwright.yml
  • package.json
📝 Walkthrough

Walkthrough

Adds a client-side InteractionTracker component and mounts it in the RootLayout; updates package manager usage (Bun → pnpm) across Dockerfile, scripts, and docs; bumps @b3-crow/website-hook-sdk version and removes an experimental Next.js flag.

Changes

Cohort / File(s) Summary
Layout integration
app/layout.tsx
Imported and rendered <InteractionTracker /> inside RootLayout, placed after WebVitals.
Interaction tracking component
components/interaction-tracker.tsx
New client component ("use client") that calls initInteractionTracking from @b3-crow/website-hook-sdk in useEffect with logging enabled; component returns null.
Package scripts & deps
package.json
Changed dev script from next dev --turbopacknext dev; @b3-crow/website-hook-sdk bumped from ^0.0.90.0.16 (caret removed); lighthouse script updated to use pnpm exec.
Docker / CI infra
Dockerfile
Replaced Bun-based images/commands with Node 20 Alpine and pnpm flows; added Corepack enablement, user/group setup, adjusted copy/chown and startup command to node server.js.
Next/Playwright/Wrangler configs
next.config.ts, playwright.config.ts, wrangler.jsonc
Removed experimental.serverMinification from Next config; Playwright webServer command changed bun run devpnpm run dev; Wrangler build command changed to pnpm run build:cloudflare and kv_namespaces formatting adjusted.
Docs
README.md
Replaced Bun command references with pnpm equivalents across setup, dev, test, and deployment instructions.

Sequence Diagram(s)

(omitted — changes are small/single-component init and infra/tooling updates)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

area: infra, status: review

"I hopped into code with whiskers twitching bright,
I tracked every click through the quiet night.
A bump of a version, a pnpm cheer,
Containers snug, the launch draws near.
— 🐇"

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ 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 'feat: integrate website-hook-sdk with auto-screenshot capture component' accurately describes the main change: integrating the website-hook-sdk and adding the InteractionTracker component for screenshot capture.

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.

@Methika1234 Methika1234 marked this pull request as ready for review December 22, 2025 05:52
Copy link
Copy Markdown
Contributor

@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: 3

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 16d1b57 and 2ea377c.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (3)
  • app/layout.tsx
  • components/interaction-tracker.tsx
  • package.json
🧰 Additional context used
🧬 Code graph analysis (1)
app/layout.tsx (1)
components/interaction-tracker.tsx (1)
  • InteractionTracker (7-17)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Workers Builds: rouge-store
🔇 Additional comments (2)
app/layout.tsx (1)

8-8: LGTM! Site-wide interaction tracking integration.

The InteractionTracker component is properly imported and rendered in the root layout, ensuring interaction tracking is active across all pages. The placement at the end of the body is appropriate for tracking components that don't render visible UI.

Also applies to: 39-39

components/interaction-tracker.tsx (1)

8-14: Add error handling for SDK initialization.

The initInteractionTracking call lacks error handling, which could cause uncaught exceptions if initialization fails. Wrap it in a try-catch block to gracefully handle potential errors:

useEffect(() => {
  // Initialize interaction tracking with simplified API
  // This starts both screenshot capture and mouse cursor tracking
-  initInteractionTracking({
-    logging: true, // Enable detailed pointer tracking logs
-  });
+  try {
+    initInteractionTracking({
+      logging: true, // Enable detailed pointer tracking logs
+    });
+  } catch (error) {
+    console.error("Failed to initialize interaction tracking:", error);
+  }
}, []);

Additionally, verify whether the initInteractionTracking function from the SDK returns a cleanup function. If it does (e.g., for unsubscribing from event listeners or stopping background tasks), return that function from the useEffect to prevent memory leaks on component unmount.

package.json Outdated
},
"dependencies": {
"@b3-crow/website-hook-sdk": "^0.0.9",
"@b3-crow/website-hook-sdk": "file:../website-hook-sdk",
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

TODO: update after the website hook sdk is published

- Link to local website-hook-sdk package for development
- Add AutoScreenshotCapture component to root layout
- Enable automatic screenshot capture functionality
Removed explicit configuration parameters from the component and moved them to the SDK's internal configuration. This simplifies the integration and centralizes configuration management.
…esting

Updated pointer tracking configuration to batch coordinates every 1 second with a max buffer of 1000 coordinates, optimized for remote D1 database storage.
…nent

Replace the AutoScreenshotCapture component with a new InteractionTracker component to consolidate interaction tracking functionality.
Replace initAutoCapture with new simplified initInteractionTracking API, removing verbose configuration and documentation as SDK now handles defaults internally.
Added inline comments to clarify that InteractionTracker initializes both screenshot capture and mouse cursor tracking functionality.
@Methika1234 Methika1234 force-pushed the CROW-106-client-side-website-hook-sdk-integration-with-html-2-canvas branch from 2ea377c to 120033e Compare December 22, 2025 14:28
Copy link
Copy Markdown
Contributor

@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: 1

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 120033e and 4c811e6.

⛔ Files ignored due to path filters (1)
  • bun.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • components/interaction-tracker.tsx
  • package.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • components/interaction-tracker.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Workers Builds: crow-rogue-store-dev

- Add transpilePackages for @b3-crow/website-hook-sdk and its dependencies
- Configure webpack for proper ESM module resolution
- Remove turbopack flag from dev script for compatibility
Copy link
Copy Markdown
Contributor

@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

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4c811e6 and c18cf6a.

📒 Files selected for processing (2)
  • next.config.ts
  • package.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • package.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Workers Builds: crow-rogue-store-dev
🔇 Additional comments (2)
next.config.ts (2)

31-36: Verify the fullySpecified: false workaround is necessary.

Disabling fullySpecified for ESM packages is a common workaround, but may not be needed with proper transpilePackages and extensionAlias configuration. This setting allows imports without file extensions, which can mask underlying module resolution issues.

Try removing this rule after fixing the extensionAlias merge issue to see if the build still works correctly. If specific import errors occur, they can guide more targeted fixes.


14-18: Verify the necessity of esmExternals: "loose" setting.

Setting esmExternals to "loose" can impact bundle size and tree-shaking effectiveness. The default "auto" value typically handles ESM packages correctly in modern Next.js versions. Confirm whether this override is required for this project's dependencies.

@Methika1234 Methika1234 requested a review from prdai December 23, 2025 18:49
@prdai prdai merged commit 3c8cad3 into main Dec 24, 2025
4 checks passed
@prdai prdai deleted the CROW-106-client-side-website-hook-sdk-integration-with-html-2-canvas branch December 24, 2025 13:46
prdai added a commit that referenced this pull request Mar 16, 2026
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