Skip to content

Conversation

@younocode
Copy link
Contributor

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes an issue where formula field formatting is not reset when the expression has an error. The change ensures that when a formula expression contains errors, the formatting is properly reset to default values.

  • Added error tracking to the calculateTypedValue function to detect when formula expressions fail to parse
  • Modified the formatting reset logic to trigger when there's an expression error, not just when the cell value type changes

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

} = calculateTypedValue(fields, expression);

const onExpressionChange = (expr: string) => {
const { cellValueType: newCellValueType } = calculateTypedValue(fields, expr);
Copy link

Copilot AI Oct 20, 2025

Choose a reason for hiding this comment

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

The hasError property from calculateTypedValue is not being destructured here, which means the error state won't be available for the formatting reset logic in onExpressionChange. This could lead to inconsistent behavior where errors in the new expression aren't properly handled.

Copilot uses AI. Check for mistakes.
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