Skip to content

sort: apply justice filters to the visible cases tab - #5927

Open
Alistair-Afton wants to merge 1 commit into
DFHack:developfrom
Alistair-Afton:fix-cold-cases-filters
Open

Alistair-Afton wants to merge 1 commit into
DFHack:developfrom
Alistair-Afton:fix-cold-cases-filters

Conversation

@Alistair-Afton

Copy link
Copy Markdown
Contributor

Summary

  • The justice filter overlays (interrogation and conviction) installed their filter and sent their resort poke to the unit list under the "Open cases" tab unconditionally, since dfhack.gui.getWidget finds hidden tabs by name too
  • get_unit_list now iterates the Tabs children and uses the tab flagged VISIBILITY_VISIBLE, matching the logic Gui.cpp uses to build focus strings
  • poke_list now tolerates a missing unit list instead of erroring

Fixes #5577

Testing

  • New fortress-mode tests in test/plugins/sort.lua mock the justice tab hierarchy and verify the resort flag lands on the visible tab's Interrogate/Convict list for both Open cases and Cold cases, and that render() installs the filter on the visible list
  • Tests failed before the fix (filter and poke hit the hidden Open cases list) and pass after
  • Verified the real justice screen's tab children and VISIBILITY_VISIBLE flags match the mocked structure

get_unit_list() looked up the "Open cases" unit list by name first, but
named widget lookup finds hidden tabs too, so the filter was always
installed on (and refreshes poked) the hidden list while the Cold cases
tab was shown. Iterate the Tabs children and use the tab flagged
VISIBILITY_VISIBLE, matching Gui.cpp's focus-string logic.

Fixes DFHack#5577
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.

Filters in cold cases justice screen are not working

1 participant