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

use colors in tooltip cache #97

Merged
merged 2 commits into from
Feb 5, 2025
Merged

use colors in tooltip cache #97

merged 2 commits into from
Feb 5, 2025

Conversation

nate-kelley-buster
Copy link
Contributor

@nate-kelley-buster nate-kelley-buster commented Feb 5, 2025

Important

Enhance tooltip caching by including color data in cache keys and update SQL schema creation in mod.rs.

  • Tooltip Functionality:
    • Add colors to UseTooltipOptionsProps and useTooltipOptions in useTooltipOptions.tsx.
    • Modify createTooltipCacheKey to include colorsStringCache in useTooltipOptions.tsx.
    • Update useOptions to pass colors to useTooltipOptions in useOptions.tsx.
  • SQL Schema:
    • Change schema and table creation SQL in ensure_stored_values_schema() in mod.rs to use values_{} format.

This description was created by Ellipsis for 2be7383. It will automatically update as commits are pushed.

Copy link

vercel bot commented Feb 5, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
buster ⬜️ Ignored (Inspect) Visit Preview Feb 5, 2025 6:36pm

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.

PR Summary

Added color parameter integration to chart options and tooltip caching system to ensure proper color handling and cache invalidation when colors change.

  • Added colors parameter to useOptions hook in /web/src/components/charts/BusterChartJS/hooks/useOptions/useOptions.tsx for setting chart background and border colors
  • Implemented color-aware tooltip cache in /web/src/components/charts/BusterChartJS/hooks/useOptions/useTooltipOptions.ts/useTooltipOptions.tsx using colorsStringCache
  • Added colors to tooltip cache key generation to ensure tooltip refresh on color changes

💡 (2/5) Greptile learns from your feedback when you react with 👍/👎!

2 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

👍 Looks good to me! Reviewed everything up to f437aea in 1 minute and 41 seconds

More details
  • Looked at 81 lines of code in 2 files
  • Skipped 0 files when reviewing.
  • Skipped posting 4 drafted comments based on config settings.
1. web/src/components/charts/BusterChartJS/hooks/useOptions/useOptions.tsx:169
  • Draft comment:
    New 'colors' prop is passed to useTooltipOptions correctly.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 50%
    None
2. web/src/components/charts/BusterChartJS/hooks/useOptions/useTooltipOptions.ts/useTooltipOptions.tsx:58
  • Draft comment:
    Consider using a separator for joining 'colors' (e.g. join('-')) to avoid potential key collisions.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable:
    The colors array contains color strings. Without a separator, colors ['#fff', '#000'] and ['#ff', 'f#000'] would create the same key. However, color values are typically in standard formats like hex codes or rgb(), making such collisions extremely unlikely. The comment is technically correct but addresses an edge case that's unlikely to occur in practice.
    I could be underestimating the variety of color string formats that could be passed in. There might be custom color formats I'm not considering.
    Even with custom color formats, the likelihood of collisions is very low since colors are typically well-formatted strings. The other parts of the cache key (chart type, tooltip title, etc.) would further differentiate cache entries.
    While technically correct, this comment addresses an edge case that's unlikely to cause real issues. The current implementation is sufficient.
3. web/src/components/charts/BusterChartJS/hooks/useOptions/useOptions.tsx:169
  • Draft comment:
    Ensure the 'colors' array is correctly passed and matches Chart.js expectations for tooltip and dataset styling.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50%
    None
4. web/src/components/charts/BusterChartJS/hooks/useOptions/useTooltipOptions.ts/useTooltipOptions.tsx:58
  • Draft comment:
    Consider using a delimiter (e.g. join(',') instead of join('')) when creating colorsStringCache to avoid potential key collisions.
  • Reason this comment was not posted:
    Confidence changes required: 33% <= threshold 50%
    None

Workflow ID: wflow_JucZ0T3VHzRhAmd1


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

❌ Changes requested. Incremental review on 2be7383 in 58 seconds

More details
  • Looked at 28 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 5 drafted comments based on config settings.
1. api/src/utils/stored_values/mod.rs:44
  • Draft comment:
    Schema creation query now uses the pattern 'values_{}'; ensure that all usages (e.g. in INSERT queries) follow this new naming for consistency.
  • Reason this comment was not posted:
    Marked as duplicate.
2. api/src/utils/stored_values/mod.rs:50
  • Draft comment:
    Table creation uses the new naming pattern 'values_{}.values_v1'. Verify that all parts of the code that reference this table (e.g., in INSERT statements) are updated accordingly.
  • Reason this comment was not posted:
    Marked as duplicate.
3. api/src/utils/stored_values/mod.rs:63
  • Draft comment:
    Index creation query now references 'values_{}.values_v1'. Double-check that all SQL operations refer to the updated schema name format.
  • Reason this comment was not posted:
    Comment did not seem useful. Confidence is useful = 0% <= threshold 50%
    The comment is asking the PR author to double-check something, which violates the rule against asking for confirmation or double-checking. It doesn't provide a specific suggestion or point out a clear issue that needs addressing.
4. api/src/utils/stored_values/mod.rs:49
  • Draft comment:
    Table creation now uses the new schema naming pattern ('values_{}.values_v1'). Ensure that all related queries are updated for consistency.
  • Reason this comment was not posted:
    Confidence changes required: 50% <= threshold 50%
    None
5. api/src/utils/stored_values/mod.rs:63
  • Draft comment:
    Index creation query now references the new schema naming. Verify that downstream queries (if any) are aligned with this updated pattern.
  • Reason this comment was not posted:
    Confidence changes required: 50% <= threshold 50%
    None

Workflow ID: wflow_lN1KfHIFrmDR6ckJ


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

api/src/utils/stored_values/mod.rs Show resolved Hide resolved
@dallinbentley dallinbentley merged commit 6f2976e into main Feb 5, 2025
7 checks passed
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