Skip to content

PRD: Searchable and Highlighted Settings Dialog #73

@mrpilot2

Description

@mrpilot2

Problem Statement

Currently, the settings dialog in Simcraft Aide is not searchable. As the number of settings pages and options grows, users find it increasingly difficult and time-consuming to locate specific settings. There is no way to filter the navigation tree or quickly identify where a particular option resides on a page.

Solution

Enhance the SettingsDialog with a search field that provides real-time filtering of the settings navigation tree. When a user types a search pattern, the tree should only show pages that match the pattern (either by page name or by the content of the GUI elements on that page). Additionally, matching GUI elements (labels, buttons, etc.) on the currently viewed settings page should be visually highlighted with a brownish-orange border to make them immediately identifiable.

User Stories

  1. As a user, I want to type into a search field in the settings dialog, so that I can quickly filter the settings pages.
  2. As a user, I want the settings tree to update in real-time as I type, so that I can see which pages contain relevant options.
  3. As a user, I want the search to be case-insensitive, so that I don't have to worry about exact capitalization while searching.
  4. As a user, I want to see the parent items of matching pages in the tree, so that I maintain context of where the page is located in the hierarchy.
  5. As a user, I want matching GUI elements on a settings page to be highlighted with a brownish-orange border, so that I can easily spot the specific setting I was looking for.
  6. As a user, I want to be able to clear the search field easily, so that I can quickly return to the full list of settings.
  7. As a user, I want the "Reset" and "Apply" buttons to remain functional regardless of whether a search filter is active.

Implementation Decisions

  • Search Field: Add a QLineEdit (search field) above the QTreeView in the SettingsDialog.
  • Tree Filtering: Implement a QSortFilterProxyModel that sits between the SettingsPageGroupTreeModel and the QTreeView.
    • The filter logic will show a page if its display name matches the pattern OR if any GUI element on the page matches the pattern.
    • If a child node matches, all its ancestors will be shown to preserve the tree structure.
  • Searchable Content: The SettingsPage interface will be extended with methods to:
    • Return whether the page or its child widgets match a given string (searching through QLabel texts, QCheckBox texts, etc.).
    • Apply/remove highlights on matching child widgets.
  • Highlighting: Use Qt Style Sheets (QSS) to apply a border: 2px solid #8B4513; (brownish-orange) to widgets that match the search string.
  • Controller Logic: Update SettingsDialogController and its core counterpart to handle the flow of search text from the GUI to the filtering and highlighting logic.

Testing Decisions

  • Unit Tests:
    • Test the QSortFilterProxyModel logic to ensure it correctly identifies matching pages and keeps parent nodes visible.
    • Test the matches logic on sample SettingsPage implementations to ensure it correctly finds text in various widget types (labels, checkboxes, buttons).
  • Manual Verification:
    • Verify that typing in the search field filters the tree correctly.
    • Verify that navigating to a filtered page highlights the correct elements.
    • Verify that clearing the search restores the original state and removes highlights.

Out of Scope

  • Highlighting the text within the tree items themselves (only filtering is required).
  • Advanced search features like regex or fuzzy matching (substring matching is sufficient).
  • Searching within tooltips or dynamically generated content not present in the widget tree.

Further Notes

  • The brownish-orange color was specifically requested for the highlight border.
  • The tree structure must be maintained even when filtering, ensuring users always know the context of a page.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions