Skip to content

fix(arte): alinea wordmark, vitral, fragua, escudos y cartel (#12) - #49

Open
blippip69 wants to merge 1 commit into
Bitcoindefi:mainfrom
blippip69:fix/city-art-alignment
Open

fix(arte): alinea wordmark, vitral, fragua, escudos y cartel (#12)#49
blippip69 wants to merge 1 commit into
Bitcoindefi:mainfrom
blippip69:fix/city-art-alignment

Conversation

@blippip69

Copy link
Copy Markdown
Contributor

fix(arte): cinco desalineaciones del arte de la ciudad (#12)

Corregido

  1. Wordmark RUNA cizallado (lib/render.js): cada fila del logo se centraba
    por 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 en
    columna.
  2. Vitral de la iglesia (lib/map.js): los costados medían 7 contra 8 del
    marco superior/inferior. Igualados a 8 (| \+/ |).
  3. Caja de la fragua zigzagueante: el techo terminaba en x+39 mientras la
    caja termina en x+43. Los tramos ^^^^^ ahora cubren exactamente la misma
    huella (38 chars desde x+5 → mismo borde derecho que la fila inferior).
  4. Escudos de la armería: las tres filas tenían anchos 26/28/31 y cada
    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.
  5. Cartel de la taberna tapado por el techo: los writes del cartel se
    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 logo
    centradas comparten columna de arranque
  • tavern hanging sign survives the roof drawing|()| sigue visible tras
    renderizar el mapa
# tests = 67/67 pass
# asserts = 517/517 pass

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.

@gitar-bot

gitar-bot Bot commented Aug 25, 2026

Copy link
Copy Markdown
CI failed: Prettier code formatting check failed on test/index.js during the lint step.

Overview

1 unique failure pattern found across 1 analyzed log. The build failed due to a code style check violation during the linter step.

Failures

Prettier Formatting Check Failure (confidence: high)

  • Type: tooling
  • Affected jobs: 97954049415
  • Related to change: yes
  • Root cause: The file test/index.js contains formatting issues that violate the project's Prettier rules, causing npm run lint to fail.
  • Suggested fix: Run npx prettier . --write locally, then commit and push the resulting formatting changes.

Summary

  • Change-related failures: 1 code style/linting failure
  • Infrastructure/flaky failures: 0
  • Recommended action: Format the affected file using Prettier and update the pull request.
Code Review ⚠️ Changes requested 0 resolved / 3 findings

Fixes five art misalignment issues in the city graphics with corresponding adjustments to rendering logic. However, the tavern-sign test is a silent no-op, the wordmark test imports an unexported constant, and a dead variable remains.

⚠️ Bug: Tavern-sign regression test is a silent no-op

📄 test/index.js:1155-1163 📄 lib/map.js:1443-1457

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')
  }
})
⚠️ Bug: Wordmark test imports unexported WORDMARK_LINES

📄 test/index.js:1128 📄 test/index.js:1138 📄 lib/render.js:1418-1432

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
💡 Quality: Dead variable sceneWidth after padding rework

📄 lib/render.js:559

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.

🤖 Prompt for agents
Code Review: Fixes five art misalignment issues in the city graphics with corresponding adjustments to rendering logic. However, the tavern-sign test is a silent no-op, the wordmark test imports an unexported constant, and a dead variable remains.

1. ⚠️ Bug: Tavern-sign regression test is a silent no-op
   Files: test/index.js:1155-1163, lib/map.js:1443-1457

   `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(...)`.

   Fix (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')
     }
   })

2. ⚠️ Bug: Wordmark test imports unexported WORDMARK_LINES
   Files: test/index.js:1128, test/index.js:1138, lib/render.js:1418-1432

   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`.

   Fix (Add WORDMARK_LINES to render.js exports so the test's loop bound works.):
   module.exports = {
     titleScreen,
     newGameScreen,
     LOGO,
     WORDMARK_LINES,
     // constants

3. 💡 Quality: Dead variable sceneWidth after padding rework
   Files: lib/render.js:559

   `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.

Tip

Comment Gitar fix CI or enable auto-apply: gitar auto-apply:on

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

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

Comment thread test/index.js
Comment on lines +1155 to +1163
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')
}
})

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ 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 👍 / 👎

Comment thread test/index.js
})

test('title screen wordmark rows stay aligned (issue #12)', () => {
const { titleScreen, LOGO, WORDMARK_LINES } = require('../lib/render.js')

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ 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 👍 / 👎

Comment thread lib/render.js
@@ -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))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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 👍 / 👎

@leocagli

Copy link
Copy Markdown
Collaborator

El CI ya corrio (habilite la ejecucion, estaba esperando aprobacion de mantenedor). Dejé el detalle de todos tus PRs juntos en #50 para no repetirlo seis veces: #50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants