Skip to content

Conversation

@Yzing
Copy link

@Yzing Yzing commented Nov 27, 2025

PR includes

  • fixed #0
  • add / modify test cases
  • documents, demos

@gemini-code-assist
Copy link

Summary of Changes

Hello @Yzing, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the project's documentation by replacing the generic 'data analysis' section with a focused and interactive 'data extract' guide. It introduces new documentation pages in both English and Chinese, complete with live code examples that showcase data extraction capabilities from CSV and natural language using the AVA library. Essential configuration changes were also implemented to seamlessly integrate these new documentation components within the Dumi site.

Highlights

  • Documentation Update: Replaced outdated 'data analysis' documentation with new 'data extract' content, providing more relevant and specific guidance.
  • Interactive Examples: Introduced new interactive examples for data extraction from CSV files and natural language inputs, utilizing the '@antv/ava' library for live demonstrations.
  • Configuration Enhancements: Updated Dumi site configuration to include a dedicated 'tsconfig.json' for the Dumi environment, added a webpack alias for '@antv/ava', and extended the main 'tsconfig.json' to cover new '.tsx' documentation files.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the documentation by adding new scene cases for data extraction. It introduces two new demo components, one for extracting data from CSV and another from natural language. While the documentation update is valuable, I've found a critical security vulnerability in the new demo components: hardcoded API credentials. Additionally, there are some medium-severity issues related to React hook usage, typos, and redundant code that should be addressed to improve code quality and maintainability. My detailed feedback is in the comments below.

Comment on lines 9 to 10
appId: '202510APxPmo00551539',
authorization: 'TBox-c4ae8a71224e42baaafb1c01d15395a7',

Choose a reason for hiding this comment

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

critical

Hardcoding credentials like appId and authorization is a significant security risk. These secrets will be exposed in the frontend code and committed to version control. They should be loaded from environment variables. You can add them to your .dumirc.ts file's define section to make them available as process.env variables, similar to how TEST_TOKEN is handled.

Suggested change
appId: '202510APxPmo00551539',
authorization: 'TBox-c4ae8a71224e42baaafb1c01d15395a7',
appId: process.env.AVA_LLM_APP_ID,
authorization: process.env.AVA_LLM_AUTHORIZATION,

Comment on lines 9 to 10
appId: '202510APxPmo00551539',
authorization: 'TBox-c4ae8a71224e42baaafb1c01d15395a7',

Choose a reason for hiding this comment

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

critical

Hardcoding credentials like appId and authorization is a significant security risk. These secrets will be exposed in the frontend code and committed to version control. They should be loaded from environment variables. You can add them to your .dumirc.ts file's define section to make them available as process.env variables, similar to how TEST_TOKEN is handled.

Suggested change
appId: '202510APxPmo00551539',
authorization: 'TBox-c4ae8a71224e42baaafb1c01d15395a7',
appId: process.env.AVA_LLM_APP_ID,
authorization: process.env.AVA_LLM_AUTHORIZATION,


const App = () => {
const [input, setInput] = useState(INPUT_DATA);
const [reslut, setResult] = useState([]);

Choose a reason for hiding this comment

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

medium

There's a typo in the state variable name. reslut should be result.

Suggested change
const [reslut, setResult] = useState([]);
const [result, setResult] = useState([]);

const result = await ava.extract(input);
setResult(result);
setLoading(false);
}, [loading]);

Choose a reason for hiding this comment

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

medium

The dependency array for useCallback is incorrect. The callback sets the loading state, so it should not depend on loading. This creates a new function every time the loading state changes, which is inefficient and defeats the purpose of useCallback. The callback depends on input, so the dependency array should be [input]. Since the input is not editable in this demo, you could also use an empty array [].

Suggested change
}, [loading]);
}, [input]);

</Button>,
]}
>
<Input.TextArea readOnly style={{ height: '300px' }} value={input} onChange={(e) => setInput(e.target.value)} />

Choose a reason for hiding this comment

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

medium

The Input.TextArea component has the readOnly prop, which prevents users from editing its content. However, it also has an onChange handler. This handler will never be triggered, making the code confusing. Since the intent seems to be a non-editable demo, the onChange prop should be removed.

Suggested change
<Input.TextArea readOnly style={{ height: '300px' }} value={input} onChange={(e) => setInput(e.target.value)} />
<Input.TextArea readOnly style={{ height: '300px' }} value={input} />

<Input.TextArea readOnly style={{ height: '300px' }} value={input} onChange={(e) => setInput(e.target.value)} />
</Card>
<Card style={CARD_STYLE} title="提取结果:">
<JsonView data={reslut} />

Choose a reason for hiding this comment

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

medium

This uses the misspelled state variable reslut. It should be result, to match the correction at the state declaration.

Suggested change
<JsonView data={reslut} />
<JsonView data={result} />


const App = () => {
const [input, setInput] = useState(INPUT_DATA);
const [reslut, setResult] = useState([]);

Choose a reason for hiding this comment

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

medium

There's a typo in the state variable name. reslut should be result.

Suggested change
const [reslut, setResult] = useState([]);
const [result, setResult] = useState([]);

const result = await ava.extract(input);
setResult(result);
setLoading(false);
}, [loading]);

Choose a reason for hiding this comment

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

medium

The dependency array for useCallback is incorrect. The callback sets the loading state, so it should not depend on loading. This creates a new function every time the loading state changes, which is inefficient and defeats the purpose of useCallback. The callback depends on input, so the dependency array should be [input]. Since the input is not editable in this demo, you could also use an empty array [].

Suggested change
}, [loading]);
}, [input]);

</Button>,
]}
>
<Input.TextArea readOnly style={{ height: '300px' }} value={input} onChange={(e) => setInput(e.target.value)} />

Choose a reason for hiding this comment

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

medium

The Input.TextArea component has the readOnly prop, which prevents users from editing its content. However, it also has an onChange handler. This handler will never be triggered, making the code confusing. Since the intent seems to be a non-editable demo, the onChange prop should be removed.

Suggested change
<Input.TextArea readOnly style={{ height: '300px' }} value={input} onChange={(e) => setInput(e.target.value)} />
<Input.TextArea readOnly style={{ height: '300px' }} value={input} />

<Input.TextArea readOnly style={{ height: '300px' }} value={input} onChange={(e) => setInput(e.target.value)} />
</Card>
<Card style={CARD_STYLE} title="提取结果:">
<JsonView data={reslut} />

Choose a reason for hiding this comment

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

medium

This uses the misspelled state variable reslut. It should be result, to match the correction at the state declaration.

Suggested change
<JsonView data={reslut} />
<JsonView data={result} />

@codecov-commenter
Copy link

codecov-commenter commented Nov 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.37%. Comparing base (ea54cb1) to head (05c5651).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##               v4     #900   +/-   ##
=======================================
  Coverage   59.37%   59.37%           
=======================================
  Files          77       77           
  Lines        2085     2085           
  Branches      394      394           
=======================================
  Hits         1238     1238           
  Misses        847      847           
Flag Coverage Δ
ava 59.37% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@leondt1 leondt1 merged commit 7cf2ad5 into v4 Nov 27, 2025
1 check passed
@leondt1 leondt1 deleted the docs/data-extract branch November 27, 2025 09:36
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.

4 participants