Skip to content

refactor: document windows handling + scene tree features - #155

Merged
iMeaNz merged 160 commits into
devfrom
refactor/document-windows
May 4, 2025
Merged

iMeaNz merged 160 commits into
devfrom
refactor/document-windows

Conversation

@iMeaNz

@iMeaNz iMeaNz commented Mar 25, 2025

Copy link
Copy Markdown
Member

No description provided.

@coderabbitai

coderabbitai Bot commented Mar 25, 2025

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.


// Get the bounding box and draw centered text
auto [p_min, p_max] = utils::getItemRect();
ImVec2 textPos = utils::calculateCenteredTextPosition(headerText.data(), p_min, p_max);

Check warning

Code scanning / SonarCloud

std::string_view::data() should not be passed to API expecting C-style strings

<!--SONAR_ISSUE_KEY:AZZJdVPVvR_lGnbml4Rf-->Remove this call to data() to properly handle non null-terminated string_views. <p>See more on <a href="https://sonarcloud.io/project/issues?id=NexoEngine_game-engine&issues=AZZJdVPVvR_lGnbml4Rf&open=AZZJdVPVvR_lGnbml4Rf&branch=refactor%2Fdocument-windows">SonarQube Cloud</a></p>
@iMeaNz

iMeaNz commented May 4, 2025

Copy link
Copy Markdown
Member Author

@coderabbitai summary

@coderabbitai

coderabbitai Bot commented May 4, 2025

Copy link
Copy Markdown
Contributor
✅ Actions performed

Summary regeneration triggered.

iMeaNz added 24 commits May 4, 2025 22:37
…unction of the engine for different scene props
…nt size via a beginRender function that also handles the docking update and visibility update
@iMeaNz
iMeaNz force-pushed the refactor/document-windows branch from 395de30 to f184c4d Compare May 4, 2025 14:00
@iMeaNz

iMeaNz commented May 4, 2025

Copy link
Copy Markdown
Member Author

Overview

This PR delivers a comprehensive overhaul of the editor’s Document Windows subsystem along with enhancements to the Scene Tree view. It modularizes windows into standalone components, centralizes rendering logic, and enriches user interactions through robust undo/redo, shortcut handling, and improved camera/viewport synchronization.

Code Organization

  • Modularization: Split monolithic windows into dedicated classes/files

  • Unified Render Entry: Introduced beginRender() to centralize window position/size handling, docking updates, and visibility state .

  • SceneInfo Struct: Added SceneInfo to encapsulate parameters passed to the engine’s run function for each scene

State Management (Memento & Undo/Redo)

  • Memento Pattern: Incorporated save/restore via Memento for component windows

  • Action Management: Built a centralized action manager and integrated undo/redo stacks

Input & Shortcut Handling

  • Shortcut Infrastructure: Laid groundwork for input mapping

  • Core Shortcuts:

    • Gizmo controls: axis press-to-show, on-release callback, exclude-axis, switch local/global
    • Transform tools: delete, snapping, key-repeat, multi-selection, hide shortcuts
    • Helper UI: bottom-bar shortcut helper display

Shader & Edge Detection

  • Flat Color Shader: Added basic flat-color shader support
  • Post-Processing Outline: Moved outline rendering to a post-processing pass using concentric-ring edge detection combined with a mask framebuffer
  • Uniform Extensions: Introduced support for float2 and bool uniforms in window shaders

Camera & Viewport Improvements

  • Adjustable translation speed
  • Ignoring mouse-key inputs correctly
  • Quaternion-only rotation
  • Scene Creation & Switching Fixes: Resolved camera blip on cancel, creation glitches, and switching issues

Viewport Sync & Projection:

  • Align ImGui viewport with the scene viewport
  • Correct gizmo rect and grid-highlight world projection

Scene Tree Enhancements

  • Shortcuts & Popups:
    • Added expand/collapse
    • Entity-creation popup in the tree
    • Dedicated shortcuts for scene-tree navigation

Miscellaneous Fixes & Chores

  • Filtering & Rendering: Corrected texture mag filter to linear
  • Code Cleanup: Moved function implementations to source files, refactored shortcut builders, updated comments for clarity.

@iMeaNz
iMeaNz marked this pull request as ready for review May 4, 2025 14:43
@iMeaNz
iMeaNz merged commit 256bb6c into dev May 4, 2025
@github-project-automation github-project-automation Bot moved this from Todo to Done in Global timeline May 4, 2025
@Thyodas
Thyodas deleted the refactor/document-windows branch July 23, 2025 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment