Skip to content

editor: frame selected volumes clear of visible authoring panels - #4873

Merged
jakildev merged 1 commit into
codex/editor-document-lifecyclefrom
codex/editor-workarea-focus
Nov 5, 2026
Merged

jakildev merged 1 commit into
codex/editor-document-lifecyclefrom
codex/editor-workarea-focus

Conversation

@jakildev

@jakildev jakildev commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

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

  • Built IRVoxelEditor and IrredenEngineTest on macOS/Metal against the combined stack.
  • Focused combined-stack suite: 116 tests, 114 passed, two platform-specific /dev/full skips.
  • Five framing tests and three local-canvas tests passed on the combined stack. workarea_focus passed 5/5 assertions across five captures with zero layout findings; it covers Sculpt/Generate, a camera turn, local canvas, and return to assembly.

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.

Generate Camera turn Local canvas

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.

@jakildev jakildev added fleet:author-codex Implementation last authored by Codex; route review to Claude fleet:authored-on-macos PR was authored and smoke-tested on macOS Metal backend labels Nov 2, 2026
@jakildev
jakildev added this pull request to stack #4870 November 2, 2026 07:09
@jakildev jakildev added the fleet:awaiting-upstream-review Stacked PR; reviewer is holding verdict until upstream PR is approved label Nov 2, 2026
@jakildev

jakildev commented Nov 2, 2026

Copy link
Copy Markdown
Owner Author

Holding review: upstream PR #4872 is not yet approved. This stacked PR will be re-evaluated once the upstream lands an approval label.

@jakildev jakildev left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

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::begin now seeds the proxy through refresh(scene). The old recordCount() != dense.voxels_.size() guard is covered by refresh's size and record-count checks. The new test pins material_id_, reserved_ priority and color_ surviving into the proxy.
  • editorWorkarea is 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.
  • editorFitZoom test values (13.6, 10.2, 2040) match the formula zoom * 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 workspaceMembership rect, so it is visible in every workspace. It sits right of the status label, which is clipped at 520.
  • initialFocusDelay_ counts down inside updateWorkspaces, after the documentInteractionBlocked() 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::unique are 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 / gate are red, and the red is inherited, not this PR's.
    • Both failing suites (test_fleet_tests_workflow_paths.sh, test_fleet_test_subjects.py) report scripts/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 under scripts/.
    • 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.
  • 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_focus 5/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 .png evidence under docs/pr-screenshots/ was not graded pixel-by-pixel.
  • No Closes #N in the body, so no acceptance grader was dispatched.

Nits (follow-up)

  • main.cpp appendEditorFocusBounds and workarea_framing.hpp focusEditorPoints (the round-up step-down branch, the pan delta) are exercised only through the workarea_focus GUI 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_ = 2 is 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 IRVoxelEditor plus python3 scripts/gui-verify.py IRVoxelEditor -- --gui-session workarea_focus on 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.

@jakildev jakildev added fleet:approved Fleet reviewer approved — ready for human merge fleet:needs-windows-smoke PR needs windows-debug build + smoke-run validation and removed fleet:reviewing-mac-pool-1 labels Nov 2, 2026
@jakildev
jakildev force-pushed the codex/editor-workarea-focus branch from 6c56b01 to 16e4e63 Compare November 4, 2026 05:54
@github-actions github-actions Bot added human:re-review Human pushed changes to an approved PR — fleet should re-review and removed fleet:approved Fleet reviewer approved — ready for human merge labels Nov 4, 2026
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

New commits pushed after fleet approval. Re-tagging human:re-review so the fleet picks it up again.

@jakildev jakildev added fleet:awaiting-upstream-review Stacked PR; reviewer is holding verdict until upstream PR is approved and removed human:re-review Human pushed changes to an approved PR — fleet should re-review labels Nov 4, 2026
@jakildev

jakildev commented Nov 4, 2026

Copy link
Copy Markdown
Owner Author

Holding review: upstream PR #4872 is not yet approved (new commits landed after its approval and it is now itself gated on #4871). This stacked PR will be re-evaluated once the upstream lands an approval label.

@jakildev jakildev removed the fleet:awaiting-upstream-review Stacked PR; reviewer is holding verdict until upstream PR is approved label Nov 4, 2026

@jakildev jakildev left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

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.hpp begin() seeds the proxy through refresh(scene), and the new test pins material_id_, reserved_ priority and color_ surviving into the proxy.
  • ✅ workarea_framing.hpp is unchanged in shape: it keeps editorWorkarea (largest clear strip), editorFitZoom and focusEditorPoints (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 workspaceMembership rect, so it is visible in all workspaces.
  • ✅ initialFocusDelay_ = 2 is set only for an ordinary launch (no session, no reference scene). It counts down in updateWorkspaces after the documentInteractionBlocked() 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-tests and gate. The earlier inherited fleet-tests / gate red from master is gone. mergeStateStatus is CLEAN and the PR is MERGEABLE.
  • 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_focus 5/5, five captures) are the author's claim and I have not re-run them. The .png evidence under docs/pr-screenshots/ was not graded pixel by pixel. The PR states Windows/OpenGL hands-on validation is outstanding.
  • No Closes #N in the body, so no acceptance grader was dispatched.

Checklist

  • No ECS-tick footguns. All of it runs in non-tick editor code, and the forEachComponent in visibleEditorWorkarea runs only on a click or at launch.
  • No glm/std math bypasses. std::sort and std::unique are not in the banned set.
  • No new serialized records, no shaders and no namespace-scope mutable state. WorkareaFocusCheck is passed as a static constexpr array 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.md update matches the behaviour.

Nits (follow-up)

  • The zoom step-down branch in focusEditorPoints and appendEditorFocusBounds are exercised only through the workarea_focus GUI session. A unit test with a stubbed zoom would pin them on hosts that cannot run the GUI harness.
  • initialFocusDelay_ = 2 is 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 IRVoxelEditor plus python3 scripts/gui-verify.py IRVoxelEditor -- --gui-session workarea_focus on 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.

@jakildev jakildev added fleet:approved Fleet reviewer approved — ready for human merge and removed fleet:reviewing-mac-pool-1 labels Nov 4, 2026
@jakildev
jakildev merged commit ef48a2e into master Nov 5, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fleet:approved Fleet reviewer approved — ready for human merge fleet:author-codex Implementation last authored by Codex; route review to Claude fleet:authored-on-macos PR was authored and smoke-tested on macOS Metal backend fleet:needs-windows-smoke PR needs windows-debug build + smoke-run validation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant