Fix leading space in code-link directory names from emoji project names#602
Open
huntercaron wants to merge 1 commit intomainfrom
Open
Fix leading space in code-link directory names from emoji project names#602huntercaron wants to merge 1 commit intomainfrom
huntercaron wants to merge 1 commit intomainfrom
Conversation
Add second trim() after boundary hyphen removal in toDirectoryName() to handle spaces revealed when emoji-replacement hyphens are stripped.
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes a directory-name sanitization edge case in the code-link CLI where emoji-prefixed project names could result in a leading space after hyphen-boundary cleanup.
Changes:
- Add an extra
trim()intoDirectoryName()after stripping boundary hyphens to remove newly-exposed leading/trailing whitespace. - Add tests covering emoji-prefixed project names to prevent regressions.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/code-link-cli/src/utils/project.ts | Ensures directory names are re-trimmed after boundary hyphen removal to avoid leading spaces from emoji prefixes. |
| packages/code-link-cli/src/utils/project.test.ts | Adds unit tests validating emoji-prefixed project names sanitize to clean directory names. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
niekert
approved these changes
Mar 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Project names with emoji prefixes like "🧠 Logic" produce directory names with a leading space. The emoji gets replaced with hyphens by the sanitization regex, then boundary hyphen removal strips those hyphens — revealing a space that wasn't at the boundary before. Adding a second
trim()after boundary hyphen removal fixes this.Changelog
Testing
npx vitest run src/utils/project.test.ts— all 10 tests pass