Skip to content

refactor(ui): update general settings layout, add tooltip delay setting#1235

Merged
alandtse merged 2 commits into
community-shaders:devfrom
soda3000:2025-07-04
Jul 6, 2025
Merged

refactor(ui): update general settings layout, add tooltip delay setting#1235
alandtse merged 2 commits into
community-shaders:devfrom
soda3000:2025-07-04

Conversation

@soda3000
Copy link
Copy Markdown
Contributor

@soda3000 soda3000 commented Jul 5, 2025

Quality of life updates to a couple parts of the menu UI/UX.

Summary by CodeRabbit

  • New Features

    • Added a customizable setting to control the delay before tooltips appear on hover.
    • Exposed the tooltip hover delay as a slider in the interface options.
  • Refactor

    • Reorganized the general settings UI into a tabbed layout for easier navigation, grouping shader, keybinding, and interface options under separate tabs.
    • Improved the structure of interface customization options by introducing nested tabs for UI options, sizes, and colors.
  • Style

    • Updated tooltip behavior to respect the new hover delay setting, providing a more consistent user experience.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jul 5, 2025

Walkthrough

The changes introduce a new configurable setting for tooltip hover delay, integrate it into the theme system, and expose it in the UI. The general settings interface is refactored from a collapsing header with tables to a tabbed layout, reorganizing shader, keybinding, and interface options. Tooltip hover logic is updated to use delayed hover detection.

Changes

File(s) Change Summary
src/Menu.cpp, src/Menu.h Added TooltipHoverDelay to theme settings, set it in ImGui style, and exposed it in a reorganized tabbed UI. Refactored general settings UI to use tab bars for shaders, keybindings, and interface options.
src/Utils/UI.cpp Updated tooltip hover logic to use ImGuiHoveredFlags_DelayNormal for delayed tooltip display.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Menu
    participant ImGui

    User->>Menu: Open Settings Menu
    Menu->>ImGui: Create Tab Bar ("Shaders", "Keybindings", "Interface")
    User->>Menu: Select "Interface" Tab
    Menu->>ImGui: Show nested tabs ("UI Options", "Sizes", "Colors")
    User->>Menu: Adjust "Tooltip Hover Delay" slider
    Menu->>ImGui: Update TooltipHoverDelay in ThemeSettings
    Menu->>ImGui: Set ImGui style HoverDelayNormal
    User->>ImGui: Hover over UI element
    ImGui->>User: Show tooltip after configured delay
Loading

Suggested reviewers

  • alandtse

Poem

In the menu’s warren, tabs now appear,
With sliders and toggles, all settings are clear.
Tooltips now wait, with a gentle delay,
Hopping in softly, not scaring away.
A bunny’s delight, this interface neat—
Settings and style, a tabbed treat!
🐇✨

✨ 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.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jul 5, 2025

Using provided base ref: be967a1
Using base ref: be967a1
Base commit date: 2025-07-04T16:31:15-07:00 (Friday, July 04, 2025 04:31 PM)
No actionable suggestions for changed features.

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: 0

🧹 Nitpick comments (1)
src/Menu.cpp (1)

1240-1263: Consider adding validation for extreme values

While the slider is clamped to 0.0-2.0 seconds, consider adding a note in the tooltip about recommended values. Very low values (near 0) might make tooltips too eager, while very high values might make them feel unresponsive.

 if (auto _tt = Util::HoverTooltipWrapper()) {
-    ImGui::TextUnformatted("Time in seconds to wait before a tooltip appears when hovering over an item.");
+    ImGui::TextUnformatted("Time in seconds to wait before a tooltip appears when hovering over an item.\nRecommended range: 0.3-1.0 seconds.");
 }
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between be967a1 and d724978.

📒 Files selected for processing (3)
  • src/Menu.cpp (4 hunks)
  • src/Menu.h (1 hunks)
  • src/Utils/UI.cpp (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: alandtse
PR: doodlum/skyrim-community-shaders#0
File: :0-0
Timestamp: 2025-06-24T07:17:36.604Z
Learning: When reviewing PRs, always clarify the scope if there are multiple related features or dependencies. WeatherPicker was a separate PR that was already merged, while this PR focuses specifically on WetnessEffects climate preset system enhancements.
🧬 Code Graph Analysis (1)
src/Utils/UI.cpp (1)
src/Utils/UI.h (1)
  • hovered (33-33)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Build plugin and addons
🔇 Additional comments (8)
src/Menu.h (1)

84-84: LGTM: Clean addition of tooltip delay configuration.

The new TooltipHoverDelay member is well-implemented with a reasonable default value and clear documentation. The 0.5-second default provides a good balance between responsiveness and preventing accidental tooltip triggers.

src/Utils/UI.cpp (1)

25-25: Confirmed: Tooltip delay setting is correctly applied

The TooltipHoverDelay value from themeSettings is assigned to style.HoverDelayNormal in src/Menu.cpp, so using ImGuiHoveredFlags_DelayNormal will respect the custom delay. No further changes needed.

src/Menu.cpp (6)

115-115: LGTM: Proper serialization integration

The TooltipHoverDelay field is correctly added to the JSON serialization macro, ensuring the setting persists between sessions.


145-145: LGTM: Correct style application

The tooltip delay setting is properly applied to ImGui's HoverDelayNormal style property, which will control the delay for all tooltips using delayed hover detection.


1160-1187: LGTM: Clean shader settings tab implementation

The "Shaders" tab properly encapsulates all shader-related toggles with appropriate tooltips. The structure is clean and maintains the original functionality.


1188-1235: LGTM: Well-organized keybindings tab

The keybindings tab effectively groups all hotkey configuration in one place. The conditional logic for key setting mode is handled correctly, and the UI provides clear feedback to users.


1257-1260: LGTM: Excellent tooltip delay implementation

The tooltip hover delay slider is well-implemented with:

  • Reasonable range (0.0-2.0 seconds) with proper clamping
  • Clear formatting showing seconds
  • Helpful tooltip explaining the functionality
  • Proper integration with the theme settings system

1160-1364: Excellent UI refactoring with improved organization

The transition from collapsing headers to a tabbed interface significantly improves the settings organization:

  • Logical grouping: Shaders, Keybindings, and Interface tabs provide clear categories
  • Nested structure: The Interface tab's sub-tabs (UI Options, Sizes, Colors) create better hierarchy
  • Maintained functionality: All original settings are preserved and accessible
  • Consistent patterns: The code follows established ImGui and project conventions

This refactor enhances user experience by making settings easier to find and navigate.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jul 5, 2025

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

Comment thread src/Menu.cpp
ImGui::SameLine();
if (ImGui::RadioButton("Full Palette", !themeSettings.UseSimplePalette))
themeSettings.UseSimplePalette = false;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

a little nit-picky (I know i can be guilty of this too). but just be careful of mass line changes where nothings actually different like here. just bloats out the pr. AI can often do this rather annoyingly.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

There was a tab added before.

@davo0411
Copy link
Copy Markdown
Collaborator

davo0411 commented Jul 5, 2025

approved, pr doesn't have anything bad that jumps out at me. Little bloated with unrelated line changes though/ bad formatting.

@davo0411 davo0411 self-requested a review July 5, 2025 08:50
@alandtse alandtse merged commit cb84b8d into community-shaders:dev Jul 6, 2025
15 checks passed
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.

3 participants