-
Notifications
You must be signed in to change notification settings - Fork 27
Description
Project
ide
Description
WelcomeRecentFiles.tsx defines formatPath(path, maxLength = 60) to shorten long paths for the secondary label next to each recent project name.
After normalizing slashes, if normalized.length > maxLength, the function splits on / and:
- If
parts.length <= 2, it returns the fullnormalizedstring, even when that string is far longer thanmaxLength.
So the maxLength parameter is only partially enforced. Deep paths that collapse to one or two segments (e.g. synthetic or unusual paths, or very long single segment names) can still produce an arbitrarily long display string and break the row layout.
This is not the same issue as bounty #25103 (misleading ~/ prefix for non-home paths). That issue targets semantic confusion from the ~/ heuristic; this one is unconditional failure to cap length in the parts.length <= 2 branch.
Single root cause: the early return for parts.length <= 2 does not apply any max-length truncation (ellipsis, middle-ellipsis, or tail-only) after the length check.
Error Message
Debug Logs
System Information
Cortex IDE alpha
OS: Windows (win32)
Component: src/components/cortex/WelcomeRecentFiles.tsxScreenshots
Steps to Reproduce
- Ensure a recent project entry whose stored path normalizes to two or fewer path segments but more than 60 characters total (e.g. a very long folder name under a drive root).
- Open the Welcome page or Welcome tab where
WelcomeRecentFilesis shown. - Observe the secondary path text for that row.
Expected Behavior
Displayed path respects maxLength (or equivalent UI constraint) in all branches, e.g. via ellipsis, middle truncation, or tail-only display.
Actual Behavior
Full normalized path may be shown past the intended cap when parts.length <= 2.
Additional Context
No response
