Skip to content

Fix review GUI viewport camera setup regression#941

Open
qianl-nv wants to merge 3 commits into
mainfrom
qianl/fix/review_gui_camera_view
Open

Fix review GUI viewport camera setup regression#941
qianl-nv wants to merge 3 commits into
mainfrom
qianl/fix/review_gui_camera_view

Conversation

@qianl-nv

@qianl-nv qianl-nv commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fix review GUI viewport camera setup

Detailed description

  • Lab isaacsim.core.utils.viewports is removed during lab beta2 upgrade. Replace it with an Arena implementation.
  • Run example tests in existing CI phases to catch above regressions.
  • Migrate deprecated Streamlit iframe and width APIs.

qianl-nv added 3 commits July 22, 2026 17:43
Replaces the unavailable isaacsim.core.utils.viewports.set_camera_view
with a local set_viewport_camera_eye_lookat helper.

Route simulation previews through SimulationContext's camera API.

Signed-off-by: Qian Lin <qianl@nvidia.com>
Migrate review GUI iframes and container-width controls before their
legacy APIs are removed.

Signed-off-by: Qian Lin <qianl@nvidia.com>
Include the examples test suite in existing CI phases and isolate its
Isaac Sim smoke tests in the subprocess phase.

Signed-off-by: Qian Lin <qianl@nvidia.com>
@greptile-apps

greptile-apps Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes a viewport camera regression introduced during the IsaacLab beta2 upgrade by replacing the removed viewport_camera_controller / isaacsim.core.utils.viewports.set_camera_view APIs with a new set_viewport_camera_eye_lookat helper built on ViewportCameraState. It also migrates deprecated Streamlit use_container_width parameters to width="stretch" and extends CI to run example tests across all four test phases.

  • Camera fix (kit_viewport.py, thumbnail_capture.py, sim_preview.py): New set_viewport_camera_eye_lookat uses ViewportCameraState directly; sim_preview.py drops the dead viewport_camera_controller branch and simplifies to a single set_camera_view call.
  • Streamlit API migration: use_container_width=Truewidth="stretch" across buttons, images, and dataframes; st.components.v1.htmlst.iframe for the prim-tree and Mermaid panels — but st.iframe expects a URL src, not raw HTML, which will break both visualizations (see inline comments).
  • CI / tests: Example tests added to all CI phases; three Isaac Sim smoke tests gain @pytest.mark.with_subprocess so they land in the correct subprocess phase.

Confidence Score: 3/5

Safe to merge the camera and CI changes; the Streamlit visualization panels (Mermaid graph and prim tree) will be silently broken until the st.iframe calls are corrected.

The viewport camera fix and CI wiring are clean and well-reasoned. The Streamlit migration has a straightforward mistake in visualization_widgets.py: st.iframe receives raw HTML document strings where it expects a URL, so the spatial graph and prim-tree panels will render as blank iframes for all users of the review GUI.

visualization_widgets.py — both st.iframe call sites need to be replaced with st.html (or st.components.v1.html) since the rendered content is raw HTML, not a URL.

Important Files Changed

Filename Overview
isaaclab_arena_examples/agentic_environment_generation/review_gui/spec_visualization/visualization_widgets.py Replaces st.components.v1.html with st.iframe and use_container_width with width="stretch"; the st.iframe calls receive raw HTML strings instead of URLs, breaking prim-tree and Mermaid visualizations.
isaaclab_arena_examples/agentic_environment_generation/review_gui/simapp/kit_viewport.py Adds set_viewport_camera_eye_lookat helper using ViewportCameraState to replace the removed viewport camera API; well-commented with rotate=False guard for fresh stages.
isaaclab_arena_examples/agentic_environment_generation/review_gui/simapp/sim_preview.py Removes the removed viewport_camera_controller path and always calls env.unwrapped.sim.set_camera_view; the simplification is correct given the beta2 API removal.
isaaclab_arena_examples/agentic_environment_generation/review_gui/simapp/thumbnail_capture.py Replaces removed isaacsim.core.utils.viewports.set_camera_view with new set_viewport_camera_eye_lookat helper via get_active_viewport.
.github/workflows/ci.yml Adds isaaclab_arena_examples/tests/ to all four test phases in both uv-run and isaac-sim CI jobs.
isaaclab_arena_examples/tests/test_relation_solver_examples.py Adds with_subprocess markers to the three Isaac Sim smoke tests so they route to the correct CI phase.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["_apply_viewer_cfg(app, viewer_cfg)"] --> B["get_active_viewport()"]
    B --> C["set_viewport_camera_eye_lookat(viewport, eye, lookat)"]
    C --> D{"viewport is not None?"}
    D -- Yes --> E["viewport.get_active_camera()"]
    D -- No --> F["camera_path = '/OmniverseKit_Persp'"]
    E -- path found --> G["ViewportCameraState(camera_path, viewport)"]
    E -- no path --> F
    F --> G
    G --> H["set_position_world(eye, rotate=False)"]
    H --> I["set_target_world(lookat, rotate=True)"]

    J["_apply_overview_camera(env, app, ...)"] --> K["_overview_camera(num_envs, env_spacing)"]
    K --> L["env.unwrapped.sim.set_camera_view(eye, target)"]
    L --> M["pump_app(app, PRE_CAPTURE_UPDATES)"]
Loading

Reviews (1): Last reviewed commit: "Run example tests in CI" | Re-trigger Greptile

Comment on lines +95 to 98
st.iframe(
render_prim_tree_html(prim_tree),
height=estimate_prim_tree_height_px(prim_tree),
scrolling=True,
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 st.iframe takes a URL, not an HTML string

render_prim_tree_html() returns a complete <!DOCTYPE html> document. st.iframe(src, ...) expects src to be a URL pointing to an embeddable page — passing raw HTML as its first argument will silently set the iframe's src attribute to the HTML string itself, which the browser will try to load as a relative path and get a 404, leaving a blank embed. The same issue affects the Mermaid graph block at line 119. The correct top-level replacement for st.components.v1.html(html_str, height=N, scrolling=True) is st.html(html_str) (Streamlit ≥1.36) or continuing to use st.components.v1.html with the scrolling argument removed.

Comment on lines +119 to 122
st.iframe(
render_mermaid_html(spec),
height=estimate_mermaid_height_px(spec),
scrolling=True,
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Same st.iframe/HTML-string mismatch as the prim-tree block

render_mermaid_html(spec) returns a full <!DOCTYPE html> document (confirmed in mermaid_graph.py lines 85-100). Passing it to st.iframe as the first positional argument treats it as a URL source, so the Mermaid spatial-graph panel will render as an empty frame. This should use st.html() (or st.components.v1.html) the same way as the prim-tree fix above.

return
with st.expander("Background prim tree", expanded=False):
st.components.v1.html(
st.iframe(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Bump the streamlit pin for the new APIs

st.iframe only exists in newer Streamlit (~1.56 — it replaced the now-deprecated st.components.v1.iframe), and width="stretch" landed in a 2025 release. But pyproject.toml still pins streamlit>=1.30, so anyone who resolves an older 1.3x–1.5x version hits an AttributeError here (and on the width="stretch" calls). Could we raise the floor to streamlit>=1.56 so the pin matches what the code now needs?

@arena-review-bot

Copy link
Copy Markdown
Contributor

🤖 Isaac Lab-Arena Review Bot

Summary

Focused regression fix for the review-GUI SimApp: the removed viewport-camera APIs are replaced with a Kit-compatible ViewportCameraState helper, the overview-camera path is simplified to env.unwrapped.sim.set_camera_view(...) (nicely dropping a getattr branch), deprecated Streamlit calls are migrated, and the example tests are wired into the existing CI phases. The camera/CI changes read as correct and the layering is sound. One real gap: the new Streamlit APIs require a much newer version than the dependency pin allows.

Findings

🟡 Warning: visualization_widgets.py:95st.iframe (needs Streamlit ~1.56, it replaced the deprecated st.components.v1.iframe) and width="stretch" (a 2025 release) are now used throughout the review GUI, but pyproject.toml still pins streamlit>=1.30. A resolved 1.3x–1.5x version would AttributeError at runtime. Suggest bumping the floor to streamlit>=1.56. (The st.components.v1.htmlst.iframe swap itself is fine — the iframe still executes the mermaid/prim-tree JS.)

Test Coverage

The three Isaac Sim smoke tests correctly gain @pytest.mark.with_subprocess (they use the inner/outer run_simulation_app_function pattern), and the two pure-Python demos stay unmarked in phase 1 — markers line up with the phases. Wiring isaaclab_arena_examples/tests/ into CI is a good regression net.

One thing worth a look: the actual code that was fixed (set_viewport_camera_eye_lookat, _apply_overview_camera, thumbnail capture) is only reached through the review-GUI SimApp server, which the newly-CI'd tests don't exercise — the subprocess smoke tests run the relation-solver notebooks, and test_review_gui.py is mock-based. So this PR adds coverage around the fix but not a rendering test that would catch this specific regression again. Is an end-to-end viewport-capture test feasible, or is that too heavy for CI?

Verdict

Minor fixes needed

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