Skip to content

Add search bar to Preferences menu#9645

Merged
tool4ever merged 2 commits intoCard-Forge:masterfrom
MostCromulent:searchpreferences
Jan 31, 2026
Merged

Add search bar to Preferences menu#9645
tool4ever merged 2 commits intoCard-Forge:masterfrom
MostCromulent:searchpreferences

Conversation

@MostCromulent
Copy link
Contributor

Screenshot 2026-01-31 220219

There are a lot of preference settings in Forge. This PR adds a search bar to the Game Settings > Preferences menu allowing users to quickly filter preference settings by keywords.

Features:

  • Real-time filtering as you type with 200ms debounce
  • Matches preference labels, descriptions, and section names
  • Searching section names (e.g., "shortcuts", "sound") reveals entire sections
  • Keyboard shortcuts searchable by their descriptions
  • Hidden items collapse cleanly with no gaps

Implementation

  • Fully backward compatible - no changes to existing preference code or styling. The search index is built by scanning the panel's existing components after construction, then tracking them for show/hide filtering.

Key components:

  • PreferenceItem / Section classes track components and searchable text
  • buildSearchIndex() scans existing panel children
  • applySearch() toggles visibility based on query matches
  • MigLayout hidemode 3 removes gaps for hidden components

Code authored by Claude (Opus 4.5) under human direction and review.

MostCromulent and others added 2 commits January 31, 2026 22:22
Add a search/filter bar to the Game Settings > Preferences panel that
filters preferences by their text content. Features include:

- Search field with "Search:" label positioned after Troubleshooting section
- 200ms debounce timer to avoid excessive filtering during typing
- Filters by preference labels, descriptions, and section names
- Searching section names (e.g., "shortcuts") shows entire section
- Uses MigLayout hidemode 3 to remove gaps for hidden components
- Keyboard shortcuts are fully searchable by their descriptions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove unused Section.name field
- Use enhanced for-loop for component iteration
- Extract containsComponent helper method
- Consolidate duplicate preference-saving logic
- Simplify getComponentText method
- Condense anonymous class to single line

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@tool4ever tool4ever added the QOL Quality of Life label Jan 31, 2026
Copy link
Contributor

@tool4ever tool4ever left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice work

@tool4ever tool4ever merged commit b2964ee into Card-Forge:master Jan 31, 2026
2 checks passed
@MostCromulent MostCromulent deleted the searchpreferences branch February 1, 2026 05:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

QOL Quality of Life

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants