Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: improved traffic visualization (BAL-3271) #2922

Merged
merged 9 commits into from
Jan 1, 2025
Merged

feat: improved traffic visualization (BAL-3271) #2922

merged 9 commits into from
Jan 1, 2025

Conversation

r4zendev
Copy link
Collaborator

@r4zendev r4zendev commented Dec 30, 2024

This PR improves the data visualization in the "Website Credibility" section of the merchant monitoring report.

Examples

Full HD screen view

image

Monthly visitors tooltip

image

Engagements metrics tooltip

image image

Note (Tailwind conflict)

Responsiveness is not completely preserved for smaller laptops (although the design still looks fine), because tailwind classes are being loaded twice (from ui package and backoffice apps), which makes them override each other, so basically none of the media-queries work, which makes it impossible to add responsiveness to the design using tailwind for now. The idea was to move two rightmost blocks to the bottom so that they take up 1/2 of the entire space width and let the bar chart take the entire width too, like so:
image

However, right now the design looks the same for all kinds of screens. I left code that could be uncommented when the Tailwind issue is resolved to add responsiveness and better looks for smaller screens.

To resolve the issue in question two possible solutions could be implemented:

  • add a prefix for ui tailwind classes, e.g. ui- and rewrite all of the classes in this package to use this prefix
  • use ui package from source and share base tailwind config as a preset, as described here: https://tailwindcss.com/docs/presets

Note 2 (typo)

There was a typo in the data object processed by report-adapter - montlyVisitsIndicators (note the absence of h in monthly). I left it as-is, because apparently this typo was also in the seeding scripts, so I was afraid that this can also be the data shape coming from external API. I left it in there and I need confirmation on whether this typo should be fixed.

Summary by CodeRabbit

  • New Features

    • Added Tooltip component using Radix UI library
    • Enhanced Website Credibility tab with new traffic analysis visualizations
  • Dependencies

    • Updated @ballerine/ui to version 0.5.57
    • Updated @ballerine/react-pdf-toolkit to version 1.2.57
    • Added @radix-ui/react-tooltip and recharts dependencies
  • Improvements

    • Refined traffic analysis data processing and presentation
    • Added bar and pie charts for traffic metrics
    • Updated traffic-related statistics in the Website Credibility tab

@r4zendev r4zendev self-assigned this Dec 30, 2024
Copy link

changeset-bot bot commented Dec 30, 2024

⚠️ No Changeset found

Latest commit: 7050c0a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Contributor

coderabbitai bot commented Dec 30, 2024

Walkthrough

This pull request introduces updates across multiple packages in the Ballerine ecosystem. The changes primarily focus on version increments and dependency updates, with a notable addition of a new Tooltip component in the UI package. The @ballerine/ui package has been updated to version 0.5.57, which includes new dependencies like @radix-ui/react-tooltip and recharts. The changes also modify the traffic analysis data structure in the Website Credibility component, introducing a more structured data representation and enhanced visualization capabilities.

Changes

File/Path Change Summary
apps/backoffice-v2/CHANGELOG.md Version 0.7.88 added with updates to traffic statistics and dependency updates.
apps/backoffice-v2/package.json Version bumped to 0.7.88, dependencies updated: @ballerine/react-pdf-toolkit to 1.2.57, @ballerine/ui to 0.5.57.
apps/kyb-app/CHANGELOG.md Version 0.3.103 added with updates to traffic statistics and dependency updates.
apps/kyb-app/package.json Version bumped to 0.3.103, @ballerine/ui updated to 0.5.57.
packages/react-pdf-toolkit/CHANGELOG.md Version 1.2.57 added with updates to traffic statistics and dependency updates.
packages/react-pdf-toolkit/package.json Version bumped to 1.2.57, @ballerine/ui updated to 0.5.57.
packages/ui/CHANGELOG.md Version 0.5.57 added with updates to traffic statistics.
packages/ui/package.json Version bumped to 0.5.57, new dependencies added: @radix-ui/react-tooltip and recharts.
packages/ui/src/components/atoms/Tooltip/Tooltip.tsx New Tooltip component added using Radix UI.
packages/ui/src/components/atoms/Tooltip/index.ts Exported all entities from the Tooltip module.
packages/ui/src/components/atoms/index.ts Exported Tooltip module from atoms index.
packages/ui/src/components/templates/report/adapters/report-adapter.ts Added normalization function for traffic analysis data structure.
packages/ui/src/components/templates/report/components/WebsiteCredibility/WebsiteCredibility.tsx Updated traffic analysis data structure for better organization and visualization.

Possibly related PRs

Suggested reviewers

  • tomer-shvadron
  • alonp99

Poem

🐰 Hop, hop, through code's domain,
Dependencies dance, versions gain!
Tooltips sparkle, charts take flight,
Ballerine's magic shines so bright!
A rabbit's code review delight! 🚀


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
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: 0

🧹 Nitpick comments (3)
packages/ui/src/components/templates/report/components/WebsiteCredibility/WebsiteCredibility.tsx (2)

67-73: Consider renaming “montlyVisitsIndicators” to “monthlyVisitsIndicators”.
Even though the property name is carried over from an external data source, the misspelling may confuse other developers. Consider adding a small comment clarifying why the type is spelled that way (due to upstream data naming) or, if possible, safely adjusting the name to maintain consistency.


146-179: Responsive layout advice for traffic charts.
Large charts in a side-by-side layout may not behave predictably on smaller screens, especially given the reported Tailwind conflict. Consider adopting the recommended approach of prefixing or sharing the config to ensure that breakpoints work properly when rendering these charts in various screen widths.

packages/ui/src/components/templates/report/adapters/report-adapter.ts (1)

182-192: Confirm safe mapping for traffic data arrays.
Your transformations rely on normalizeHyphenedDataString returning valid numeric entries for the value. If the field is absent or non-numeric, it may cause further issues down the line. Ensure that all upstream data is validated or defaulted.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8e9968f and a567013.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (16)
  • apps/backoffice-v2/CHANGELOG.md (1 hunks)
  • apps/backoffice-v2/package.json (2 hunks)
  • apps/kyb-app/CHANGELOG.md (1 hunks)
  • apps/kyb-app/package.json (2 hunks)
  • packages/react-pdf-toolkit/CHANGELOG.md (1 hunks)
  • packages/react-pdf-toolkit/package.json (2 hunks)
  • packages/ui/CHANGELOG.md (1 hunks)
  • packages/ui/package.json (3 hunks)
  • packages/ui/src/components/atoms/Tooltip/Tooltip.tsx (1 hunks)
  • packages/ui/src/components/atoms/Tooltip/index.ts (1 hunks)
  • packages/ui/src/components/atoms/index.ts (1 hunks)
  • packages/ui/src/components/templates/report/adapters/report-adapter.ts (2 hunks)
  • packages/ui/src/components/templates/report/components/WebsiteCredibility/WebsiteCredibility.tsx (2 hunks)
  • services/workflows-service/CHANGELOG.md (1 hunks)
  • services/workflows-service/package.json (1 hunks)
  • services/workflows-service/prisma/data-migrations (1 hunks)
✅ Files skipped from review due to trivial changes (9)
  • packages/ui/src/components/atoms/Tooltip/index.ts
  • packages/ui/CHANGELOG.md
  • services/workflows-service/package.json
  • packages/react-pdf-toolkit/CHANGELOG.md
  • apps/backoffice-v2/package.json
  • services/workflows-service/prisma/data-migrations
  • services/workflows-service/CHANGELOG.md
  • apps/kyb-app/CHANGELOG.md
  • apps/backoffice-v2/CHANGELOG.md
🔇 Additional comments (10)
packages/ui/package.json (2)

4-4: LGTM: Version increment follows semver

The version bump from 0.5.56 to 0.5.57 for a feature addition follows semantic versioning guidelines.


47-47: LGTM: New dependencies align with visualization requirements

The added dependencies support the PR objectives:

  • @radix-ui/react-tooltip: Provides accessible tooltips for monthly visitors metrics
  • recharts: Robust charting library for traffic visualization

Both are well-maintained packages with compatible version ranges.

Also applies to: 65-65

packages/react-pdf-toolkit/package.json (1)

4-4: LGTM: Consistent version updates

Package version and @ballerine/ui dependency are correctly synchronized with the UI package changes.

Also applies to: 30-30

apps/kyb-app/package.json (1)

4-4: LGTM: Consistent version updates

Package version and @ballerine/ui dependency are correctly synchronized with the UI package changes.

Also applies to: 20-20

packages/ui/src/components/templates/report/components/WebsiteCredibility/WebsiteCredibility.tsx (3)

45-57: Validate numeric and date-formatting assumptions.
The longDateFormatter and longNumberFormatter rely on assumptions about how date strings and large numbers flow in from the API. Ensure that all relevant call sites provide data matching these expectations (for instance, 'MMMM YYYY' with dayjs).


183-191: Avoid item parsing errors.
The parsing in the bar chart, pie chart, and engagement sections (which use value: parseFloat(...)) could throw NaN if the API returns unexpected text. Add minimal guards or default transformations to avoid runtime issues if the external data changes.


248-283: Tooltip usage looks great.
The approach with TooltipProvider, TooltipTrigger, and TooltipContent is consistent and clear. Awesome work.

packages/ui/src/components/atoms/index.ts (1)

26-26: Great addition of the Tooltip export.
Exporting the Tooltip components from this index file allows broader access across different modules in your application.

packages/ui/src/components/atoms/Tooltip/Tooltip.tsx (1)

13-29: Ensure consistent styling for tooltip content.
The usage of ctw and Radix primitives is solid. Just be mindful if you ever need to override default transitions or theming—this might require additional class merging or conditional logic. Overall, this is a neat and maintainable approach.

packages/ui/src/components/templates/report/adapters/report-adapter.ts (1)

75-82: Potential edge cases in string splitting.
normalizeHyphenedDataString splits on ' - '. If upstream data contains additional hyphens or no hyphens at all, the returned label and value might break your intended logic. Consider adding fallback logic or robust validation.

Copy link
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: 0

🧹 Nitpick comments (2)
packages/ui/src/components/templates/report/components/WebsiteCredibility/WebsiteCredibility.tsx (2)

132-133: Remove commented code

There are several blocks of commented-out code related to responsive layouts. These should be removed to maintain code cleanliness.

Apply this cleanup:

-    {/* <div className="flex flex-col 2xl:flex-row gap-4 w-full h-auto 2xl:h-96">
-      <div className="h-[24rem] 2xl:h-full w-full 2xl:w-3/5"> */}
+    <div className="flex gap-4 h-[30rem] w-full">

-    {/* <div className="flex 2xl:flex-col gap-4 h-[12rem] 2xl:h-full w-full 2xl:w-2/5">
-      <div className="h-full 2xl:h-1/2 w-1/2 2xl:w-full"> */}
+    <div className="flex flex-col gap-4 h-full w-2/5">

-    {/* <Card className="h-full 2xl:h-1/2 w-1/2 2xl:w-full"> */}
+    <Card className="h-1/2 w-full">

Also applies to: 172-173, 232-233


134-135: Address responsive design issues

The PR mentions issues with Tailwind CSS classes being loaded multiple times, preventing media queries from working correctly. The current implementation uses fixed proportions (w-3/5, w-2/5) which might not work well on all screen sizes.

Consider these solutions mentioned in the PR:

  1. Add a prefix to UI Tailwind classes
  2. Use the UI package from source while sharing base Tailwind config as preset

Additionally, consider using more flexible responsive classes:

-    <div className="flex gap-4 h-[30rem] w-full">
-      <Card className="h-full w-3/5">
+    <div className="flex flex-col lg:flex-row gap-4 min-h-[30rem] w-full">
+      <Card className="h-full w-full lg:w-3/5">

Also applies to: 174-175, 233-234

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a567013 and 0435c8d.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (14)
  • apps/backoffice-v2/CHANGELOG.md (1 hunks)
  • apps/backoffice-v2/package.json (2 hunks)
  • apps/kyb-app/CHANGELOG.md (1 hunks)
  • apps/kyb-app/package.json (2 hunks)
  • packages/react-pdf-toolkit/CHANGELOG.md (1 hunks)
  • packages/react-pdf-toolkit/package.json (2 hunks)
  • packages/ui/CHANGELOG.md (1 hunks)
  • packages/ui/package.json (3 hunks)
  • packages/ui/src/components/atoms/Tooltip/Tooltip.tsx (1 hunks)
  • packages/ui/src/components/atoms/Tooltip/index.ts (1 hunks)
  • packages/ui/src/components/atoms/index.ts (1 hunks)
  • packages/ui/src/components/templates/report/adapters/report-adapter.ts (2 hunks)
  • packages/ui/src/components/templates/report/components/WebsiteCredibility/WebsiteCredibility.tsx (2 hunks)
  • services/workflows-service/prisma/data-migrations (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (13)
  • packages/ui/src/components/atoms/index.ts
  • packages/ui/src/components/atoms/Tooltip/index.ts
  • packages/react-pdf-toolkit/CHANGELOG.md
  • packages/ui/CHANGELOG.md
  • apps/kyb-app/CHANGELOG.md
  • apps/backoffice-v2/CHANGELOG.md
  • apps/kyb-app/package.json
  • packages/ui/src/components/templates/report/adapters/report-adapter.ts
  • packages/react-pdf-toolkit/package.json
  • services/workflows-service/prisma/data-migrations
  • packages/ui/package.json
  • apps/backoffice-v2/package.json
  • packages/ui/src/components/atoms/Tooltip/Tooltip.tsx
🔇 Additional comments (4)
packages/ui/src/components/templates/report/components/WebsiteCredibility/WebsiteCredibility.tsx (4)

1-23: LGTM! Clean import organization

The imports are well-organized and all dependencies are necessary for the new visualization features.


24-41: LGTM! Well-structured metrics configuration

The engagement metrics mapping is well-organized with clear descriptions and type-safe configuration.


150-150: LGTM! Efficient number formatting

Using Intl.NumberFormat with compact notation is a good choice for formatting large numbers, as discussed in the previous review comments.


53-59: Verify the "montlyVisitsIndicators" typo

There's a typo in the property name "montlyVisitsIndicators" (missing 'h'). The PR mentions this might match the external API structure.

Run this script to check the consistency of this property name across the codebase:

✅ Verification successful

Property name "montlyVisitsIndicators" is consistently used across the codebase

The property name "montlyVisitsIndicators" (without 'h') is consistently used in all occurrences across the codebase:

  • In the adapter: report-adapter.ts (2 occurrences)
  • In the component: WebsiteCredibility.tsx (2 occurrences)

Since there are no occurrences of "monthlyVisitsIndicators" (with 'h') and the property name is used consistently in both the adapter and component, this appears to be an intentional naming to match the external API structure as mentioned in the PR.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check usage of montlyVisitsIndicators vs monthlyVisitsIndicators
echo "Searching for 'montlyVisitsIndicators'..."
rg "montlyVisitsIndicators"

echo -e "\nSearching for 'monthlyVisitsIndicators'..."
rg "monthlyVisitsIndicators"

Length of output: 844

Copy link
Collaborator

@MatanYadaev MatanYadaev left a comment

Choose a reason for hiding this comment

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

Good job!

Copy link
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: 0

🧹 Nitpick comments (2)
packages/ui/src/components/templates/report/adapters/report-adapter.ts (1)

75-82: LGTM! Consider adding input validation.

The function implementation is clean and handles edge cases well. However, consider adding input validation to handle undefined/null inputs gracefully.

 const normalizeHyphenedDataString = (str: string) => {
+  if (!str) return { label: '', value: undefined };
   const parts = str.split(' - ');

   return {
     label: parts.length > 1 ? parts.slice(0, -1).join(' - ') : parts.at(0),
     value: parts.at(-1),
   };
 };
packages/ui/src/components/templates/report/components/WebsiteCredibility/WebsiteCredibility.tsx (1)

67-80: Consider moving data transformation to the backend.

The traffic sources transformation logic, including the "Other" category calculation, should ideally be handled on the backend as noted in the TODO comment. This would:

  1. Reduce client-side processing
  2. Ensure consistent data transformation across different clients
  3. Simplify the frontend code

Would you like me to help create a GitHub issue to track moving this transformation logic to the backend?

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0435c8d and ddb07a7.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (14)
  • apps/backoffice-v2/CHANGELOG.md (1 hunks)
  • apps/backoffice-v2/package.json (2 hunks)
  • apps/kyb-app/CHANGELOG.md (1 hunks)
  • apps/kyb-app/package.json (2 hunks)
  • packages/react-pdf-toolkit/CHANGELOG.md (1 hunks)
  • packages/react-pdf-toolkit/package.json (2 hunks)
  • packages/ui/CHANGELOG.md (1 hunks)
  • packages/ui/package.json (3 hunks)
  • packages/ui/src/components/atoms/Tooltip/Tooltip.tsx (1 hunks)
  • packages/ui/src/components/atoms/Tooltip/index.ts (1 hunks)
  • packages/ui/src/components/atoms/index.ts (1 hunks)
  • packages/ui/src/components/templates/report/adapters/report-adapter.ts (2 hunks)
  • packages/ui/src/components/templates/report/components/WebsiteCredibility/WebsiteCredibility.tsx (7 hunks)
  • services/workflows-service/prisma/data-migrations (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (12)
  • packages/ui/CHANGELOG.md
  • packages/ui/src/components/atoms/Tooltip/index.ts
  • services/workflows-service/prisma/data-migrations
  • apps/backoffice-v2/CHANGELOG.md
  • apps/kyb-app/package.json
  • packages/ui/src/components/atoms/index.ts
  • packages/react-pdf-toolkit/CHANGELOG.md
  • apps/kyb-app/CHANGELOG.md
  • apps/backoffice-v2/package.json
  • packages/ui/package.json
  • packages/react-pdf-toolkit/package.json
  • packages/ui/src/components/atoms/Tooltip/Tooltip.tsx
🔇 Additional comments (4)
packages/ui/src/components/templates/report/adapters/report-adapter.ts (1)

182-192: Verify the "montly" typo with the API team.

The property name "montlyVisitsIndicators" is missing an 'h'. While this might match the external API structure, it's worth confirming if this should be corrected for consistency.

✅ Verification successful

Let me check the specific usage of "montly" in the files to understand the context better.


Let me check for type definitions using a different approach.


Consistent use of "montly" spelling suggests it matches API contract

Based on the search results, we found that "montly" (without 'h') is consistently used in both the adapter (report-adapter.ts) and the component (WebsiteCredibility.tsx). The fact that it appears in the type definition in WebsiteCredibility.tsx as a key in Record<'trafficSources' | 'montlyVisitsIndicators' | 'engagements',...> further suggests this spelling is intentional and matches the API contract.

  • The spelling is consistent across the codebase
  • No instances of "monthly" were found in related frontend code
  • The type definitions reinforce this spelling choice
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other occurrences of "montly" vs "monthly" in the codebase
echo "Searching for 'montly' occurrences:"
rg "montly" -l

echo -e "\nSearching for 'monthly' occurrences:"
rg "monthly" -l

Length of output: 542


Script:

#!/bin/bash
# Check the context of "montly" usage
echo "Context in report-adapter.ts:"
rg "montly" -C 2 packages/ui/src/components/templates/report/adapters/report-adapter.ts

echo -e "\nContext in WebsiteCredibility.tsx:"
rg "montly" -C 2 packages/ui/src/components/templates/report/components/WebsiteCredibility/WebsiteCredibility.tsx

# Check if there's a type definition that might show the API interface
echo -e "\nSearching for potential type definitions:"
rg "interface.*Traffic" -A 10

Length of output: 1322


Script:

#!/bin/bash
# Search for type definitions related to traffic analysis
echo "Searching for traffic analysis types:"
ast-grep --pattern 'interface $_ {
  $$$
  trafficAnalysis?: {
    $$$
  }
  $$$
}'

# Also check for type imports that might define these structures
echo -e "\nSearching for type imports:"
rg "import.*type.*Traffic" -A 2

Length of output: 275

packages/ui/src/components/templates/report/components/WebsiteCredibility/WebsiteCredibility.tsx (3)

24-41: LGTM! Well-structured engagement metrics mapping.

The constant provides clear descriptions and formatting rules for each metric, making it maintainable and type-safe.


154-181: LGTM! Clean chart implementation with proper number formatting.

The monthly visitors chart implementation is well-structured and follows the recommended number formatting approach using Intl.NumberFormat.


245-282: ⚠️ Potential issue

Address Tailwind CSS class conflicts.

The engagement metrics UI implementation is clean and user-friendly. However, as mentioned in the PR objectives, there are Tailwind CSS class conflicts affecting responsiveness. Consider:

  1. Adding a prefix to UI Tailwind classes
  2. Using the UI package from source with a shared base configuration

@r4zendev r4zendev enabled auto-merge (squash) January 1, 2025 11:24
@r4zendev r4zendev merged commit 8fabbc9 into dev Jan 1, 2025
10 checks passed
@r4zendev r4zendev deleted the bal3271 branch January 1, 2025 11:26
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.

3 participants