Skip to content

Fix force-shown integer value not showing correct number of rows#2832

Merged
tastybento merged 1 commit intodevelopfrom
worktree-panel-force-shown-fix
Mar 8, 2026
Merged

Fix force-shown integer value not showing correct number of rows#2832
tastybento merged 1 commit intodevelopfrom
worktree-panel-force-shown-fix

Conversation

@tastybento
Copy link
Member

Summary

  • force-shown: 6 in a panel YAML was only marking row 6 as forced, not rows 1–6
  • createItemMap only advances its slot index for forced rows, so unforceed intermediate rows were skipped
  • Row 6 ended up at inventory slots 9–17 (2nd row) instead of 45–53 (6th row), producing a 2-row inventory

Fix: When force-shown is an integer N, force all rows 1 through N (indices 0 to N-1). The list form (force-shown: [2, 4]) is unchanged.

Fixes #2471

Test plan

  • Create a panel with force-shown: 6 and a background/border — confirm it opens with 6 rows
  • Create a panel with force-shown: 3 — confirm it opens with 3 rows minimum
  • force-shown: [2, 4] still forces only rows 2 and 4 individually (no regression)
  • All existing tests pass (./gradlew test)

🤖 Generated with Claude Code

When force-shown is set to an integer N, mark all rows 1 through N as
forced rather than only row N. The previous code caused intermediate
rows to be skipped in createItemMap (which only advances its slot index
for forced rows), so force-shown: 6 produced a 2-row inventory instead
of 6.

Fixes #2471

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 4, 2026

@tastybento tastybento merged commit 802d485 into develop Mar 8, 2026
3 checks passed
@tastybento tastybento deleted the worktree-panel-force-shown-fix branch March 8, 2026 23:31
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.

Panel force_shown does not work

1 participant