Repository navigation
editor: frame selected volumes clear of visible authoring panels - #4873
Conversation
|
Holding review: upstream PR #4872 is not yet approved. This stacked PR will be re-evaluated once the upstream lands an approval label. |
jakildev
left a comment
There was a problem hiding this comment.
Review — editor: frame selected volumes clear of visible authoring panels
Verdict: approve
Stacked on #4872 (cross-author). Reviewing the child diff only — upstream is approved separately.
The change does what the PR body says. It adds a FOCUS button and a one-shot initial frame that fit the selected part, local canvas, or whole scene into the largest clear rectangle left by the visible PANEL widgets. Camera yaw and orbit pivot are untouched; only pan and zoom move. The geometry lives in a standalone header (workarea_framing.hpp), so the pure parts are unit-testable without a GL context. The renderer keeps ownership of the projection and DPI mapping (worldPos3DToMouseScreenPxExact, guiTrixelToScreenPx, windowPointsToFramebufferPx), and the editor does not re-derive them.
Verified by reading:
LocalPartEditSession::beginnow seeds the proxy throughrefresh(scene). The oldrecordCount() != dense.voxels_.size()guard is covered byrefresh's size and record-count checks. The new test pinsmaterial_id_,reserved_priority andcolor_surviving into the proxy.editorWorkareais an O(E²·n log n) one-shot over dock edges, run only on a click or at launch, so there is no per-frame cost. I walked the first and third unit-test expectations by hand. The 812×106 and 512×106 mins follow from the 12-trixel gutter, and the result is the largest-area strip.editorFitZoomtest values (13.6, 10.2, 2040) match the formulazoom * min(avail*0.85/extent).- The discrete-zoom round-up is handled by stepping down one power of two, so a fit cannot spill behind a panel.
- The FOCUS button at (532,78) falls in no
workspaceMembershiprect, so it is visible in every workspace. It sits right of the status label, which is clipped at 520. initialFocusDelay_counts down insideupdateWorkspaces, after thedocumentInteractionBlocked()early return, and is set only for an ordinary launch (no session, no reference scene).- No ECS-tick footguns: all of it runs in non-tick editor code. No glm/std math bypasses (
std::sort/std::uniqueare not in the banned set). Added comments state contracts and gotchas, not history, and carry no issue numbers.
Checks
- Green on the head: linux-build, format-check, header-checks, comment-refs, instruction-size, closes-lint, whitespace, no-plan-files.
fleet-tests/gateare red, and the red is inherited, not this PR's.- Both failing suites (
test_fleet_tests_workflow_paths.sh,test_fleet_test_subjects.py) reportscripts/perf/sdf_controls.py: referenced by test_fleet_codex.py but not covered by OUT_OF_TREE_SUBJECTS. git diff origin/master FETCH_HEAD -- scripts/is empty, so the PR changes nothing underscripts/.- I reproduced the same single failure locally on this head with
python3 -I scripts/fleet/tests/test_fleet_test_subjects.py. - Master's Fleet Tests run on c4086a5 fails for the same reason; the later master run at 8a38400 went green (it appears to have skipped the suite).
- Not held against the PR.
- Both failing suites (
- I did not run the GUI harness (
workarea_focus), the new gtest binary, or any render capture on this host. The PR body's macOS/Metal results (116 tests,workarea_focus5/5, five captures) are the author's claim, and I have not re-run them. The PR states Windows/OpenGL hands-on validation is outstanding. The new.pngevidence underdocs/pr-screenshots/was not graded pixel-by-pixel. - No
Closes #Nin the body, so no acceptance grader was dispatched.
Nits (follow-up)
main.cppappendEditorFocusBoundsandworkarea_framing.hppfocusEditorPoints(the round-up step-down branch, the pan delta) are exercised only through theworkarea_focusGUI session. A small unit test for the zoom-step-down branch, with a stubbed zoom, would pin it on hosts that cannot run the GUI harness.initialFocusDelay_ = 2is a bare frame count. A named constant would say it is "transform pipeline frames before first fit".FOCUS conservatively fits full voxel-canvas bounds(PR body, "Limits") is a deliberate choice. An occupied-extent fit would be a reasonable later refinement, not a gap here.
Test plan the author should run before merge
-
fleet-build --target IRVoxelEditorpluspython3 scripts/gui-verify.py IRVoxelEditor -- --gui-session workarea_focuson Windows/OpenGL, since only macOS/Metal evidence is in the body.
🤖 Reviewed by Claude Sonnet 5.5 (review-pr skill)
Escalation: none. Safe for merge.
Opus recheck not required.
6c56b01 to
16e4e63
Compare
|
New commits pushed after fleet approval. Re-tagging |
jakildev
left a comment
There was a problem hiding this comment.
Review — editor: frame selected volumes clear of visible authoring panels
Verdict: approve
Re-review at 16e4e63c2. Stacked on #4872 (cross-author); #4872 now carries fleet:approved, so the upstream gate is cleared. Reviewing the child diff only (HEAD~1..HEAD, 11 files).
Prior-review resolution
My 2026-11-02 review was pinned to 6c56b0107, a different commit from the one now on the branch. That was the carried-forward widget-visibility foundation fix. The branch has since been restacked onto the amended #4872, and the PR's own work is the single commit 16e4e63c2. That commit has no Blockers or Needs-fix to carry over. I re-read the whole commit rather than a delta, because the range is not comparable to the earlier one.
- ✅
local_part_edit.hppbegin()seeds the proxy throughrefresh(scene), and the new test pinsmaterial_id_,reserved_priority andcolor_surviving into the proxy. - ✅
workarea_framing.hppis unchanged in shape: it keepseditorWorkarea(largest clear strip),editorFitZoomandfocusEditorPoints(renderer-owned projection, DPI mapping, yaw and pivot untouched). The unit expectations still follow from the 12-trixel gutter. - ✅ The FOCUS button sits at (532,78), 96×18. The session's click at (580,87) lands inside it, and it is outside every
workspaceMembershiprect, so it is visible in all workspaces. - ✅
initialFocusDelay_ = 2is set only for an ordinary launch (no session, no reference scene). It counts down inupdateWorkspacesafter thedocumentInteractionBlocked()early return.
Checks
- All 12 checks on this head are green, including
linux-build,format-check,header-checks,comment-refs,instruction-size,closes-lint,whitespace,no-plan-files,fleet-testsandgate. The earlier inheritedfleet-tests/gatered from master is gone.mergeStateStatusisCLEANand the PR isMERGEABLE. - I did not run the GUI harness (
workarea_focus), the new gtest binary, or any render capture on this host. The macOS/Metal results in the PR body (116 tests,workarea_focus5/5, five captures) are the author's claim and I have not re-run them. The.pngevidence underdocs/pr-screenshots/was not graded pixel by pixel. The PR states Windows/OpenGL hands-on validation is outstanding. - No
Closes #Nin the body, so no acceptance grader was dispatched.
Checklist
- No ECS-tick footguns. All of it runs in non-tick editor code, and the
forEachComponentinvisibleEditorWorkarearuns only on a click or at launch. - No glm/std math bypasses.
std::sortandstd::uniqueare not in the banned set. - No new serialized records, no shaders and no namespace-scope mutable state.
WorkareaFocusCheckis passed as astatic constexprarray through the predicate context pointer, which outlives the session. - Comments state contracts and carry no history or issue numbers. The
creations/editors/voxel_editor/CLAUDE.mdupdate matches the behaviour.
Nits (follow-up)
- The zoom step-down branch in
focusEditorPointsandappendEditorFocusBoundsare exercised only through theworkarea_focusGUI session. A unit test with a stubbed zoom would pin them on hosts that cannot run the GUI harness. initialFocusDelay_ = 2is a bare frame count. A named constant would say it is "transform pipeline frames before first fit".
Test plan the author should run before merge
-
fleet-build --target IRVoxelEditorpluspython3 scripts/gui-verify.py IRVoxelEditor -- --gui-session workarea_focuson Windows/OpenGL, since only macOS/Metal evidence is in the body.
🤖 Reviewed by Claude Sonnet 5.5 (review-pr skill)
Escalation: none. Safe for merge.
Opus recheck not required.
Summary
FOCUS fits the selected voxel or shape volume into the largest clear part of the viewport without changing camera yaw. Ordinary launch frames its empty authoring grid after transform propagation. Local proxies retain complete authored voxel metadata.
Validation
Scope
GUI evidence is from the combined stack; later controls can appear in captures. Automated workflow checks and inspected screenshots do not substitute for a source-blind usability study. Windows/OpenGL hands-on validation remains outstanding.
Visual evidence
Native macOS/Metal, Apple M4 Max, 3200×1800 captures (1600×900 game coordinates), neutral test/module. These show the final combined-stack workflow. Camera-turn preserves yaw −π/2; the local view uses zoom 32. Selected geometry stays clear of visible panels.
Limits
FOCUS conservatively fits full voxel-canvas bounds, so sparsely occupied parts can appear small. It is explicit after workspace changes; docks remain fixed rather than becoming a dockable workspace system.
Concurrent changes
Trial merges are clean with #4861 and #4863 in creations/editors/voxel_editor/CLAUDE.md and main.cpp. Shared paths with #4868, #4869, #4871 and #4872 are upstream.
Reviewed-foundation integration
The stack incorporates foundation amendment a93a6d6 (hidden-widget hitboxes and visibility persistence) without rewriting published commits. IRVoxelEditor rebuilt at combined-stack head 598b23b. All five follow-up workflows passed: 63/63 assertions across 51 captures, zero layout findings, and five clean exits. The host reported zero monitors during this additional offscreen Metal pass; the longer document and motion runs used the documented 30-second display-discovery grace while retaining the run watchdog, GPU lease, assertions and layout checks. Earlier display-guard terminations are not counted as passes. The earlier unit runs and screenshots remain scoped as described above.