openpencil/crates/openpencil-shell-native
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
..
examples refactor(shell): promote inspector_window to openpencil-desktop binary crate 2026-05-10 19:50:10 +08:00
notes feat(shell-native): Step 1a Task 4 — basic_window demo + acceptance + Phase C Gate 2026-05-05 22:39:00 +08:00
src fix(geometry): canvas_region shrinks for VariablesPanel too (codex BLOCK) 2026-05-14 17:57:55 +08:00
tests refactor(shell-native): finish v19.4 cleanup — drop orphan event/ + stale test 2026-05-08 22:03:34 +08:00
Cargo.toml docs(shell-native): correct stale Cargo.toml comment about Invariant 2 2026-05-10 10:17:10 +08:00