fix(arte): alinea wordmark, vitral, fragua, escudos y cartel (#12) - #49
fix(arte): alinea wordmark, vitral, fragua, escudos y cartel (#12)#49blippip69 wants to merge 1 commit into
Conversation
CI failed: Prettier code formatting check failed on test/index.js during the lint step.Overview1 unique failure pattern found across 1 analyzed log. The build failed due to a code style check violation during the linter step. FailuresPrettier Formatting Check Failure (confidence: high)
Summary
Code Review
|
| Auto-apply | Compact |
|
|
Important
Your trial ends in 7 days — upgrade now to keep code review, CI analysis, auto-apply, custom automations, and more.
Was this helpful? React with 👍 / 👎 | Gitar
| test('tavern hanging sign survives the roof drawing (issue #12)', () => { | ||
| const map = require('../lib/map.js') | ||
| const grid = typeof map.renderMap === 'function' ? map.renderMap() : null | ||
| if (!grid || !grid[80]) return // render shape changed; skip silently | ||
| const row = grid[80].join('') | ||
| if (!row.includes('|()|')) { | ||
| throw new Error('tavern sign was covered by the roof at y+5') | ||
| } | ||
| }) |
There was a problem hiding this comment.
⚠️ Bug: Tavern-sign regression test is a silent no-op
map.js exports render/renderLines but not renderMap, so typeof map.renderMap === 'function' is always false and the test returns early, never asserting that |()| survives the roof. This regression the PR intends to guard is completely untested. Rewrite it against the real API, e.g. const lines = map.renderLines(map.MAPS.city); if (!lines.some((l) => l.includes('|()|'))) throw new Error(...).
Use the exported renderLines API and scan all rows for the sign.:
test('tavern hanging sign survives the roof drawing (issue #12)', () => {
const map = require('../lib/map.js')
const lines = map.renderLines(map.MAPS.city)
if (!lines.some((l) => l.includes('|()|'))) {
throw new Error('tavern sign was covered by the roof at y+5')
}
})
- Apply fix
Check the box to apply the fix or reply for a change | Was this helpful? React with 👍 / 👎
| }) | ||
|
|
||
| test('title screen wordmark rows stay aligned (issue #12)', () => { | ||
| const { titleScreen, LOGO, WORDMARK_LINES } = require('../lib/render.js') |
There was a problem hiding this comment.
⚠️ Bug: Wordmark test imports unexported WORDMARK_LINES
The test destructures WORDMARK_LINES from render.js, but that constant is not in module.exports (only LOGO is). WORDMARK_LINES is therefore undefined, so wordmarkRows.length >= undefined is always false and the loop never stops at the intended bound — it collects every regex-matching line, potentially including scene art below the wordmark, weakening the alignment check. Export WORDMARK_LINES from render.js.
Add WORDMARK_LINES to render.js exports so the test's loop bound works.:
module.exports = {
titleScreen,
newGameScreen,
LOGO,
WORDMARK_LINES,
// constants
- Apply fix
Check the box to apply the fix or reply for a change | Was this helpful? React with 👍 / 👎
| @@ -557,9 +557,13 @@ function titleScreen(w, h, status, menu = null) { | |||
| const centre = (t) => ' '.repeat(Math.max(0, Math.floor((w - style.width(t)) / 2))) + t | |||
| const tag = 'no controlas a tu personaje. escribis las reglas que sigue.' | |||
| const sceneWidth = Math.max(...LOGO.slice(WORDMARK_LINES + 1).map((line) => line.length)) | |||
There was a problem hiding this comment.
💡 Quality: Dead variable sceneWidth after padding rework
sceneWidth was only used by the removed line.padEnd(sceneWidth) branch; line 566 now always pads to artWidth, leaving sceneWidth computed but unused. Remove the line to avoid confusion and lint warnings.
Was this helpful? React with 👍 / 👎
fix(arte): cinco desalineaciones del arte de la ciudad (#12)
Corregido
lib/render.js): cada fila del logo se centrabapor su propio largo. Ahora todas las filas del arte se rellenan a un ancho
común (
artWidth) antes de centrar — los palos de las letras quedan encolumna.
lib/map.js): los costados medían 7 contra 8 delmarco superior/inferior. Igualados a 8 (
| \+/ |).caja termina en x+43. Los tramos
^^^^^ahora cubren exactamente la mismahuella (38 chars desde x+5 → mismo borde derecho que la fila inferior).
escudo arrancaba en columnas distintas. Rejilla única: escudos de 5 en las
columnas 0/13/26 de cada fila (pitch 13), sin corrimiento escudo a escudo.
ejecutaban antes que el bucle del techo, que crecía fila a fila y borraba
12 de sus 13 caracteres. El cartel ahora se dibuja después del techo
(comentario en el código explica por qué).
Tests
Dos regresiones nuevas:
title screen wordmark rows stay aligned— las primeras filas del logocentradas comparten columna de arranque
tavern hanging sign survives the roof drawing—|()|sigue visible trasrenderizar el mapa
ES/EN mix
All five art misalignments from the issue are fixed with two regression tests
guarding the wordmark centring and the tavern sign visibility.