Repository navigation
fix: use single-char ellipsis in commitments truncate() to prevent table misalignment - #96006
pengxuewu-lab wants to merge 1 commit into
Conversation
…ble misalignment Fixes openclaw#95921
|
Thanks for the context here. I did a careful shell check against current Close: current main already contains the same commitments-table truncation fix and stronger regression coverage from the merged sibling PR, so this branch no longer carries unique work to merge. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. So I’m closing this as already implemented rather than keeping a duplicate issue open. Review detailsBest possible solution: Keep the current main implementation from the merged sibling PR and close duplicate candidate branches for the same commitments table bug. Do we have a high-confidence way to reproduce the issue? Yes. Source inspection shows the old helper could return an 18-character value for a 16-character column, and current main now has regression tests that exercise the long ID and Scope table rows through Is this the best way to solve the issue? Yes for current main, not this PR as the landing vehicle. The merged sibling PR applies the same one-character ellipsis fix and adds focused command-path coverage, making this one-line branch redundant. Security review: Security review cleared: The diff only changes one CLI string-formatting helper and does not touch dependencies, workflows, secrets, package metadata, or code execution setup. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against d1b917120a47; fix evidence: commit 33afb1ec70d5, main fix timestamp 2026-06-24T15:18:49+08:00. |
|
ClawSweeper applied the proposed close for this PR.
|
What Problem This Solves
In
openclaw commitments, thetruncate()helper reserved only 1 character for the overflow indicator (maxChars - 1) but appended a 3-character ASCII..., making the truncated stringmaxChars + 2characters wide. This causedpadEnd-based table columns to misalign — truncated rows pushed past the column boundary, breaking visual alignment of the commitments table output.Root cause:
src/commands/commitments.ts—truncate()appended 3 chars of ellipsis after slicing tomaxChars - 1, producingmaxChars + 2total width instead of the expectedmaxChars.Fix: Replace
...with single Unicode ellipsis\u2026, matching the identical pattern already used inflows.ts,tasks.ts, andonboard-skills.ts.Evidence
Fix (commitments.ts, line 27)
function truncate(value: string, maxChars: string): string { - return value.length <= maxChars ? value : `${value.slice(0, maxChars - 1)}...`; + return value.length <= maxChars ? value : `${value.slice(0, maxChars - 1)}\u2026`; }Consistency with existing codebase
The single-char Unicode ellipsis is already the repo convention for truncation helpers:
src/cli/flows.ts\u2026(single unicode)src/cli/tasks.ts\u2026(single unicode)src/cli/onboard-skills.ts\u2026(single unicode)src/commands/commitments.ts(BEFORE)...(3-char ASCII)src/commands/commitments.ts(AFTER)\u2026(single unicode)Impact
padEnd(maxChars)now produces correctly aligned columns since truncated values are exactlymaxCharswide🤖 Generated with Claude Code