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

chore: change toggle color of toolbar to improve visibility #385

Merged
merged 2 commits into from
May 21, 2024

Conversation

islxyqwe
Copy link
Contributor

This PR changed the toggled button's color.
image

Copy link

vercel bot commented May 20, 2024

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

Name Status Preview Comments Updated (UTC)
graphic-walker ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 20, 2024 4:24am

Copy link
Contributor

Risk Level 3 - /home/runner/work/graphic-walker/graphic-walker/packages/graphic-walker/src/lib/vl2gw.ts

The changes in this file are related to the handling of filters in the VegaliteMapper function. The changes seem to be correct, but there are a few potential issues:

  1. The regular expressions used to parse the filter string are complex and could be prone to errors. It would be beneficial to add comments explaining what each regular expression is supposed to match.

  2. The addRule function is called with the result of a regular expression match. If the match fails and returns null, this could lead to a runtime error. It would be safer to check if the match was successful before calling addRule.

Here's an example of how you could implement these suggestions:

// Extract field and value from filter string
const fieldMatch = /(?:\\.|\\[[\"'])([A-z\\s_]*)(?:[\"']\\])?/.exec(result[1]);
const valueMatch = /[\"'](.*)[\"']/.exec(result[4]);

if (!fieldMatch || !valueMatch) {
    return;
}

const field = fieldMatch[1];
const value = valueMatch[1];
const op = result[2];

addRule(field, op, value);

🔍🐛🔧


Powered by Code Review GPT

@islxyqwe islxyqwe merged commit 0cf1773 into main May 21, 2024
6 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.

None yet

2 participants