Skip to content

fix: keep ficha and log on city screens between 64 and 90 columns (#7) - #42

Open
blippip69 wants to merge 1 commit into
Bitcoindefi:mainfrom
blippip69:fix/force-sidebar-min-width
Open

fix: keep ficha and log on city screens between 64 and 90 columns (#7)#42
blippip69 wants to merge 1 commit into
Bitcoindefi:mainfrom
blippip69:fix/force-sidebar-min-width

Conversation

@blippip69

Copy link
Copy Markdown
Contributor

fix: keep ficha and log on city screens between 64 and 90 columns (#7)

…tcoindefi#7)

mapScreen dropped the sidebar whenever width - SIDE_W - 5 fell below a min(mapW, 60) estimate, which silenced both panels for every terminal from 64 to 90 columns even though the map scrolls inside its pane anyway - so working actions left an identical screen while model state moved. The split layout threshold is now simply MIN_WIDTH, matching field and shop screens, with the explicit sidebar:false opt-out preserved.
Comment thread lib/render.js
*/
function mapScreen(m) {
const tiles = (m.map && m.map.tiles) || []
const cellW = Math.max(1, m.cellW || CELL_W)

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: Unused cellW local variable left in mapScreen

The diff removed the mapW/tiles calculation that was the only consumer of the local const cellW = Math.max(1, m.cellW || CELL_W). The map pane is rendered with mapPane(m.map, w, h, { cellW: m.cellW }), which uses m.cellW directly and ignores the local clamped value, so cellW is now dead code. Remove the line to avoid confusion (and note the clamping/CELL_W fallback no longer applies here—if that fallback was intended for the pane, pass the local cellW to mapPane instead).

Was this helpful? React with 👍 / 👎

@gitar-bot

gitar-bot Bot commented Aug 25, 2026

Copy link
Copy Markdown
Code Review 👍 Approved with suggestions 0 resolved / 1 findings

Fixes sidebar and log visibility on city screens across 64 to 90 column layouts. Consider cleaning up the unused cellW local variable left in mapScreen.

💡 Quality: Unused cellW local variable left in mapScreen

📄 lib/render.js:1317

The diff removed the mapW/tiles calculation that was the only consumer of the local const cellW = Math.max(1, m.cellW || CELL_W). The map pane is rendered with mapPane(m.map, w, h, { cellW: m.cellW }), which uses m.cellW directly and ignores the local clamped value, so cellW is now dead code. Remove the line to avoid confusion (and note the clamping/CELL_W fallback no longer applies here—if that fallback was intended for the pane, pass the local cellW to mapPane instead).

🤖 Prompt for agents
Code Review: Fixes sidebar and log visibility on city screens across 64 to 90 column layouts. Consider cleaning up the unused cellW local variable left in mapScreen.

1. 💡 Quality: Unused `cellW` local variable left in mapScreen
   Files: lib/render.js:1317

   The diff removed the `mapW`/`tiles` calculation that was the only consumer of the local `const cellW = Math.max(1, m.cellW || CELL_W)`. The map pane is rendered with `mapPane(m.map, w, h, { cellW: m.cellW })`, which uses `m.cellW` directly and ignores the local clamped value, so `cellW` is now dead code. Remove the line to avoid confusion (and note the clamping/`CELL_W` fallback no longer applies here—if that fallback was intended for the pane, pass the local `cellW` to `mapPane` instead).

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

@leocagli

Copy link
Copy Markdown
Collaborator

Merged onto current main, the tests pass. npm run lint does not:

Checking formatting...
[warn] <the new test file>
[warn] Code style issues found in the above file. Run Prettier with --write to fix.

The repository runs prettier . --check as part of npm run lint, and CI runs
lint as its own job, so this alone turns the build red.

npm run format fixes it in one pass. Nothing else needs to change; the code itself
is fine.

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.

3 participants