Skip to content

refactor(ui): relocate action buttons to tab header#1190

Merged
alandtse merged 3 commits into
community-shaders:devfrom
davo0411:moved-buttons
Jun 24, 2025
Merged

refactor(ui): relocate action buttons to tab header#1190
alandtse merged 3 commits into
community-shaders:devfrom
davo0411:moved-buttons

Conversation

@davo0411
Copy link
Copy Markdown
Collaborator

@davo0411 davo0411 commented Jun 24, 2025

Moved two buttons from inline in settings page into the heading tab to better use the space.
20C540~1

Summary by CodeRabbit

  • Refactor
    • Updated the layout of the "Disable/Enable at Boot" and "Restore Defaults" buttons in the feature settings tab for improved alignment and appearance.
    • Buttons are now positioned on the right side of the tab bar with dynamic sizing and clearer visual feedback based on feature state.
    • The tab bar now supports reordering of tabs.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 24, 2025

Walkthrough

The rendering logic for the "Disable/Enable at Boot" and "Restore Defaults" buttons in the feature settings tab has been refactored. These buttons are now positioned outside the child window but within the "Settings" tab, aligned to the right of the tab bar with dynamic sizing and updated color logic. Control flow and button tooltips remain unchanged.

Changes

File(s) Change Summary
src/Menu.cpp Refactored UI rendering for settings tab buttons: moved and realigned buttons, updated sizing, color logic, and positioning. No changes to control flow or business logic.

Poem

A hop and a skip in the settings tab,
Buttons now dance with a neater grab.
Aligned to the right, with colors anew,
The menu feels fresh, precise, and true.
Rabbits rejoice in tidy delight,
For every button now sits just right! 🐇✨


📜 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 593b5a1 and 8a5b472.

📒 Files selected for processing (1)
  • src/Menu.cpp (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Build plugin and addons
🔇 Additional comments (3)
src/Menu.cpp (3)

788-801: LGTM! Clean dynamic button sizing implementation.

The button width calculation logic is well-implemented with proper conditional handling for when the "Restore Defaults" button should be included in the total width calculation.


802-802: Nice UX enhancement.

Adding the ImGuiTabBarFlags_Reorderable flag allows users to reorder tabs, which is a good usability improvement.


897-946: Excellent implementation of the button repositioning.

This is a well-crafted refactoring that successfully moves the buttons to the tab bar while maintaining all original functionality:

  • Proper right-alignment calculation with overflow protection
  • Correct conditional logic for showing/hiding the "Restore Defaults" button
  • Appropriate text coloring based on feature state (disabled/error/normal)
  • Well-implemented tooltips with informative content
  • Clean separation of concerns between the two buttons

The code follows ImGui best practices with proper style push/pop operations and maintains the existing business logic.

✨ 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

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

@alandtse
Copy link
Copy Markdown
Collaborator

This isn't a fix. This is a style or refactor at best.

@davo0411 davo0411 changed the title fix(ui): moved "disable at launch" & "restore defaults" buttons. style(ui): moved "disable at launch" & "restore defaults" buttons. Jun 24, 2025
@alandtse
Copy link
Copy Markdown
Collaborator

@coderabbitai please provide the appropriate conventional commit given the changes. Please adhere to github's title limit of 50 and also consider whether this is a fix or something else.

@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 You're absolutely right - this is not a fix. Based on the changes, here's the appropriate conventional commit message:

refactor(ui): relocate action buttons to tab header

This is 44 characters and correctly categorizes the change as a refactor since it restructures the UI layout without changing functionality. The buttons are being moved from their inline position to the tab header to optimize space usage, which is a refactoring of the user interface rather than a bug fix.

🐰💭
╱|、
(˚ˎ 。7
|、˜〵
じしˍ,)ノ

@davo0411
Copy link
Copy Markdown
Collaborator Author

This isn't a fix. This is a style or refactor at best.

Yeah my mistake, idk why I put fix

@alandtse alandtse changed the title style(ui): moved "disable at launch" & "restore defaults" buttons. refactor(ui): relocate action buttons to tab header Jun 24, 2025
@alandtse alandtse merged commit 1c54509 into community-shaders:dev Jun 24, 2025
16 checks passed
@davo0411 davo0411 deleted the moved-buttons branch June 24, 2025 06:17
alandtse pushed a commit to alandtse/open-shaders that referenced this pull request Jul 20, 2025
…s#1190)

Updated the layout of the "Disable/Enable at Boot" and "Restore Defaults" buttons in the feature settings tab for improved alignment and appearance.
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