Skip to content

fix(menu): prioritize obsolete feature detection over restart#1205

Merged
alandtse merged 3 commits into
community-shaders:devfrom
davo0411:checking-error
Jun 26, 2025
Merged

fix(menu): prioritize obsolete feature detection over restart#1205
alandtse merged 3 commits into
community-shaders:devfrom
davo0411:checking-error

Conversation

@davo0411
Copy link
Copy Markdown
Collaborator

@davo0411 davo0411 commented Jun 26, 2025

Fixed obsolete feature UI logic that incorrectly displayed "This feature will be available after restart" for removed features like TerrainBlending. Now prioritizes obsolete feature detection before checking INI file existence, ensuring proper error messages are shown. Also prevents duplicate error display by excluding obsolete features from the Error section since DrawUnloadedUI() already handles their messaging appropriately.

Summary by CodeRabbit

  • New Features

    • Improved menu UI to clearly indicate when features are obsolete, including detailed error information for such features.
  • Bug Fixes

    • Suppressed error messages for failed loads of obsolete features to reduce unnecessary alerts.
  • Refactor

    • Updated the display logic so that obsolete features are hidden from the "Unloaded Features" menu section for regular users, but remain visible in developer mode.

davo0411 and others added 3 commits June 26, 2025 18:01
Automated formatting by clang-format, prettier, and other hooks.
See https://pre-commit.ci for details.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 26, 2025

Walkthrough

The changes update the menu UI rendering logic to explicitly handle obsolete features. When drawing settings for unloaded features, the code now checks for obsolescence and adjusts the UI and error message display accordingly. Obsolete features are hidden from normal users but remain visible in developer mode.

Changes

File(s) Change Summary
src/Menu.cpp Added explicit checks for obsolete features in settings UI rendering, updated error/message display, and adjusted feature filtering for developer mode.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Menu
    participant Feature
    participant FeatureIssues

    User->>Menu: Open Settings
    Menu->>Feature: IsLoaded?
    alt Feature not loaded
        Menu->>FeatureIssues: IsObsoleteFeature?
        alt Obsolete
            Menu->>Feature: DrawUnloadedUI(errorInfo)
        else Not obsolete
            Menu->>Feature: HasIniFile?
            alt INI exists
                Menu->>Feature: ShowPendingRestartMsg()
            else
                Menu->>Feature: DrawUnloadedUI(errorInfo)
            end
        end
    else Feature loaded
        Menu->>Feature: DrawSettingsUI()
    end
Loading

Possibly related PRs

Suggested reviewers

  • doodlum

Poem

In the warren of menus, a change hops through,
Obsolete features now hidden from view.
Unless you’re a dev, with a keen rabbit’s eye,
The old and the dusty just pass you by.
🐇✨
Settings now clearer, with less to confuse,
This bunny approves—good work, clever crews!


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b60270e and a36d36e.

📒 Files selected for processing (1)
  • src/Menu.cpp (2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/Menu.cpp (3)
src/FeatureIssues.cpp (2)
  • IsObsoleteFeature (714-718)
  • IsObsoleteFeature (714-714)
src/Utils/FileSystem.cpp (2)
  • GetFeatureIniPath (39-42)
  • GetFeatureIniPath (39-39)
src/Utils/UI.cpp (2)
  • HoverTooltipWrapper (19-26)
  • HoverTooltipWrapper (28-34)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Build plugin and addons
  • GitHub Check: Feature Version Audit (PR)
🔇 Additional comments (4)
src/Menu.cpp (4)

840-844: Excellent fix! Correctly prioritizes obsolete feature detection.

This change properly addresses the core issue by checking for obsolete features before evaluating INI file existence. The logic flow now ensures that obsolete features (like TerrainBlending) will always display appropriate error information via DrawUnloadedUI() rather than incorrectly showing restart messages.


844-860: Good restructuring of download link logic.

Moving the download link code inside the conditional block for non-obsolete features is correct. This ensures that obsolete features won't display download links (since they're no longer available), while preserving the functionality for legitimately missing features.


865-866: Smart elimination of duplicate error messages.

Adding the obsolete feature check to the error message condition prevents redundant error display. Since DrawUnloadedUI() already handles appropriate messaging for obsolete features, excluding them from the separate "Error" section avoids confusion and improves UI clarity.


1070-1070: Excellent user experience enhancement.

The filter modification appropriately hides obsolete features from regular users in the "Unloaded Features" section while preserving visibility for developers. This improves the user experience by reducing clutter of unusable features while maintaining debugging capabilities.

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions
Copy link
Copy Markdown

Using provided base ref: b60270e
Using base ref: b60270e
Base commit date: 2025-06-25T23:51:08-07:00 (Wednesday, June 25, 2025 11:51 PM)
No actionable suggestions for changed features.

@alandtse
Copy link
Copy Markdown
Collaborator

@coderabbitai please provide a conventional commit within char limits that covers the changes

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 26, 2025

Tip

For best results, initiate chat on the files or code changes.

@alandtse Here's a conventional commit message that covers the changes:

fix(menu): prioritize obsolete feature detection over restart messages

This 65-character commit message captures the core fix. If you need a more detailed body, it could be:

fix(menu): prioritize obsolete feature detection over restart messages

- Check for obsolete features before INI file existence
- Hide obsolete features from unloaded features list for regular users
- Prevent duplicate error messages for obsolete features

@alandtse alandtse changed the title fix: prioritize obsolete feature detection over restart msg, hide obsolete features from unloaded features fix(menu): prioritize obsolete feature detection over restart Jun 26, 2025
@github-actions
Copy link
Copy Markdown

✅ A pre-release build is available for this PR:
Download

@alandtse alandtse merged commit 8afbaa1 into community-shaders:dev Jun 26, 2025
17 checks passed
@davo0411 davo0411 deleted the checking-error branch June 30, 2025 11:59
alandtse pushed a commit to alandtse/open-shaders that referenced this pull request Jul 20, 2025
…ity-shaders#1205)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
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