You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by "ggbdpq (via GitHub)" <gi...@apache.org> on 2026/09/01 15:08:10 UTC

[PR] fix(cli): abbreviate home-relative Windows paths in the status line [maka]

ggbdpq opened a new pull request, #4481:
URL: https://github.com/apache/maka/pull/4481

   ## Summary
   
   The TUI status line never shortened home-relative paths on Windows: `shortenCwd` compared `cwd` against `home + '/'`, which can never match a Windows profile path (`C:\Users\<name>\Videos\...`). Only the exact home directory shortened; every subdirectory rendered as a full absolute path.
   
   This change compares through `path.relative` instead, which handles drive letters and case-only differences via the platform module, rejects `..`-prefixed and absolute results (siblings, parent traversal, and other drives keep their absolute form), and emits `~/<rest>` with the remainder's native separators. POSIX behavior is unchanged.
   
   `shortenCwd` is exported so the contract has focused coverage.
   
   Fixes #3825
   
   ## Verification
   
   | Check | Command | Result |
   |---|---|---|
   | Target suite | `node --test dist/__tests__/pi-transcript.test.js` in packages/cli | 110 pass, 0 fail, 2 skip — the three new #3825 Windows cases pass on win32; the two POSIX-only cases skip there and run on POSIX hosts |
   | Format | `npm run format:check` | Checked 1780 files, no fixes applied |
   | ASF headers | `npm run check:asf-headers` | 3146 files audited, every source file carries the ASF header |
   | Build | `npm test` in packages/cli | clean + build succeed; see note |
   
   Note: the full `@maka/cli` suite on this Windows machine reports one failure unrelated to this change — `runtime-host-update-reconciliation.test.js` hits `EPERM: operation not permitted, fsync` on a directory, the Windows directory-sync gap tracked by #3898. The failing module does not import `pi-transcript`, and the previously documented POSIX behavior remains covered by the unchanged existing tests. The `check:asf-source` release-legal script tests also fail on this checkout for spawn-environment reasons; the header audit that governs source files passes.
   
   ## AI use
   
   Select exactly one:
   
   - [ ] No generative tool made a substantive contribution
   - [x] Generative tooling made a substantive contribution
   
   Tool(s) and scope: GLM-5.3-Flash via ZCode — traced the root cause, implemented the fix and tests, and ran the verification table above; every claim was checked against command output. The commit carries a `Generated-by` trailer.
   
   ## Checklist
   
   - [x] Tests cover the change and fail without it
   - [x] Lint, format, typecheck and the affected suites pass locally
   
   Does this PR entail a change in behavior?
   
   - [x] Yes — the Windows status line now renders `~/`-relative paths instead of full absolute paths; macOS/Linux behavior is unchanged
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [PR] fix(cli): abbreviate home-relative Windows paths in the status line [maka]

Posted by "jackwener (via GitHub)" <gi...@apache.org>.
jackwener merged PR #4481:
URL: https://github.com/apache/maka/pull/4481


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org