openpencil/crates/openpencil-shell-native/src
Kayshen-X 21cb3ca1a9 fix(geometry): canvas_region shrinks for VariablesPanel too (codex BLOCK)
Codex stop-gate flagged: with no selection, the right-rail
`VariablesPanel` was painted (commit 0bd98ae2 wired the paint
step) but `canvas_region` still returned the full viewport width
because its `has_property` gate only checked `property_panel_
visible()` — which is false without a selection. The canvas
paint pass (Step 5) then extended over the right rail and
overpainted the Variables panel, defeating the visibility fix
the previous commit was supposed to deliver.

`crates/openpencil-shell-core/src/document/mutators.rs`:
  - New `Document::right_rail_visible() -> bool` is the unified
    gate: true when either `property_panel_visible()` is true or
    `var_table.variables` is non-empty. Future right-rail widgets
    (Components, Themes header, etc.) extend this method instead
    of patching every caller.

`crates/openpencil-shell-native/src/widget_host/geometry.rs`:
  - `canvas_region` swapped from `property_panel_visible()` to
    `right_rail_visible()`. The shrunk-canvas branch no longer
    requires a selection — any rail-occupying widget reserves the
    column.

Test (1 added, 275 shell-core total):
  - `right_rail_visible_tracks_property_panel_and_variables`
    covers the four state combinations:
      empty doc                       → rail hidden
      var-table-only (no selection)   → rail shown (codex repro)
      selection-only (no vars)        → rail shown (legacy gate)
      cleared selection + cleared vars→ rail hidden again

20 shell-native + 54 desktop + 275 shell-core tests pass.
2026-05-14 17:57:55 +08:00
..
backend feat(shell): canonical .op loader + jian-core layout + visual fidelity pass 2026-05-14 09:26:08 +08:00
context fix(shell-native): cfg-gate desktop GL stack so iOS/Android cargo check passes 2026-05-05 22:24:00 +08:00
widget_host fix(geometry): canvas_region shrinks for VariablesPanel too (codex BLOCK) 2026-05-14 17:57:55 +08:00
boolean_ops.rs fix(shell): boolean ops nested-source removal + drop dead export rect helper 2026-05-14 14:46:28 +08:00
canvas_view_stub.rs feat(shell-native): SharedSkiaContext + NativeBackend over Jian DrawOp 2026-05-05 21:06:00 +08:00
lib.rs feat(shell): boolean path ops (Union / Subtract / Intersect / Exclude) 2026-05-14 14:26:33 +08:00
widget_host.rs refactor(native): split widget_host/input.rs to honor 800-line cap (Task #49) 2026-05-14 17:36:24 +08:00