원클릭으로
debug-ui-layout
Optimize text copy to fit rendered UI layout using spacewave-debug eval to measure exact line breaks and eliminate orphans.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Optimize text copy to fit rendered UI layout using spacewave-debug eval to measure exact line breaks and eliminate orphans.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
| name | debug-ui-layout |
| description | Optimize text copy to fit rendered UI layout using spacewave-debug eval to measure exact line breaks and eliminate orphans. |
Use the spacewave-debug eval bridge to iteratively measure how text copy renders at actual viewport widths, then adjust wording to produce clean line breaks without orphans.
Find the section by its DOM id or heading text:
go run ./cmd/spacewave-debug/ eval "document.getElementById('section-id')?.querySelector('h2')?.textContent"
Write an eval script to .tmp/eval-{section}.js that collects width, height, line count, and line-height for every text element in the section:
var section = document.getElementById("section-id")
if (!section) return "no section"
var ps = section.querySelectorAll("p")
var res = []
for (var i = 0; i < ps.length; i++) {
var p = ps[i]
var rect = p.getBoundingClientRect()
var style = getComputedStyle(p)
var lines = Math.round(rect.height / parseFloat(style.lineHeight))
res.push("p" + i + " w:" + Math.round(rect.width) + " h:" + Math.round(rect.height) + " lines:" + lines + " lh:" + style.lineHeight + " | " + p.textContent.substring(0, 90))
}
return res.join("\n")
Run with:
go run ./cmd/spacewave-debug/ eval --file .tmp/eval-{section}.js
Use the DOM Range API to determine where each line wraps at the rendered width:
var section = document.getElementById("section-id")
if (!section) return "no section"
var cards = section.querySelectorAll("p")
var res = []
for (var idx = 0; idx < cards.length; idx++) {
var p = cards[idx]
var text = p.textContent
var range = document.createRange()
var node = p.firstChild
if (!node) continue
var lines = []
var lastTop = -1
var lineStart = 0
for (var i = 0; i < text.length; i++) {
range.setStart(node, i)
range.setEnd(node, i + 1)
var r = range.getBoundingClientRect()
if (lastTop !== -1 && r.top > lastTop + 2) {
lines.push(text.substring(lineStart, i))
lineStart = i
}
lastTop = r.top
}
lines.push(text.substring(lineStart))
res.push("Card " + idx + " (" + lines.length + " lines):")
for (var j = 0; j < lines.length; j++) {
res.push(" L" + (j + 1) + ": [" + lines[j] + "]")
}
}
return res.join("\n")
Common layout issues to fix:
Adjust wording to fix issues. Strategies:
After each edit:
bun fecheck to bump rev and typecheckbun fecheck that types still pass@lg, @2xl) and viewport — always measure, never guess--file flag avoids shell quoting issues with complex eval scriptsreturn.tmp/ (gitignored) for reuse during the sessionUse the spacewave-debug CLI to inspect and interact with the running page.
Use after completing implementation work to catch AGENTS.md violations, dead code, and issues missed during development. Run before showing results to the user.