fix: prevent URL encoding for spaces
Summary
Brief description of what this PR does and why. fix: use replaceAll for footer block URLs to handle multi-word names which fixes issue where "Human In The Loop" was generating /blocks/human-in%20the%20loop instead of /blocks/human-in-the-loop by replacing only the first space. Changed to replaceAll(' ', '-') to handle all spaces correctly.
Fixes #(issue)
Type of Change
- [x] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation
- [ ] Other: ___________
Testing
How has this been tested? What should reviewers focus on? Click on Human In The Loop from site's footer block it will redirect to 404 - https://docs.sim.ai/blocks/human-in%20the%20loop
Checklist
- [x] Code follows project style guidelines
- [x] Self-reviewed my changes
- [x] Tests added/updated and passing
- [x] No new warnings introduced
- [x] I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)
Screenshots/Videos
@Chadha93 is attempting to deploy a commit to the Sim Team on Vercel.
A member of the Team first needs to authorize it.
Greptile Overview
Greptile Summary
Fixed URL generation for multi-word block names in the footer component.
- Changed
replace(' ', '-')toreplaceAll(' ', '-')for block URLs to handle all spaces - Previously, "Human In The Loop" generated
/blocks/human-in%20the%20loop(404 error) - Now correctly generates
/blocks/human-in-the-loop
Confidence Score: 5/5
- This PR is safe to merge - it's a minimal one-line bug fix using standard JavaScript API
- The change is a straightforward fix replacing
.replace()with.replaceAll()to handle multiple spaces in block names. The method is well-supported across all modern browsers and the change is localized to a single line with no side effects. - No files require special attention
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| apps/sim/app/(landing)/components/footer/footer.tsx | 5/5 | Changed .replace(' ', '-') to .replaceAll(' ', '-') to correctly handle multi-word block names like "Human In The Loop" |
Sequence Diagram
sequenceDiagram
participant User
participant Footer
participant BlockLink
participant DocsURL
User->>Footer: Renders footer component
Footer->>BlockLink: Maps FOOTER_BLOCKS array
BlockLink->>BlockLink: block.toLowerCase()
BlockLink->>BlockLink: replaceAll(' ', '-')
Note right of BlockLink: "Human In The Loop" → "human-in-the-loop"
BlockLink->>DocsURL: Generate URL
DocsURL-->>User: https://docs.sim.ai/blocks/human-in-the-loop
The latest updates on your projects. Learn more about Vercel for GitHub.
| Project | Deployment | Review | Updated (UTC) |
|---|---|---|---|
| docs | Preview, Comment | Dec 15, 2025 6:51pm |