Skip to content

fix: Sanitize and normalize skill name input inline#2606

Merged
daryllimyt merged 2 commits intomainfrom
codex/fix-bug-in-slack-context
May 4, 2026
Merged

fix: Sanitize and normalize skill name input inline#2606
daryllimyt merged 2 commits intomainfrom
codex/fix-bug-in-slack-context

Conversation

@daryllimyt
Copy link
Copy Markdown
Contributor

@daryllimyt daryllimyt commented May 4, 2026

Motivation

  • Replace the external slugify usage with an inline normalization to ensure skill names are consistently formatted client-side before validation.
  • Enforce the allowed character set and hyphen rules early so the validateSkillName check receives normalized input.

Description

  • Removed the slugify import and updated the onChange for the name Input to perform inline normalization.
  • The new normalization lowercases the string, converts underscores to hyphens, removes invalid characters, collapses repeated spaces/hyphens into single hyphens, and trims leading/trailing hyphens.
  • Existing validation via validateSkillName and error UI are unchanged and still applied after normalization.

Testing

  • Ran the frontend type-check and build (pnpm build) to verify there are no TypeScript or bundling errors, and the build succeeded.
  • Ran the frontend unit tests (pnpm test) and the test suite passed.

Codex Task


Summary by cubic

Normalize skill name input inline with Unicode support to enforce kebab-case before validation. Strips diacritics so accented names like “Café Tools” become “cafe-tools”, ensuring validateSkillName always receives normalized input.

  • Bug Fixes
    • Replaced slugify with inline normalization in the name input’s onChange.
    • Added Unicode NFKD normalization and diacritic stripping; rules: lowercase, _-, remove invalid chars, collapse spaces/hyphens to -, trim edges.
    • Added test for accented input; validation via validateSkillName and error UI remain unchanged.

Written for commit 745409b. Summary will update on new commits.

@zeropath-ai
Copy link
Copy Markdown

zeropath-ai Bot commented May 4, 2026

No security or compliance issues detected. Reviewed everything up to 745409b.

Security Overview
Detected Code Changes
Change Type Relevant files
Enhancement ► create-skill-dialog.tsx
    Improved sanitization for skill names to handle accented characters and a more robust slugification process.
Refactor ► create-skill-dialog.tsx
    Removed unused import of slugify function.
Other ► create-skill-dialog.test.tsx
    Added unit tests for the CreateSkillDialog component to verify the behavior of accented character sanitization.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 400ba813c0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread frontend/src/components/skills/create-skill-dialog.tsx
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

@daryllimyt daryllimyt requested a review from jordan-umusu May 4, 2026 21:13
@daryllimyt daryllimyt changed the title Sanitize and normalize skill name input inline fix: Sanitize and normalize skill name input inline May 4, 2026
@daryllimyt daryllimyt merged commit fd77779 into main May 4, 2026
11 checks passed
@daryllimyt daryllimyt deleted the codex/fix-bug-in-slack-context branch May 4, 2026 21:31
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.

2 participants