Update RDS gui creation to new backend agnostic API#116
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughReplaced per-sensor Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@mola_kernel/src/interfaces/RawDataSourceBase.cpp`:
- Around line 213-214: The code uses std::istringstream (seen at the use of
std::istringstream ss(sv->win_pos)) but does not include <sstream>; add a direct
include for the header by inserting `#include` <sstream> into
RawDataSourceBase.cpp (near the other standard headers) so the translation unit
no longer relies on transitive includes and std::istringstream is defined
reliably across toolchains.
- Around line 209-218: The win_pos parser (reading sv->win_pos) expects
whitespace-separated ints but the documented format is "[x,y,width,height]", so
inputs like "[10,20,400,300]" are ignored; update the parsing logic that sets
desc.position and desc.size to first normalize sv->win_pos by removing
surrounding brackets and replacing commas with spaces (or otherwise tokenize on
non-digit characters), then parse four integers (x,y,w,h) from the cleaned
string, validate w and h are positive before assigning desc.position = {x,y} and
desc.size = {w,h}, and ensure you treat parse failures by leaving defaults
unchanged (or logging) so behavior is deterministic.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: b2166d33-4ae3-40a2-b96c-b38b4a8e7221
📒 Files selected for processing (1)
mola_kernel/src/interfaces/RawDataSourceBase.cpp
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
mola_viz/src/MolaViz.cpp (1)
1442-1462:⚠️ Potential issue | 🟠 MajorApply
desc.sizefor bare subwindows too.At Line 1455 and Line 1459, size constraints are only applied in the
elsebranch, sodesc.sizeis ignored whendesc.tabs.empty(). That breaks description-based sizing for bare windows (which this PR now uses).💡 Proposed fix
subwin->setVisible(!desc.starts_hidden); subwin->setPosition({desc.position[0], desc.position[1]}); + + // Apply size hints regardless of tab usage. + if (desc.size[0] > 0) + { + subwin->setFixedWidth(desc.size[0]); + } + if (desc.size[1] > 0) + { + subwin->setFixedHeight(desc.size[1]); + } // Resize/enlarge buttons in the title-bar button panel: subwin->buttonPanel() ->add<nanogui::Button>("", ENTYPO_ICON_RESIZE_100_PERCENT) ->setCallback( @@ if (desc.tabs.empty()) { // Bare subwindow (no widget description). Set a default vertical // single-column GridLayout so that children added directly to the // window (e.g. MRPT2NanoguiGLCanvas added by gui handlers) are // positioned inside the subwindow frame rather than floating. // This matches the old subwindow_grid_layout(title, true, 1) call. subwin->setLayout(new nanogui::GridLayout( nanogui::Orientation::Vertical, 1, nanogui::Alignment::Fill, 2, 2)); } else { - // Apply size constraints only for description-based windows: - if (desc.size[0] > 0) - { - subwin->setFixedWidth(desc.size[0]); - } - if (desc.size[1] > 0) - { - subwin->setFixedHeight(desc.size[1]); - } - if (desc.tabs.size() == 1) {🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@mola_viz/src/MolaViz.cpp` around lines 1442 - 1462, The size constraints from desc.size are currently only applied in the else branch when desc.tabs is non-empty, so bare subwindows ignore desc.size; update the logic in the MolaViz.cpp block handling subwin creation so that after creating or configuring subwin (and after calling subwin->setLayout(...) for the bare case) you also check desc.size[0] and desc.size[1] and call subwin->setFixedWidth(...) and subwin->setFixedHeight(...) when > 0 (or alternatively move the existing desc.size checks above the if (desc.tabs.empty()) branch), ensuring desc.size is honored for both bare and description-based windows.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@agents.md`:
- Around line 33-65: The fenced code block that begins with ``` before the
"mola/" list lacks a language specifier (MD040); fix it by changing the opening
fence to include a language token such as ```text (or ```plain) so the block
becomes a labeled code fence; update the fence that wraps the lines starting
with "mola/" / "mola_kernel/" / "mola_yaml/" etc. to include that language
specifier.
---
Outside diff comments:
In `@mola_viz/src/MolaViz.cpp`:
- Around line 1442-1462: The size constraints from desc.size are currently only
applied in the else branch when desc.tabs is non-empty, so bare subwindows
ignore desc.size; update the logic in the MolaViz.cpp block handling subwin
creation so that after creating or configuring subwin (and after calling
subwin->setLayout(...) for the bare case) you also check desc.size[0] and
desc.size[1] and call subwin->setFixedWidth(...) and subwin->setFixedHeight(...)
when > 0 (or alternatively move the existing desc.size checks above the if
(desc.tabs.empty()) branch), ensuring desc.size is honored for both bare and
description-based windows.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 8b2d33e7-dead-40bb-822a-f84869aaa576
📒 Files selected for processing (2)
agents.mdmola_viz/src/MolaViz.cpp
Summary by CodeRabbit
New Features
Improvements
Documentation
Chores