Skip to content

fix: type dashboard chart metric keys#380

Merged
KMKoushik merged 1 commit intomainfrom
fix-dashboard-chart-metric-keys
Mar 15, 2026
Merged

fix: type dashboard chart metric keys#380
KMKoushik merged 1 commit intomainfrom
fix-dashboard-chart-metric-keys

Conversation

@KMKoushik
Copy link
Member

@KMKoushik KMKoushik commented Mar 15, 2026

Summary

  • tighten metric key typing in dashboard email chart to keep visibleMetrics as StackKey[]
  • avoid implicit string indexing in tooltip/chart metric access by preserving literal key types
  • keep behavior unchanged while fixing the TypeScript compile error

Verification

  • pnpm --filter web build

Summary by cubic

Fix TypeScript types in the dashboard email chart to preserve literal metric keys and keep visibleMetrics typed as StackKey[], avoiding implicit string indexing. No behavior change; resolves the compile error in the web build.

Written for commit c8be974. Summary will update on new commits.

Summary by CodeRabbit

  • Refactor
    • Optimized internal type handling and data initialization in the email chart component for improved code maintainability.

@vercel
Copy link

vercel bot commented Mar 15, 2026

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

Project Deployment Actions Updated (UTC)
unsend-marketing Ready Ready Preview, Comment Mar 15, 2026 1:07pm

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 15, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5c86b6a2-c1ff-403c-b07e-88b57df22279

📥 Commits

Reviewing files that changed from the base of the PR and between 4307670 and c8be974.

📒 Files selected for processing (1)
  • apps/web/src/app/(dashboard)/dashboard/email-chart.tsx

Walkthrough

The component was refactored with typing and array handling improvements. The STACK_ORDER constant was changed from explicit string[] annotation to type inference with as const. The visibleMetrics variable received an explicit StackKey[] type annotation. Additionally, when no metrics are selected, visibleMetrics initialization was modified to return a shallow copy of STACK_ORDER instead of referencing the original array.

📝 Coding Plan
  • Generate coding plan for human review comments

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.

@KMKoushik KMKoushik merged commit 42e68bf into main Mar 15, 2026
4 of 7 checks passed
@KMKoushik KMKoushik deleted the fix-dashboard-chart-metric-keys branch March 15, 2026 13:07
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.

1 participant