Repository navigation
fix(release): recover immutable patch validation gates - #16984
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughRelease validation jobs restore selected golden and skill-sharing test files from the workflow commit after checking out release tags. The Ubuntu 20.04 skill-sharing job installs Merge Risk: 🔵 Low · up to The PR repairs release validation without changing the tagged product code, but terminal-link checks may miscalculate clicks for some Unicode characters and release evidence spans the tag revision plus selected workflow tests. It is mergeable with explicit owner awareness and follow-up on coordinate mapping and revision provenance. 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description explains the changes, reason, validation results, and recovery safeguards, but it omits several required template sections, including Linked Issue, Visual Proof or N/A, Testing checklist details, AI Disclosure, Review, Agent skill upstream boundary, Notes, and Checklist. Resolution Complete the required template sections. Add the linked issue after “Fixes #”, provide visual proof or state “N/A” with a reason, document testing platforms and checklist status, complete the Agent skill upstream boundary section, address Notes items, and mark the applicable Checklist items.
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: b5df8cf7-8f1a-4340-a146-21c60257b998
📒 Files selected for processing (1)
tests/e2e/golden-terminal-file-link.spec.ts
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.
| // Preserve fixed-width cells so paths split across xterm rows stay searchable. | ||
| const visibleCells = Array.from({ length: pane.terminal.rows }, (_, row) => | ||
| (buffer.getLine(buffer.viewportY + row)?.translateToString(false) ?? '').padEnd( | ||
| pane.terminal.cols | ||
| ) | ||
| ).join('') | ||
| const start = visibleCells.indexOf(needle) | ||
| if (start !== -1) { | ||
| const center = start + Math.floor(needle.length / 2) | ||
| return { | ||
| col: center % pane.terminal.cols, | ||
| row: Math.floor(center / pane.terminal.cols), | ||
| tabId |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- repository guidance ---'
find /tmp/coderabbit-repo-knowledge/stablyai-orca-89dc44e4 -type f -name '*.md' -maxdepth 3 -print \
-exec sh -c 'printf "\n### %s\n" "$1"; cat "$1"' _ {} \;
printf '%s\n' '--- target file ---'
sed -n '1,75p' tests/e2e/golden-terminal-file-link.spec.ts
printf '%s\n' '--- package/runtime references ---'
rg -n --glob 'package.json' --glob 'pnpm-lock.yaml' --glob 'yarn.lock' --glob 'package-lock.json' \
'`@xterm/xterm`|xterm' .
printf '%s\n' '--- relevant symbols ---'
rg -n 'locateLink|visibleCells|translateToString|viewportY|buffer\.getLine' tests/e2e/golden-terminal-file-link.spec.tsRepository: stablyai/orca
Length of output: 50369
🏁 Script executed:
#!/bin/bash
set -e
log=/tmp/coderabbit-shell-logs/shell-output-IYCpoE
printf '%s\n' '--- target-file output ---'
rg -n -A35 -B5 '^--- target file ---|^--- package/runtime references ---|^--- relevant symbols ---' "$log"
printf '%s\n' '--- package manifests containing xterm ---'
rg -l --glob 'package.json' --glob 'pnpm-lock.yaml' --glob 'yarn.lock' --glob 'package-lock.json' '`@xterm/xterm`|xterm' . \
| head -40
printf '%s\n' '--- target file changed context ---'
sed -n '1,75p' tests/e2e/golden-terminal-file-link.spec.ts
sed -n '160,195p' tests/e2e/golden-terminal-file-link.spec.tsRepository: stablyai/orca
Length of output: 11678
🏁 Script executed:
#!/bin/bash
set -e
printf '%s\n' '--- complete locateLink and call sites ---'
sed -n '20,165p' tests/e2e/golden-terminal-file-link.spec.ts
sed -n '235,305p' tests/e2e/golden-terminal-file-link.spec.ts
printf '%s\n' '--- xterm package patch ---'
sed -n '1,220p' 'config/patches/@[email protected]'
printf '%s\n' '--- installed package availability ---'
if [ -d node_modules/@xterm/xterm ]; then
printf '%s\n' 'node_modules/@xterm/xterm exists'
rg -n 'translateToString|wcwidth|width' node_modules/@xterm/xterm/lib node_modules/@xterm/xterm/out 2>/dev/null | head -80
else
printf '%s\n' 'node_modules/@xterm/xterm is unavailable'
fiRepository: stablyai/orca
Length of output: 50372
🏁 Script executed:
#!/bin/bash
set -e
log=/tmp/coderabbit-shell-logs/shell-output-2jTV4k
printf '%s\n' '--- target source from captured output ---'
awk '
/^--- complete locateLink and call sites ---/ {show=1}
/^--- xterm package patch ---/ {show=0}
show {print}
' "$log" | sed -n '1,230p'
printf '%s\n' '--- xterm patch metadata only ---'
rg -n '^(diff --git|Subject:|@@)|translateToString|BufferLine|wcwidth|unicode' \
config/patches/@[email protected] | head -100
printf '%s\n' '--- package manifest and lock entries ---'
sed -n '140,220p' package.json
sed -n '1,35p' pnpm-lock.yamlRepository: stablyai/orca
Length of output: 50370
🌐 Web query:
xterm.js 6.1.0 BufferLine translateToString wide characters combining characters cell width source
💡 Result:
In xterm.js 6.1.0, the BufferLine.translateToString method is the internal mechanism used to serialize a buffer line into a string [1]. It handles wide and combining characters through the following logic: 1. Handling Wide Characters: The BufferLine stores character content, including width information, in its internal data structures [1][2]. During the translation loop, translateToString retrieves the width of a cell from the content data using (content >> Content.WIDTH_SHIFT) || 1 [1]. This ensures that the loop correctly advances the column index by 2 for wide characters (which have a width of 2), preventing the inclusion of the empty/null cell typically found immediately after a wide character in the buffer [1]. 2. Handling Combining Characters: Combining characters are managed via a dedicated _combined array [1][2]. If a cell's content flags indicate it is a combined cell (Content.IS_COMBINED_MASK), the method retrieves the string representation from this._combined[startCol] instead of the primary codepoint [1]. This allows xterm.js to correctly render grapheme clusters that consist of a base character and one or more combining marks as a single rendered unit in the resulting string [1]. 3. Source and Implementation: The implementation of translateToString iterates through the buffer line by column [1]. For each cell, it checks for the IS_COMBINED_MASK flag to decide whether to fetch from the _combined cache or convert the stored codepoint directly to a string [1]. Recent updates in version 6.1.0 and surrounding releases included performance optimizations, such as the use of a StringBuilder to improve the efficiency of the string concatenation process [3]. The outColumns parameter, if provided, tracks the mapping between the resulting string and the original column indices, which is useful when dealing with wide characters where multiple string indices may map back to the same terminal cell [1].
Citations:
- 1: https://github.com/xtermjs/xterm.js/blob/master/src/common/buffer/BufferLine.ts
- 2: https://cdn.jsdelivr.net/npm/[email protected]/src/common/buffer/BufferLine.ts
- 3: xtermjs/xterm.js@42facac
🌐 Web query:
site:github.com/xtermjs/xterm.js BufferLine.ts "outColumns" "translateToString"
💡 Result:
The translateToString method in BufferLine.ts of the xterm.js library is used to convert the contents of a terminal buffer line into a string [1]. The optional outColumns parameter is an array used to map each character index in the resulting string back to its corresponding column index in the terminal buffer [1]. Key details regarding this method include: Mapping Logic: When outColumns is provided, the method populates it such that outColumns[i] stores the original buffer column index for the character at position i in the generated string [1]. If a single terminal cell results in multiple UTF-16 code units (e.g., surrogate pairs or combined characters), all corresponding positions in outColumns will share the same column index [1]. Trailing Entry: After processing the string, an additional value is pushed to outColumns. Specifically, outColumns[returnedString.length] indicates the column index where the character immediately following the returned string would be displayed [1]. Usage: - trimRight (boolean): If true, trailing whitespace is removed from the resulting string [1]. - startCol and endCol (numbers): Define the range of columns to include in the translation [1]. - outColumns (number[]): The array to be populated with column mappings [1]. This mechanism is particularly useful for features that require synchronizing UI elements—such as accessibility trees or selection highlighting—with the underlying terminal buffer data [2].
Citations:
- 1: https://github.com/xtermjs/xterm.js/blob/master/src/common/buffer/BufferLine.ts
- 2: GitHub pull request 4742 in xtermjs/xterm.js (link omitted to avoid creating a cross-reference)
🌐 Web query:
site:github.com/xtermjs/xterm.js "translateToString(trimRight" "outColumns"
💡 Result:
The translateToString method is a function defined in the xterm.js library, specifically within the BufferLine class, used to convert buffer line content into a string [1][2]. The parameters perform the following functions: - trimRight (boolean, optional): If set to true, trailing whitespace is removed from the resulting string [1]. - outColumns (number[], optional): An array that, if provided, will be populated with the original column indices corresponding to each character in the returned string [1]. This is useful for mapping characters back to their positions in the terminal buffer, particularly when a single cell translates into multiple UTF-16 code units (e.g., surrogate pairs), in which case the corresponding entries in the array will share the same column index [1]. In essence, this method allows the library to extract a human-readable string representation of a terminal line while maintaining metadata about the spatial mapping of those characters if needed [1].
Citations:
- 1: https://github.com/xtermjs/xterm.js/blob/master/src/common/buffer/BufferLine.ts
- 2: https://github.com/xtermjs/xterm.js/blob/master/src/common/buffer/Types.ts
Map translated characters back to xterm cells. BufferLine.translateToString(false) returns UTF-16 text, while pane.terminal.cols uses cell columns. Combining sequences and wide BMP characters can therefore shift center, producing incorrect click coordinates. Use translateToString’s outColumns mapping when converting the match to col and row.
* fix(release): recover immutable patch validation gates * test(e2e): locate wrapped terminal file links * test(e2e): keep sibling file links on one terminal row (cherry picked from commit 59515be)
* fix(release): recover immutable patch validation gates * test(e2e): locate wrapped terminal file links * test(e2e): keep sibling file links on one terminal row
Summary
unzipon the Ubuntu 20.04 skill-sharing release gateWhy
Production release run 33150945871 exposed release-only CI harness failures after creating the immutable
v1.4.191tag and draft. The app artifacts are based on approved source9a15f5090e610b4567ed3ca7d268751b9b3d5c53; this PR repairs only the gates needed to validate and publish that existing tag.Validation
pnpm tcpassedRecovery safety
v1.4.191github.workflow_sha; release product/build sources remain at the immutable tag