Skip to content

Spaces in folder paths break web UI (URL encoding issue) #12

Description

@mhmdez

Summary

ClawPad's web UI fails to load pages when the folder path contains spaces. The URL shows the encoded path (%20 for space), but the frontend doesn't decode it before looking up the file, resulting in a "Page not found" error.

Steps to Reproduce

  1. Create a page with a space in the folder name via the API or agent:

    clawpad_write path="WakeCap/Modon Prototype/PROJECT.md"
    
  2. Files are created successfully on disk:

    /pages/WakeCap/Modon Prototype/PROJECT.md  ✅
    
  3. API can read the file without issues:

    clawpad_read path="WakeCap/Modon Prototype/PROJECT.md"  ✅
    
  4. Navigate to the page in ClawPad web UI

  5. Result: "Page not found" error

Expected Behavior

The web UI should URL-decode the path and successfully load:

WakeCap/Modon%20Prototype/PROJECT.md  →  WakeCap/Modon Prototype/PROJECT.md

Actual Behavior

The web UI attempts to find a file at the literal encoded path:

Looking for: "WakeCap/Modon%20Prototype/PROJECT.md"
Actual file: "WakeCap/Modon Prototype/PROJECT.md"
Result: 404 / "Page not found"

Technical Analysis

The issue appears to be in the path resolution logic on the frontend. When the browser URL contains:

/page/WakeCap/Modon%20Prototype/PROJECT

The frontend extracts the path but doesn't apply decodeURIComponent() before:

  1. Looking up the file on disk
  2. Fetching page metadata
  3. Rendering breadcrumbs

Affected Areas

  • Page viewing — Cannot view pages with spaces in folder names
  • Navigation — Breadcrumbs may also be affected
  • Page listing — Pages may appear in lists but fail when clicked
  • Search results — Same issue if navigating from search

Workaround

Avoid spaces in folder/page names. Use:

  • ModonPrototype instead of Modon Prototype
  • my-folder instead of my folder

Suggested Fix

Apply URL decoding to the path parameter before file resolution:

// Before file lookup
const decodedPath = decodeURIComponent(rawPath);

// Or if using Next.js App Router params
const path = decodeURIComponent(params.path.join('/'));

Environment

  • ClawPad Version: 0.3.1
  • OS: macOS (Darwin 25.2.0 arm64)
  • OpenClaw: Latest

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions