Skip to content

Conversation

@glenntws
Copy link
Contributor

@glenntws glenntws commented Sep 7, 2025

No description provided.

@cla-bot cla-bot bot added the cla-signed label Sep 7, 2025
@vercel
Copy link

vercel bot commented Sep 7, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
stagewise-website Ready Ready Preview Sep 11, 2025 6:00pm

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 7, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch updated-toolbar-ui

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment on lines +34 to +35
? workspaceInfo.path
.replace('\\', '/')

Check failure

Code scanning / CodeQL

Incomplete string escaping or encoding High

This replaces only the first occurrence of '\'.

Copilot Autofix

AI about 2 months ago

The best way to address this problem is to ensure that all backslashes in the workspaceInfo.path string are replaced with slashes, not just the first one. In JavaScript, this is achieved by replacing the string literal pattern with a regular expression /\\/g, which matches all backslashes globally. Thus, line 35 should be changed from .replace('\\', '/') to .replace(/\\/g, '/'). This change is confined to the relevant path normalization expression and does not affect any other behavior.

No new imports or utility functions are needed; this can be fixed in-place with standard JavaScript/TypeScript features.


Suggested changeset 1
toolbar/core/src/layouts/default.tsx

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/toolbar/core/src/layouts/default.tsx b/toolbar/core/src/layouts/default.tsx
--- a/toolbar/core/src/layouts/default.tsx
+++ b/toolbar/core/src/layouts/default.tsx
@@ -32,7 +32,7 @@
   const workspaceDir = useMemo(() => {
     return workspaceInfo
       ? workspaceInfo.path
-          .replace('\\', '/')
+          .replace(/\\/g, '/')
           .split('/')
           .filter((p) => p !== '')
           .pop()
EOF
@@ -32,7 +32,7 @@
const workspaceDir = useMemo(() => {
return workspaceInfo
? workspaceInfo.path
.replace('\\', '/')
.replace(/\\/g, '/')
.split('/')
.filter((p) => p !== '')
.pop()
Copilot is powered by AI and may make mistakes. Always verify output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants