Skip to content

Simplify inspector code for tracking - #77

Merged
deanblackborough merged 2 commits into
mainfrom
simplify-inspector-code-for-tracking
Jun 7, 2026
Merged

Simplify inspector code for tracking#77
deanblackborough merged 2 commits into
mainfrom
simplify-inspector-code-for-tracking

Conversation

@deanblackborough

@deanblackborough deanblackborough commented Jun 7, 2026

Copy link
Copy Markdown
Owner
  • Simplify the inspector code when using command history, added prune::tooling::editor::tracked_property_table
  • Added detail text to command history methods, allows additional detail to be provided, especially useful around bool changes

Summary by CodeRabbit

  • New Features

    • Command history now displays detailed descriptions for each action (e.g., "Mouse pan", "Keyboard nudge", object property names).
    • Property edits now record descriptive labels in undo/redo history for better traceability.
  • Refactor

    • Property editing system refactored for improved consistency and maintainability.

- Added tracked_property_table to handle most of the tracking and keep inspector code simpler
@deanblackborough deanblackborough self-assigned this Jun 7, 2026
@coderabbitai

coderabbitai Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 0c313daf-a80c-4f54-b10c-04e1941a75bb

📥 Commits

Reviewing files that changed from the base of the PR and between ddb4d5d and 32081b0.

📒 Files selected for processing (10)
  • CMakeLists.txt
  • src/prune/editor/editor_command.cpp
  • src/prune/editor/editor_command.hpp
  • src/prune/scene/scene_interaction.cpp
  • src/prune/scene/world_scene.cpp
  • src/prune/tooling/command_history.cpp
  • src/prune/tooling/editor/tracked_property_table.cpp
  • src/prune/tooling/editor/tracked_property_table.hpp
  • src/prune/tooling/inspector.cpp
  • src/prune/tooling/inspector.hpp

📝 Walkthrough

Walkthrough

This PR extends the editor command model to capture richer context during object and viewport edits. It introduces a detail field to EditorCommand, refactors command factories to accept optional detail strings, and establishes a new ObjectEditTracker utility that automates state capture and change validation across property edits. The Inspector is migrated from manual capture/commit logic to declarative tracked property widgets (drag_float, slider_int, color3, checkbox, sprite_picker), whilst scene interaction handlers and world creation tools now thread descriptive detail strings through command recordings. The command history UI is updated to render the new detail field alongside the command label.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

  • deanblackborough/Prune#73: Introduced the editor command model that this PR extends with the detail field and refactored command factories.
  • deanblackborough/Prune#75: Added the command history panel that this PR enhances with detail field rendering.
  • deanblackborough/Prune#37: Established the scene interaction command recording logic that this PR now enriches with detail descriptions.

Suggested labels

enhancement

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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.
Title check ✅ Passed The title 'Simplify inspector code for tracking' accurately reflects the main objective of refactoring the inspector's edit-tracking logic whilst introducing a new tracked property table utility.
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.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch simplify-inspector-code-for-tracking

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Infer (1.2.0)
src/prune/editor/editor_command.cpp

src/prune/editor/editor_command.cpp:1:10: fatal error: 'prune/editor/editor_command.hpp' file not found
1 | #include "prune/editor/editor_command.hpp"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Error: the following clang command did not run successfully:
/opt/infer-linux-x86_64-v1.2.0/lib/infer/facebook-clang-plugins/clang/install/bin/clang-18
@/tmp/coderabbit-infer/32081b0be55dbd9137ba5561c5a9301d4bd0f510-30ccfe8e654152ee/tmp/clang_command_.tmp.a09013.txt
++Contents of '/tmp/coderabbit-infer/32081b0be55dbd9137ba5561c5a9301d4bd0f510-30ccfe8e654152ee/tmp/clang_command_.tmp.a09013.txt':
"-cc1" "-load"
"/opt/infer-linux-x86_64-v1.2.0/lib/infer/infer/bin/../../facebook-clang-plugins/libtooling/build/FacebookClangPlugin.dylib"
"-add-plugin" "BiniouASTExporter" "-plugin-arg-BiniouASTExporter" "-"
"-plugin-arg-BiniouASTExporter" "PREPEND_CURRENT_DIR=1"
"-plugin-arg-BiniouASTExporter" "MAX_STRING_SIZE=65535" "-cc1" "-triple"
"x86

... [truncated 1143 characters] ...

lib/clang/18/include"
"-internal-isystem" "/usr/local/include" "-internal-isystem"
"/usr/lib/gcc/x86_64-linux-gnu/12/../../../../x86_64-linux-gnu/include"
"-internal-externc-isystem" "/usr/include/x86_64-linux-gnu"
"-internal-externc-isystem" "/include" "-internal-externc-isystem"
"/usr/include" "-Wno-ignored-optimization-argument" "-Wno-everything"
"-fdeprecated-macro" "-ferror-limit" "19" "-fgnuc-version=4.2.1"
"-fskip-odr-check-in-gmf" "-fcxx-exceptions" "-fexceptions"
"-D__GCC_HAVE_DWARF2_CFI_ASM=1" "-o"
"/tmp/coderabbit-infer/30ccfe8e654152ee/file.o" "-x" "c++"
"src/prune/editor/editor_command.cpp" "-O0" "-fno-builtin" "-include"
"/opt/infer-linux-x86_64-v1.2.0/lib/infer/infer/bin/../lib/clang_wrappers/global_defines.h"
"-Wno-everything"

src/prune/scene/scene_interaction.cpp

src/prune/scene/scene_interaction.cpp:1:10: fatal error: 'prune/scene/scene_interaction.hpp' file not found
1 | #include "prune/scene/scene_interaction.hpp"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Error: the following clang command did not run successfully:
/opt/infer-linux-x86_64-v1.2.0/lib/infer/facebook-clang-plugins/clang/install/bin/clang-18
@/tmp/coderabbit-infer/32081b0be55dbd9137ba5561c5a9301d4bd0f510-6456de8323842af6/tmp/clang_command_.tmp.37e760.txt
++Contents of '/tmp/coderabbit-infer/32081b0be55dbd9137ba5561c5a9301d4bd0f510-6456de8323842af6/tmp/clang_command_.tmp.37e760.txt':
"-cc1" "-load"
"/opt/infer-linux-x86_64-v1.2.0/lib/infer/infer/bin/../../facebook-clang-plugins/libtooling/build/FacebookClangPlugin.dylib"
"-add-plugin" "BiniouASTExporter" "-plugin-arg-BiniouASTExporter" "-"
"-plugin-arg-BiniouASTExporter" "PREPEND_CURRENT_DIR=1"
"-plugin-arg-BiniouASTExporter" "MAX_STRING_SIZE=65535" "-cc1" "-triple"

... [truncated 1156 characters] ...

b/clang/18/include"
"-internal-isystem" "/usr/local/include" "-internal-isystem"
"/usr/lib/gcc/x86_64-linux-gnu/12/../../../../x86_64-linux-gnu/include"
"-internal-externc-isystem" "/usr/include/x86_64-linux-gnu"
"-internal-externc-isystem" "/include" "-internal-externc-isystem"
"/usr/include" "-Wno-ignored-optimization-argument" "-Wno-everything"
"-fdeprecated-macro" "-ferror-limit" "19" "-fgnuc-version=4.2.1"
"-fskip-odr-check-in-gmf" "-fcxx-exceptions" "-fexceptions"
"-D__GCC_HAVE_DWARF2_CFI_ASM=1" "-o"
"/tmp/coderabbit-infer/6456de8323842af6/file.o" "-x" "c++"
"src/prune/scene/scene_interaction.cpp" "-O0" "-fno-builtin" "-include"
"/opt/infer-linux-x86_64-v1.2.0/lib/infer/infer/bin/../lib/clang_wrappers/global_defines.h"
"-Wno-everything"

src/prune/tooling/command_history.cpp

src/prune/tooling/command_history.cpp:4:10: fatal error: 'imgui.h' file not found
4 | #include "imgui.h"
| ^~~~~~~~~
1 error generated.
Error: the following clang command did not run successfully:
/opt/infer-linux-x86_64-v1.2.0/lib/infer/facebook-clang-plugins/clang/install/bin/clang-18
@/tmp/coderabbit-infer/32081b0be55dbd9137ba5561c5a9301d4bd0f510-1a9230905bc84dab/tmp/clang_command_.tmp.feaf6e.txt
++Contents of '/tmp/coderabbit-infer/32081b0be55dbd9137ba5561c5a9301d4bd0f510-1a9230905bc84dab/tmp/clang_command_.tmp.feaf6e.txt':
"-cc1" "-load"
"/opt/infer-linux-x86_64-v1.2.0/lib/infer/infer/bin/../../facebook-clang-plugins/libtooling/build/FacebookClangPlugin.dylib"
"-add-plugin" "BiniouASTExporter" "-plugin-arg-BiniouASTExporter" "-"
"-plugin-arg-BiniouASTExporter" "PREPEND_CURRENT_DIR=1"
"-plugin-arg-BiniouASTExporter" "MAX_STRING_SIZE=65535" "-cc1" "-triple"
"x86_64-unknown-linux-gnu" "-emit-obj" "-mrelax-all" "-disable-free"
"

... [truncated 1076 characters] ...

b/clang/18/include"
"-internal-isystem" "/usr/local/include" "-internal-isystem"
"/usr/lib/gcc/x86_64-linux-gnu/12/../../../../x86_64-linux-gnu/include"
"-internal-externc-isystem" "/usr/include/x86_64-linux-gnu"
"-internal-externc-isystem" "/include" "-internal-externc-isystem"
"/usr/include" "-Wno-ignored-optimization-argument" "-Wno-everything"
"-fdeprecated-macro" "-ferror-limit" "19" "-fgnuc-version=4.2.1"
"-fskip-odr-check-in-gmf" "-fcxx-exceptions" "-fexceptions"
"-D__GCC_HAVE_DWARF2_CFI_ASM=1" "-o"
"/tmp/coderabbit-infer/1a9230905bc84dab/file.o" "-x" "c++"
"src/prune/tooling/command_history.cpp" "-O0" "-fno-builtin" "-include"
"/opt/infer-linux-x86_64-v1.2.0/lib/infer/infer/bin/../lib/clang_wrappers/global_defines.h"
"-Wno-everything"

  • 3 others

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

@coderabbitai coderabbitai Bot added the enhancement New feature or request label Jun 7, 2026
@deanblackborough
deanblackborough merged commit 553428a into main Jun 7, 2026
2 checks passed
@deanblackborough
deanblackborough deleted the simplify-inspector-code-for-tracking branch June 25, 2026 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant