Skip to content

Conversation

@mulikruchi07
Copy link
Contributor

Description

Fixes missing validation when editing a task description.
When the user presses Submit on an empty description, the dialog now remains open and shows an inline error message.

Fixes #513

Screenshots

after#513

Checklist

  • Tests have been added or updated to cover the changes
  • Documentation has been updated to reflect the changes
  • Code follows the established coding style guidelines
  • All tests are passing

Copilot AI review requested due to automatic review settings December 7, 2025 12:14
Copy link

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 adds validation for empty task descriptions when editing through the description dialog. The implementation extracts the inline dialog code into a new _DescriptionEditDialog StatefulWidget to enable state management for displaying validation errors.

Key Changes:

  • Converted the inline dialog builder to a separate _DescriptionEditDialog StatefulWidget
  • Added validation to prevent empty descriptions with an inline error message
  • Replaced TextField with TextFormField wrapped in a Form for error display

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


class _DescriptionEditDialogState extends State<_DescriptionEditDialog> {
late TextEditingController controller;
final _formKey = GlobalKey<FormState>();
Copy link

Copilot AI Dec 7, 2025

Choose a reason for hiding this comment

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

The _formKey is declared but never used. Consider either:

  1. Using it with _formKey.currentState?.validate() to validate the form, or
  2. Removing it if manual validation via errorText is preferred.

Currently, the code manually validates by checking controller.text.trim().isEmpty and setting errorText, which makes the Form wrapper unnecessary.

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.

Description field accepts empty input when editing a task and does not show required error

1 participant