Skip to content

refactor(ui): colored text helpers#2292

Merged
alandtse merged 1 commit into
community-shaders:devfrom
SkrubbySkrubInAShrub:Colored-text
May 8, 2026
Merged

refactor(ui): colored text helpers#2292
alandtse merged 1 commit into
community-shaders:devfrom
SkrubbySkrubInAShrub:Colored-text

Conversation

@SkrubbySkrubInAShrub
Copy link
Copy Markdown
Collaborator

@SkrubbySkrubInAShrub SkrubbySkrubInAShrub commented May 7, 2026

added new namespace: Util::Text for colored text and replaced all usages of this text.

Summary by CodeRabbit

  • Refactor

    • Unified UI text rendering across HDR display settings, upscaling resolution warnings, and shader blocking status notifications with consistent styling helpers.
  • Style

    • Enhanced color theming for warning, error, success, info, and disabled status messages throughout the settings interface for improved visual consistency.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 7, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

This PR introduces a new Util::Text helper namespace for themed ImGui text rendering and updates five UI files to use these helpers instead of manual color styling calls, eliminating repetitive ImGui::TextColored/PushStyleColor patterns across the codebase.

Changes

Text Rendering Helper Refactor

Layer / File(s) Summary
Utility Interface
src/Utils/UI.h
Declares Util::Text namespace with variadic helper functions for Warning, Error, Success, Info, and Disabled text in both normal and wrapped variants.
Utility Implementation
src/Utils/UI.cpp
Implements text helpers via internal ColoredTextV/ColoredTextWrappedV functions and UTIL_TEXT/UTIL_TEXT_WRAPPED macros that temporarily set ImGuiCol_Text color during rendering.
HDR Display UI
src/Features/HDRDisplay.cpp
Status messages ("HDR detected", "capable but Windows HDR off", "SDR"), exclusive-fullscreen warning, HDR display warning, and Force Enable HDR modal are updated to use Util::Text helpers.
Upscaling UI
src/Features/Upscaling.cpp
DLSS resolution limit warning is replaced with Util::Text::Warning calls instead of manual style color push/pop.
Shader Blocking UI
src/Menu/AdvancedSettingsRenderer.cpp, src/Menu/OverlayRenderer.cpp
"Shader Blocking Active" error text in both debug and overlay renderers is updated to use Util::Text::Error.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested reviewers

  • alandtse
  • doodlum
  • davo0411

Poem

🐰 Text colors once scattered, now helpers compile,
With Warning and Error in uniform style,
From HDR to shaders, each call finds its place,
Less code means less bugs—a cleaner codebase! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 22.22% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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.
Title check ✅ Passed The PR title 'refactor(ui): colored text helpers' accurately describes the main change—introducing new Util::Text helpers for colored text rendering and refactoring existing UI text calls to use them.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

No actionable suggestions for changed features.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

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

@SkrubbySkrubInAShrub SkrubbySkrubInAShrub changed the title refactor(UI): colored text helpers refactor(ui): colored text helpers May 7, 2026
@alandtse alandtse merged commit 4294716 into community-shaders:dev May 8, 2026
14 checks passed
alandtse added a commit to YtzyFvra/skyrim-community-shaders that referenced this pull request May 10, 2026
Address style/convention feedback from community-shaders#2092 review:

- Use globals::game::isVR instead of REL::Module::IsVR() for runtime
  checks; move IsInMenu() out-of-line so it can use the global.
- Replace raw ImGui::TextColored gray text with Util::Text::Disabled
  (helpers added in community-shaders#2292).
- Replace try/catch on std::filesystem::create_directories with
  Util::FileHelpers::EnsureDirectoryExists.
- Wrap the magic kTOTAL render-target index in a named constant
  (kVRSideBySideTarget) with a comment explaining it's the post-
  composite SBS target only valid in VR — kTOTAL on its own reads
  as "count of standard targets" and is misleading at the call site.

No behavior change.
alandtse added a commit to YtzyFvra/skyrim-community-shaders that referenced this pull request May 15, 2026
Address style/convention feedback from community-shaders#2092 review:

- Use globals::game::isVR instead of REL::Module::IsVR() for runtime
  checks; move IsInMenu() out-of-line so it can use the global.
- Replace raw ImGui::TextColored gray text with Util::Text::Disabled
  (helpers added in community-shaders#2292).
- Replace try/catch on std::filesystem::create_directories with
  Util::FileHelpers::EnsureDirectoryExists.
- Wrap the magic kTOTAL render-target index in a named constant
  (kVRSideBySideTarget) with a comment explaining it's the post-
  composite SBS target only valid in VR — kTOTAL on its own reads
  as "count of standard targets" and is misleading at the call site.

No behavior change.
ParticleTroned pushed a commit to ParticleTroned/skyrim-community-shaders that referenced this pull request May 15, 2026
Branch-preserving adaptation: add shared theme-colored text helpers and apply them to current Upscaling and shader-blocking UI sites while skipping HDRDisplay.
ParticleTroned pushed a commit to ParticleTroned/skyrim-community-shaders that referenced this pull request May 16, 2026
Branch-preserving adaptation: add shared theme-colored text helpers and apply them to current Upscaling and shader-blocking UI sites while skipping HDRDisplay.
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