Skip to content

prioritize: add 'this' action to absorb do-job-now - #1615

Open
Alistair-Afton wants to merge 1 commit into
DFHack:masterfrom
Alistair-Afton:prioritize-this
Open

Alistair-Afton wants to merge 1 commit into
DFHack:masterfrom
Alistair-Afton:prioritize-this

Conversation

@Alistair-Afton

@Alistair-Afton Alistair-Afton commented Sep 15, 2026

Copy link
Copy Markdown

Summary

New prioritize this action applies the boost to whatever is selected in the UI: job, item, building, unit, plant, or work order (DFHack/dfhack#4206). do-job-now.lua is now a thin forwarder to the new action, so existing keybindings keep working.

Also fixes a latent crash: get_selected_work_order now nil-checks viewscreen type descriptors, which are unavailable at the title screen (the original do-job-now crashed the same way).

Repaired the dormant test/prioritize.lua suite, which had silently rotted since fba07a4 (job-list iteration, denylist warnings, num_prioritized removal): updated the mocks to the current contract and re-enabled it via config.target — 32 tests, 668 checks.

Testing

  • test -t prioritize: 32/32 tests, 668/668 checks pass in-game
  • Live fort: prioritize this and do-job-now both flag a real job do_now
  • Title screen: clean error instead of nil-index crash
  • ci/lint.py clean

prioritize_this() runs the do-job-now selection cascade (job, item,
building, unit, plant, work order) and boosts the related job. The
do-job-now script now forwards to it, preserving existing keybindings.

Selection getters are module-level so tests can mock them. Enabling
config.target for the test file reactivated dormant tests written for
the pre-fba07a4 posting-based implementation; they are updated to the
current job-list iteration and matcher schema, and dig/smooth job types
are covered by a denylist warning test instead of watch expectations.

fixes DFHack/dfhack#4206
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