Skip to content

Fix AI-generated pin description validation - #68

Merged
Dereje1 merged 1 commit into
masterfrom
codex/fix-description-validation-bug-in-pincreate
Jul 21, 2026
Merged

Dereje1 merged 1 commit into
masterfrom
codex/fix-description-validation-bug-in-pincreate

Conversation

@Dereje1

@Dereje1 Dereje1 commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Motivation

  • AI-generated titles were being set into description but isDescriptionError remained stale (initially true), blocking save even when the generated title met the existing >=5 character rule.

Description

  • Update handleAIimage() to trim the returned title, set it as description, and immediately recompute isDescriptionError using the existing description.trim().length < 5 rule in client/src/components/mypins/pincreatemodal.tsx.
  • Add focused tests to tests/client/src/components/mypins/pincreatemodal.test.tsx to verify a valid generated title clears the description error and a short generated title remains invalid.
  • Files changed: client/src/components/mypins/pincreatemodal.tsx, tests/client/src/components/mypins/pincreatemodal.test.tsx.

Testing

  • Ran the focused Jest suite: npx jest tests/client/src/components/mypins/pincreatemodal.test.tsx --runInBand and all tests passed (21 tests, snapshots included).
  • TypeScript checks: npm run compileTS completed successfully.
  • Lint: npm run lint completed successfully.

Codex Task

@Dereje1
Dereje1 merged commit 3ca7997 into master Jul 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant