Skip to content

Update RDS gui creation to new backend agnostic API#116

Merged
jlblancoc merged 4 commits intodevelopfrom
update-rds-gui
Mar 18, 2026
Merged

Update RDS gui creation to new backend agnostic API#116
jlblancoc merged 4 commits intodevelopfrom
update-rds-gui

Conversation

@jlblancoc
Copy link
Copy Markdown
Member

@jlblancoc jlblancoc commented Mar 18, 2026

Summary by CodeRabbit

  • New Features

    • Users can set custom window positions and sizes for sensor visualization.
  • Improvements

    • Simplified sensor viewer GUI creation and lifecycle handling.
    • Bare subwindows now get a default layout so embedded widgets position correctly.
    • More robust handling of empty point-cloud observations.
  • Documentation

    • Added an AI agent context guide describing project structure, usage patterns, and configuration.
  • Chores

    • Added a new ignored term for editor spell checking.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 18, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1c17dde4-c7e2-4894-9dc8-e186407d0e20

📥 Commits

Reviewing files that changed from the base of the PR and between baf1096 and 533e391.

📒 Files selected for processing (2)
  • .vscode/settings.json
  • mola_kernel/src/interfaces/RawDataSourceBase.cpp
🚧 Files skipped from review as they are similar to previous changes (1)
  • mola_kernel/src/interfaces/RawDataSourceBase.cpp

📝 Walkthrough

Walkthrough

Replaced per-sensor nanogui::Window* with a bool gui_created in RawDataSourceBase::SensorViewerImpl; switched GUI creation to WindowDescription-driven creation that applies user position/size; added default GridLayout for bare subwindows; added agents.md and a small VSCode spell-ignore change.

Changes

Cohort / File(s) Summary
Sensor viewer GUI refactor
mola_kernel/src/interfaces/RawDataSourceBase.cpp
Replaced nanogui::Window* win with bool gui_created; create subwindows via WindowDescription/create_subwindow_from_description; parse and apply win_pos to description; set gui_created after creation; adjust pending task checks and Velodyne empty-check.
Visualization layout fix
mola_viz/src/MolaViz.cpp
When creating a bare subwindow (no tabs) from description, assign a default vertical GridLayout(1) so child widgets are placed inside the subwindow frame rather than floating.
Documentation addition
agents.md
New repository agent/context guide describing architecture, key packages, build/test, YAML patterns, GUI widget notes, and navigation tips. No API changes.
Editor settings
.vscode/settings.json
Added NOLINTNEXTLINE to cSpell.ignoreWords to expand ignored spell-check terms.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 I hopped through code with nimble paws,
Swapped windows for descriptions, neat and wise,
Placed grids where widgets once would stray,
Positions set, the panes now rise,
A tiny hop — GUI delights my eyes! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main objective of the PR: updating RawDataSourceBase GUI creation to use a new backend-agnostic API (WindowDescription-based approach), which is the primary change across the modified files.

✏️ 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 update-rds-gui
📝 Coding Plan
  • Generate coding plan for human review comments

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.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between ac7be8e and a24f906.

📒 Files selected for processing (1)
  • mola_kernel/src/interfaces/RawDataSourceBase.cpp

Comment thread mola_kernel/src/interfaces/RawDataSourceBase.cpp Outdated
Comment thread mola_kernel/src/interfaces/RawDataSourceBase.cpp Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 | 🟠 Major

Apply desc.size for bare subwindows too.

At Line 1455 and Line 1459, size constraints are only applied in the else branch, so desc.size is ignored when desc.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

📥 Commits

Reviewing files that changed from the base of the PR and between a24f906 and baf1096.

📒 Files selected for processing (2)
  • agents.md
  • mola_viz/src/MolaViz.cpp

Comment thread agents.md
@jlblancoc jlblancoc enabled auto-merge March 18, 2026 15:34
@jlblancoc jlblancoc merged commit dd9cc74 into develop Mar 18, 2026
9 checks passed
@jlblancoc jlblancoc deleted the update-rds-gui branch March 18, 2026 15:40
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