Skip to content

fix(ui): bottom dock tabs, Context default, LOD in Object mode#476

Merged
fernandotonon merged 12 commits into
masterfrom
codex/bottom-context-panel-slice
May 10, 2026
Merged

fix(ui): bottom dock tabs, Context default, LOD in Object mode#476
fernandotonon merged 12 commits into
masterfrom
codex/bottom-context-panel-slice

Conversation

@fernandotonon
Copy link
Copy Markdown
Owner

@fernandotonon fernandotonon commented May 10, 2026

Summary

  • Bottom panel: Tab order is Context → Console → Asset Browser → Dope Sheet → Curve Editor so the tab strip matches expectations; startup prefers Context as the active tab when Context + Console are enabled (including a deferred raise() after tabification).
  • LOD Generation: Shown under Object mode on the Mode Tools tab only (not on Inspector). LOD operations use SelectionSet::getResolvedEntities() so a scene node selection (including group/parent nodes) resolves to attached/descendant Entity meshes; submesh-only selection resolves to the parent entity.
  • getResolvedEntities(): Recurses into child scene nodes (skipping forbidden internal names), resolves sub-entities to parent entities, and keeps the legacy same-name SceneManager::getEntity lookup.

Tests

  • MainWindowTest.BottomToolTabOrderStartsWithContextDock
  • MeshLodControllerTest: nested ancestor selection (HasSelectionTrueWhenAncestorNodeSelected, GenerateLodsSucceedsWithAncestorNodeSelectionOnly), updated error-string expectations
  • SelectionSetTest: nested parent, sub-entity-only, multi-entity under one parent

Notes

CI: Linux UnitTests + Sonar as usual; please rerun if flaky on dock tab ordering.

Made with Cursor

Summary by CodeRabbit

  • New Features

    • Added in-app Console dock displaying application logs and system output.
    • Added Material Editor section to Properties panel for material mode.
    • Added "Clear all" action to Scene outliner for quickly removing all objects.
    • Added individual scene node delete buttons.
    • Enabled "Merge Animations" functionality.
  • UI Improvements

    • Repositioned mode buttons to align right in toolbar.
    • Added View menu options to toggle Console and toolbars visibility.
    • Updated bottom dock layout and tabification.
  • Version

    • Bumped to version 3.0.0.

Review Change Stack

fernandotonon and others added 9 commits May 8, 2026 20:13
- Add AppConsoleLog with optional stdio capture and Qt message routing to the console dock.
- Extract ConsoleLogSanitize for ANSI/UTF-8 handling; cover with unit tests.
- View menu toggles for Context Panel and Console with QSettings persistence.
- MainWindow tests for default checked state, console toggle, and Qt log delivery.
- Bump version to 3.0.0.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Avoid returning prefix length 0 when a multibyte lead is followed by a
non-continuation, which left the same bytes in stdio carry forever.
Add regression test; clarify utf8CompletePrefixLength contract.

Co-authored-by: Cursor <cursoragent@cursor.com>
Resolve conflicts: keep console dock + View menu actions; hide context
dock on create + QSettings-driven show; take ModeBar trailing spacer
from master; retain revealBottomTool(console), appendConsoleLine, and
tabify list including Console.

Co-authored-by: Cursor <cursoragent@cursor.com>
…om nodes

- Tabify bottom docks with Context first, then Console; defer raise so Context
  stays active when both default on.
- Move LOD Generation to Object mode Mode Tools only; MeshLodController uses
  SelectionSet::getResolvedEntities() (entities, submeshes, node subtrees).
- Extend getResolvedEntities() with subtree walk and sub-entity parents.
- Add MainWindow, MeshLodController, and SelectionSet unit tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 10, 2026

Warning

Rate limit exceeded

@fernandotonon has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 22 minutes and 10 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 960d56e0-fe1a-4fba-b129-11f1c8fec09b

📥 Commits

Reviewing files that changed from the base of the PR and between 2a9563d and 622626b.

📒 Files selected for processing (9)
  • qml/PropertiesPanel.qml
  • src/MeshLodController.cpp
  • src/MeshLodController_test.cpp
  • src/SelectionSet.cpp
  • src/SelectionSet.h
  • src/SelectionSet_test.cpp
  • src/mainwindow.cpp
  • src/mainwindow.h
  • src/mainwindow_test.cpp
📝 Walkthrough

Walkthrough

This PR delivers version 3.0.0 with a comprehensive in-app console logging system that captures Qt messages and stdout/stderr via background thread; enhances SelectionSet entity resolution to support ancestor node selection with descendant traversal; adds new scene-tree UI controls (delete node, clear all, material editor, merge animations); refactors LOD controller to use unified entity resolution; and expands test coverage across console, selection, MainWindow, and UI subsystems.

Changes

Console Logging and Stdio Capture

Layer / File(s) Summary
Sanitization Utilities
src/ConsoleLogSanitize.h, src/ConsoleLogSanitize.cpp
Functions to strip ANSI CSI/OSC escape sequences and compute longest complete UTF-8 prefix lengths for safe partial-byte buffer handling.
Sanitization Tests
src/ConsoleLogSanitize_test.cpp
GoogleTest coverage for ANSI removal, whitespace trimming, UTF-8 boundary detection, and recovery from malformed sequences.
Console Logging API
src/AppConsoleLog.h, src/AppConsoleLog.cpp
Installs Qt message handler; captures stdout/stderr via named pipe and background QThread; manages pending message backlog; supports attaching/detaching MainWindow with backlog replay; restores original file descriptors on shutdown.
Application Startup
src/main.cpp
Calls AppConsoleLog::install() and installStdioCapture() after QApplication creation; registers shutdown via qScopeGuard.

Selection Resolution and Scene Management

Layer / File(s) Summary
SelectionSet Enhancement
src/SelectionSet.h, src/SelectionSet.cpp
getResolvedEntities() now resolves entities from selected sub-entities, scene nodes, and their entire descendant subtrees with deduplication and forbidden-node filtering via recursive helper.
Scene Node Cleanup
src/Manager.h, src/Manager.cpp
New method destroyAllUserRootNodes() enumerates and destroys user-owned root children while filtering forbidden names and transient BevelGizmo nodes.
LOD Controller Refactoring
src/MeshLodController.cpp
Centralizes selection-to-entity resolution via local lodTargetEntities() helper; refactors nine methods to use unified lookup with standardized "No mesh found in selection" error messaging.
Selection and LOD Tests
src/MeshLodController_test.cpp, src/SelectionSet_test.cpp
New test cases for ancestor-node selection behavior, nested entity resolution, sub-entity picking, and successful LOD generation with ancestor-only selection.

UI Controller and MainWindow Integration

Layer / File(s) Summary
Properties Panel Controller
src/PropertiesPanelController.h, src/PropertiesPanelController.cpp
New QML property mergeAnimationsEnabled and invokable methods triggerMergeAnimations(), triggerMaterialEditor(), deleteSceneTreeNode(), clearSceneTreeAllNodes(); controller forwards actions to MainWindow with breadcrumb logging.
QML Layout Updates
qml/ModeBar.qml, qml/PropertiesPanel.qml, qml/SceneTreeNode.qml
ModeBar adds leading spacer for right-aligned mode buttons; PropertiesPanel adds Material Editor section (MaterialMode-only) and Merge Animations row; SceneTreeNode adds node-type-only delete button.
MainWindow Console Integration
src/mainwindow.h, src/mainwindow.cpp
Adds Console dock with read-only QPlainTextEdit and Clear button; attaches AppConsoleLog at construction/detaches at destruction; adds appendConsoleLine() slot; centralizes transform-space label via transformSpaceLabel() helper; adds m_consoleEdit, m_consoleDock members.
MainWindow View Menu and Visibility
src/mainwindow.cpp
Adds View → Context Panel and View → Console checkable menu actions; persists visibility via QSettings keys; manages bottom-dock show/hide/raise; refactors updateToolRailForMode() with explicit action visibility setters and modeValidation branch; removes shared toolbar visibility tied to material/animation modes; extends revealBottomTool() and tabifyBottomToolDocks() for console inclusion; adds mode-bar toolbar stretcher.
UI Definition
ui_files/mainwindow.ui
Removes View Toolbar action and widget; replaces with direct Objects and Tools toolbar toggles in View menu.

Test Suite and Build Configuration

Layer / File(s) Summary
MainWindow Test Expansion
src/mainwindow_test.cpp
Adds tests for View menu action defaults and QSettings persistence; console dock show/hide/persist behavior; Qt log message capture in console widget; transform-space action text updates; bottom-dock tab order and tabification; mode-rail action visibility/enabled per mode; merge-animations enablement with two-node selection; removes View toolbar toggle test.
Build and Version Configuration
CMakeLists.txt, src/CMakeLists.txt, tests/CMakeLists.txt
Project version bumped to 3.0.0; AppConsoleLog.cpp/h and ConsoleLogSanitize.cpp/h added to core build; test executables linked with console logging implementations.

Sequence Diagram

sequenceDiagram
  participant User
  participant UI as QML UI<br/>(SceneTree,<br/>PropertiesPanel)
  participant Ctrl as PropertiesPanelController
  participant MainWin as MainWindow
  participant Console as AppConsoleLog
  participant Qt as Qt<br/>Message Handler
  User->>UI: Click delete node icon
  UI->>Ctrl: deleteSceneTreeNode(name)
  Ctrl->>MainWin: find MainWindow
  Ctrl->>Ctrl: Manager::destroySceneNode()
  Ctrl->>Qt: Breadcrumb logged
  Qt->>Console: Message queued
  Console->>MainWin: appendConsoleLine()
  MainWin->>MainWin: Update console dock
  Note over Console,MainWin: Console displays log of<br/>deletion in new Console dock
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related PRs

  • fernandotonon/QtMeshEditor#432: Modifies the same QML surfaces (ModeBar.qml, PropertiesPanel.qml, SceneTreeNode.qml) and PropertiesPanelController integration with overlapping layout and action changes.
  • fernandotonon/QtMeshEditor#226: Both enhance SelectionSet::getResolvedEntities() logic and test coverage for ancestor-node and descendant entity resolution.
  • fernandotonon/QtMeshEditor#437: Modifies MainWindow tool-rail visibility, updateToolRailForMode behavior, and related test expectations in mainwindow_test.cpp.

Poem

🐰 Console glows with captured light,
Nodes bloom through descendants, deep and bright,
Delete buttons twinkle in the scene tree's dance,
Version three-oh leads—the editor's new expanse!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 10.58% 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
Title check ✅ Passed The title 'fix(ui): bottom dock tabs, Context default, LOD in Object mode' clearly summarizes the main UI/UX changes made in the PR: bottom dock tab ordering/default, and LOD functionality repositioning.
Description check ✅ Passed The description covers required sections (Summary, Technical Details, Tests, Notes) with specific details about tab order, LOD generation behavior, selection resolution logic, test coverage, and CI instructions.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/bottom-context-panel-slice

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

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

Co-authored-by: Cursor <cursoragent@cursor.com>
@chatgpt-codex-connector
Copy link
Copy Markdown

💡 Codex Review

const bool enough =
sel->getNodesCount() + sel->getEntitiesCount() >= 2;
ui->actionMerge_Animations->setEnabled(enough);

P2 Badge Enable merge action from resolved selection, not raw pick count

updateMergeAnimationsButton() now enables actionMerge_Animations only when nodes + entities >= 2, which disables the command for valid selections like a single parent node that contains multiple animated descendant entities. After this commit, SelectionSet::getResolvedEntities() can resolve descendant entities from one selected node, and on_actionMerge_Animations_triggered() consumes that resolved list, so the action can be valid while still being disabled in the UI. This blocks merges that should now work via ancestor-node selection.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

fernandotonon and others added 2 commits May 9, 2026 23:33
Co-authored-by: Cursor <cursoragent@cursor.com>
@sonarqubecloud
Copy link
Copy Markdown

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.

1 participant