Skip to content

feat(worldbuilder): Search Filter for Script Actions and Conditions for ZH Worldbuilder - #3483

Closed
WebbontheWeb wants to merge 2 commits into
TheSuperHackers:mainfrom
WebbontheWeb:feature/worldbuilder-picker-search
Closed

WebbontheWeb wants to merge 2 commits into
TheSuperHackers:mainfrom
WebbontheWeb:feature/worldbuilder-picker-search

Conversation

@WebbontheWeb

@WebbontheWeb WebbontheWeb commented Oct 12, 2026 •

Copy link
Copy Markdown

While creating test maps, I got really annoyed by the inability to filter the script action and condition trees. This PR adds a search box that allows users to filter, hopefully making that process much easier.

I also moved the tree building code shared by EditAction and EditCondition into ScriptTemplateTree. It seemed to make sense since it was copied and pasted between the 2.

The Generals worldbuilder uses a dropdown instead of a tree, so this doesn't update that.

I've tested by filtering on edit and create, making sure it saves, with non-English characters, with items selected, etc.

searchworldbuilder

I'd also like to add filter to the object tree if this works out well. Built and validated with help from AI.

@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3fb88c2b-e277-428d-977a-ef6a1ed326a9
📥 Commits

Reviewing files that changed from the base of the PR and between 06ca845 and 346b53e.

📒 Files selected for processing (3)
  • GeneralsMD/Code/Tools/WorldBuilder/include/EditAction.h
  • GeneralsMD/Code/Tools/WorldBuilder/include/EditCondition.h
  • GeneralsMD/Code/Tools/WorldBuilder/src/ScriptTemplateTree.cpp

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

Walkthrough

WorldBuilder’s script action and condition dialogs now provide search fields. A shared function filters template names and rebuilds each tree while retaining the selected template when it matches.

Changes

Script-template search

Layer / File(s) Summary
Shared template-tree population
GeneralsMD/Code/Tools/WorldBuilder/include/ScriptTemplateTree.h, GeneralsMD/Code/Tools/WorldBuilder/src/ScriptTemplateTree.cpp, GeneralsMD/Code/Tools/WorldBuilder/CMakeLists.txt
Adds a shared tree-population function. It matches every search word against template names without case sensitivity, preserves the selected template when it matches, and expands and scrolls the filtered results.
Search-enabled action and condition dialogs
GeneralsMD/Code/Tools/WorldBuilder/res/WorldBuilder.rc, GeneralsMD/Code/Tools/WorldBuilder/res/resource.h, GeneralsMD/Code/Tools/WorldBuilder/include/EditAction.h, GeneralsMD/Code/Tools/WorldBuilder/include/EditCondition.h, GeneralsMD/Code/Tools/WorldBuilder/src/EditAction.cpp, GeneralsMD/Code/Tools/WorldBuilder/src/EditCondition.cpp
Adds search fields to both dialogs and connects search edits to the shared function. Each dialog ignores selection notifications during tree rebuilds. Enter in the search field moves focus to the tree instead of closing the dialog.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant EditAction
  participant populateTemplateTree
  participant CTreeCtrl
  User->>EditAction: Edits the search field
  EditAction->>populateTemplateTree: Passes search text, template accessor, and selected index
  populateTemplateTree->>CTreeCtrl: Rebuilds and selects matching template items
Loading
Merge Risk: ⚪ Minimal · up to 346b5

The supplied evidence identifies no issue that needs to be resolved before merging.

Pre-merge checks · Passed 4
Passed Passed checks (4 passed)
Check name Status Explanation
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description clearly explains the search filter for script action and condition trees and the shared tree-building refactor. It also states testing performed and the scope limitation for the Genera…
Title check Passed The title clearly identifies the main change: adding search filters for script actions and conditions in the ZH Worldbuilder.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@WebbontheWeb WebbontheWeb changed the title feature(worldbuilder): Search Filter for Script Actions and Conditions to ZH Worldbuilder feature(worldbuilder): Search Filter for Script Actions and Conditions for ZH Worldbuilder Oct 12, 2026
@WebbontheWeb
WebbontheWeb force-pushed the feature/worldbuilder-picker-search branch from 4bfba17 to 06ca845 Compare October 12, 2026 01:30
@WebbontheWeb WebbontheWeb changed the title feature(worldbuilder): Search Filter for Script Actions and Conditions for ZH Worldbuilder feat(worldbuilder): Search Filter for Script Actions and Conditions for ZH Worldbuilder Oct 12, 2026
@WebbontheWeb
WebbontheWeb marked this pull request as ready for review October 12, 2026 01:56
@greptile-apps

greptile-apps Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; the previous finding is fixed and no new actionable issues remain.

Summary

Adds search boxes to Zero Hour WorldBuilder’s script action and condition dialogs.

  • Action and condition trees now filter as you type.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    Search[User changes search text] --> Guard[Ignore selection changes]
    Guard --> Rebuild[Rebuild matching template tree]
    Rebuild --> Restore[Restore current selection if shown]
    Restore --> Resume[Resume selection changes]
    Resume --> Choose[User selects a different template]
    Choose --> Update[Update type and parameters]
Loading

Reviews (2) · Last reviewed commit: "feat(worldbuilder): Add search filter to..." · Reviewed by Greptile

Comment thread GeneralsMD/Code/Tools/WorldBuilder/src/ScriptTemplateTree.cpp Outdated
@WebbontheWeb
WebbontheWeb force-pushed the feature/worldbuilder-picker-search branch from 06ca845 to 346b53e Compare October 12, 2026 02:03
@Skyaero42

Copy link
Copy Markdown

Might want to check with what @AdrianeYves had done to worldbuilder

@WebbontheWeb

WebbontheWeb commented Oct 13, 2026 •

Copy link
Copy Markdown
Author

@Skyaero42 My bad, I wasn't aware of a separate fork focused on that. I checked if there was a similar implementation and there is.

Mine does work slightly differently. It filters as you type, matches words separately, and keeps the folders (only showing the ones that match or with matching subitems expanded).

I think it'd be useful to have within main. That being said, I can close this out as unneeded if we don't want update the world builder here or are waiting to merge that in.

@Skyaero42

Copy link
Copy Markdown

@WebbontheWeb I have no opinion on it. However, there is not a lot of Worldbuilder knowledge among reviewers here. In the end, it would be great if all the features that @AdrianeYves has implemented are ported over to this repo - feature by feature. So imho it would be good to confer with Adriane before doing double work.

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.

2 participants