Skip to content

Preserve Skill Planner grid scroll position across plan updates#115

Open
SamFinni wants to merge 1 commit intomgoeppner:mainfrom
SamFinni:fix/skill-planner-scroll-position
Open

Preserve Skill Planner grid scroll position across plan updates#115
SamFinni wants to merge 1 commit intomgoeppner:mainfrom
SamFinni:fix/skill-planner-scroll-position

Conversation

@SamFinni
Copy link

Summary

  • Fixes the lvSkills ListView resetting scroll to the top on every plan update

Root cause

TopItem (uses LVM_SCROLL internally) is silently ignored while WM_SETREDRAW is FALSE inside BeginUpdate/EndUpdate. Additionally, focusedItem.Focused = true triggers EnsureVisible, which scrolls away from the saved position before EndUpdate even fires.

Fix

Capture the top-visible item's tag hash before the rebuild and restore it via a new RestoreScrollPosition() helper called after EndUpdate() in both UpdateSkillList() and UpdateListColumns() - mirroring the existing StoreSelection/RestoreSelection pattern.

The lvSkills ListView was resetting its scroll position to the top on
every plan/character change because TopItem (LVM_SCROLL) is silently
ignored while WM_SETREDRAW is FALSE inside BeginUpdate/EndUpdate.
focusedItem.Focused also triggers EnsureVisible, compounding the issue.

Fix: capture the top-visible item's tag hash before the rebuild and
restore it via a new RestoreScrollPosition() helper called after
EndUpdate() in both UpdateSkillList() and UpdateListColumns(), mirroring
the existing StoreSelection/RestoreSelection pattern.
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.

1 participant