Skip to content

fix(ui): distinguish missing vs pending features#1188

Merged
alandtse merged 15 commits into
community-shaders:devfrom
davo0411:uninstalled-info-fix
Jun 24, 2025
Merged

fix(ui): distinguish missing vs pending features#1188
alandtse merged 15 commits into
community-shaders:devfrom
davo0411:uninstalled-info-fix

Conversation

@davo0411
Copy link
Copy Markdown
Collaborator

@davo0411 davo0411 commented Jun 24, 2025

UI Fixes for the following:

  • Uninstalled info doubling up across settings & about tab.
  • Fix for bad checks which resulted in "Feature pending restart" whenever an ini file was not detected, instead of only when it is present but not loaded.
  • Updated oddities with uninstall info for Terrain Variation, Terrain Helper and Wetness Effects.
  • Added required version info to the uninstall message to help users get the right version.

Before:
image

After:
20367A~1
20677C~1

Summary by CodeRabbit

  • New Features

    • Improved user interface feedback for unloaded features, providing clearer messages about missing features and required versions.
    • Enhanced feature descriptions for Extended Translucency, now displaying a summary and key capabilities.
  • Improvements

    • Feature status in the UI now distinguishes between features that are missing and those pending restart, with updated color coding and messages.
    • Updated descriptions for Terrain Variation to clarify its effects and compatibility.
  • Bug Fixes

    • Error messages for missing or mismatched feature versions now include the required version information.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 24, 2025

Walkthrough

This change centralizes feature version validation and formatting in utility methods, updates error and UI messages to include required version information, and introduces a pure virtual DrawUnloadedUI() method for features. UI logic is refined to distinguish between missing and pending-restart features by checking the presence of INI files.

Changes

File(s) Change Summary
src/Feature.cpp, src/Feature.h Refactored version validation into IsFeatureKnown and GetFeatureRequiredVersion; added pure virtual DrawUnloadedUI.
src/Features/TerrainHelper.cpp, src/Features/TerrainHelper.h, src/Features/WetnessEffects.cpp, src/Features/WetnessEffects.h Removed per-feature DrawUnloadedUI() and related UI/error message methods and declarations.
src/Features/TerrainVariation.cpp, src/Features/TerrainVariation.h Removed DrawFailLoadMessage method; updated summary text and bullet points for clarity and emphasis.
src/Menu.cpp Enhanced UI logic to distinguish missing vs. pending-restart features by checking INI file presence.
src/Features/ExtendedTranslucency.cpp, src/Features/ExtendedTranslucency.h Added GetFeatureSummary() method returning summary and bullet points for the feature.

Sequence Diagram(s)

sequenceDiagram
    participant Menu
    participant Feature
    participant FileSystem

    Menu->>FileSystem: Check if feature INI file exists
    alt INI file missing
        Menu->>Feature: DrawUnloadedUI()
    else INI file present
        Menu->>Menu: Show "Pending restart" message
    end
Loading
sequenceDiagram
    participant Feature
    participant FeatureVersions

    Feature->>Feature: IsFeatureKnown(shortName)
    alt Feature known
        Feature->>Feature: GetFeatureRequiredVersion(shortName)
        Feature->>Feature: Use required version in error/UI messages
    else Feature unknown
        Feature->>Feature: Use "unknown" in error/UI messages
    end
Loading

Possibly related PRs

Suggested reviewers

  • doodlum

Poem

A bunny hops through code so bright,
Refactoring versions left and right.
With errors clear and UI neat,
Features now report in style complete.
If INI’s missing, don’t you fear—
The rabbit’s messages are crystal clear!
🐇✨


📜 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 2916e33 and 5e152db.

📒 Files selected for processing (4)
  • src/Feature.cpp (6 hunks)
  • src/Feature.h (3 hunks)
  • src/Features/ExtendedTranslucency.cpp (1 hunks)
  • src/Features/ExtendedTranslucency.h (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/Features/ExtendedTranslucency.cpp
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/Feature.cpp
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Build plugin and addons
🔇 Additional comments (4)
src/Features/ExtendedTranslucency.h (1)

21-22: LGTM! Clean addition that supports the UI refactoring effort.

The new GetFeatureSummary() method follows the established virtual method pattern in this class and aligns with the broader refactoring to centralize feature summary information for improved UI feedback. The return type appropriately provides both descriptive text and feature highlights.

src/Feature.h (3)

3-3: LGTM: Include change supports new utility functions.

The change from "Menu.h" to "FeatureVersions.h" is appropriate since the new utility functions rely on FeatureVersions::FEATURE_MINIMAL_VERSIONS.


73-73: LGTM: Refactoring to pure virtual aligns with centralized UI handling.

The change from inline implementation to pure virtual declaration properly centralizes the UI rendering logic and ensures derived classes implement their own DrawUnloadedUI method. This addresses the past review comment about moving implementation from header to cpp.


97-120: LGTM: Well-designed utility functions with comprehensive documentation.

The new static utility functions provide a clean API for feature version validation and formatting:

  • GetFeatureRequiredVersion: Returns formatted version string or "unknown"
  • IsFeatureKnown: Checks feature existence with optional version output

The documentation is thorough and the function signatures are well-designed. The use of optional output parameter in IsFeatureKnown is a good pattern.

✨ 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.

Automated formatting by clang-format, prettier, and other hooks.
See https://pre-commit.ci for details.
@davo0411 davo0411 marked this pull request as ready for review June 24, 2025 02:36
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 3a5ff65 and 54477b9.

📒 Files selected for processing (9)
  • src/Feature.cpp (5 hunks)
  • src/Feature.h (2 hunks)
  • src/Features/TerrainHelper.cpp (1 hunks)
  • src/Features/TerrainHelper.h (0 hunks)
  • src/Features/TerrainVariation.cpp (1 hunks)
  • src/Features/TerrainVariation.h (1 hunks)
  • src/Features/WetnessEffects.cpp (0 hunks)
  • src/Features/WetnessEffects.h (0 hunks)
  • src/Menu.cpp (6 hunks)
💤 Files with no reviewable changes (3)
  • src/Features/WetnessEffects.h
  • src/Features/WetnessEffects.cpp
  • src/Features/TerrainHelper.h
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Build plugin and addons
🔇 Additional comments (15)
src/Features/TerrainHelper.cpp (1)

169-169: LGTM: UI method removal aligns with centralization pattern.

The removal of the DrawUnloadedUI() method is consistent with the broader refactoring to centralize unloaded feature UI handling in the base Feature class. This improves maintainability and reduces code duplication.

src/Features/TerrainVariation.cpp (1)

28-29: Verify the stronger claim about pattern removal.

The tooltip text was updated from "Reduces" to "Removes" the repeating pattern effect, which makes a stronger claim about the feature's effectiveness. Please ensure this accurately reflects the actual capability of the Terrain Variation feature.

src/Features/TerrainVariation.h (1)

26-32: Improved feature summary with clearer benefits.

The updated feature summary provides more specific and compelling benefits:

  • Changed from "reduces" to "removes" for stronger positioning
  • Added specific bullet points about comprehensive fix and compatibility
  • Better communicates the feature's value to users

The messaging is consistent with the tooltip changes in the implementation file.

src/Feature.h (2)

3-5: Good addition of utility includes for centralized functionality.

Adding includes for FeatureVersions.h and Utils/Format.h supports the centralized version formatting and error handling improvements.


78-119: Excellent improvement to error messaging and user guidance.

The enhanced DrawUnloadedUI() method provides significant improvements:

  1. Prioritized error handling: Detailed failure messages are shown first when available
  2. Informative missing file messages: Include specific INI filename and required version
  3. Centralized version formatting: Uses Util::GetFormattedVersion for consistency
  4. Better user guidance: Clear indication of what's missing and what version is needed
  5. Maintained feature information: Still shows feature summary and key benefits

The logic flow is well-structured and the error messages are actionable for users.

src/Feature.cpp (5)

29-29: Good addition of centralized formatting utility.

Including Utils/Format.h enables the use of Util::GetFormattedVersion for consistent version string formatting throughout the codebase.


86-86: Excellent use of centralized version formatting.

Replacing manual version string formatting with Util::GetFormattedVersion improves consistency and maintainability across the codebase.


108-118: Enhanced error messaging with version requirements.

The improved error handling now includes the required version information in missing file messages, making it easier for users to understand what they need to install. The centralized version formatting ensures consistency.


135-135: Consistent version formatting for feature issues.

Using Util::GetFormattedVersion here maintains consistency with other version formatting throughout the error handling system.


229-229: Verify removal of ExtendedTranslucency feature.

The feature list appears to have been modified (removal of ExtendedTranslucency based on the AI summary). Please confirm this change is intentional and that all references to the removed feature have been properly cleaned up.

#!/bin/bash
# Description: Verify that ExtendedTranslucency references have been cleaned up
# Expected: No remaining references to ExtendedTranslucency in the codebase

echo "Searching for ExtendedTranslucency references..."
rg -i "extendedtranslucency" --type cpp --type h

echo "Searching for include statements..."
rg -i "ExtendedTranslucency\.h" --type cpp --type h

echo "Searching for global variable references..."
rg -i "extendedTranslucency" --type cpp --type h
src/Menu.cpp (5)

2-2: LGTM: Filesystem include added for file existence checking.

The <filesystem> include is appropriately added to support the new IsFeatureInstalled helper function.


17-17: LGTM: Additional includes for enhanced functionality.

The new includes for FeatureVersions.h and Utils/Format.h support the improved version handling and formatting capabilities mentioned in the PR objectives.

Also applies to: 24-24


759-767: LGTM: Correct implementation of feature status logic.

This change properly addresses the PR objective by distinguishing between missing features (INI file doesn't exist) and features pending restart (INI file exists but not loaded). The color coding logic is appropriate:

  • Grey for missing features
  • Green for features pending restart

913-923: LGTM: Consistent status display logic in About tab.

The About tab now correctly mirrors the feature list logic, showing appropriate status messages and colors based on actual installation state rather than just load state.


952-962: LGTM: Improved information messages for unloaded features.

The conditional messaging properly directs users to the Settings tab for installation details when features are missing, while showing a simple "pending restart" message when features are installed but not loaded. This eliminates the confusion mentioned in the PR objectives.

Comment thread src/Menu.cpp Outdated
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 24, 2025

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

Comment thread src/Feature.cpp
Comment thread src/Feature.cpp
Comment thread src/Feature.cpp
Comment thread src/Feature.h Outdated
Comment thread src/Feature.h
Comment thread src/Menu.cpp Outdated
Comment thread src/Menu.cpp Outdated
Comment thread src/Menu.cpp Outdated
@davo0411 davo0411 requested a review from alandtse June 24, 2025 04:21
Comment thread src/Utils/Format.cpp Outdated
Comment thread src/Utils/Format.cpp Outdated
@davo0411 davo0411 requested a review from alandtse June 24, 2025 04:57
@alandtse
Copy link
Copy Markdown
Collaborator

@coderabbitai please suggest an appropriate conventional commit title within github length limits.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 24, 2025

Tip

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

@alandtse Here are a few conventional commit title options within GitHub's length limits:

Recommended:

fix(ui): distinguish missing vs pending features, fix duplicate messages

(67 characters)

Alternative options:

fix(ui): centralize version validation and improve status messages

(62 characters)

fix(ui): improve feature status reporting and eliminate duplicate text

(68 characters)

The first option best captures the key user-facing improvements: properly distinguishing between features that are missing (no INI file) versus those pending restart (INI file present), and fixing the duplicate uninstalled text issues that were mentioned in the original PR description.

@alandtse alandtse changed the title fix(ui): fixes for uninstalled info issues, doubled up uninstalled text, green titles, check errors. fix(ui): distinguish missing vs pending features Jun 24, 2025
@alandtse alandtse merged commit 9053337 into community-shaders:dev Jun 24, 2025
14 checks passed
@davo0411 davo0411 deleted the uninstalled-info-fix branch June 24, 2025 06:03
alandtse pushed a commit to alandtse/open-shaders that referenced this pull request Jul 20, 2025
)

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