Skip to content

feat(figure): introduce panel and content hierarchy - #54

Merged
nmrtist merged 1 commit into
mainfrom
feat/panel-content-foundation
Aug 9, 2026
Merged

feat(figure): introduce panel and content hierarchy#54
nmrtist merged 1 commit into
mainfrom
feat/panel-content-foundation

Conversation

@nmrtist

@nmrtist nmrtist commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Summary

Introduce the new Figure → Panel → Content hierarchy for PlotX.

Panels are now first-class semantic objects that own scientific panel labels and descriptions, while typed content items represent plots, raster images, text, and shapes. Ordinary layout groups remain separate from semantic panels.

This PR establishes the domain, persistence, action, rendering, and editor foundations. Image decoding, import entry points, and raster texture rendering remain follow-up work.

What changed

Domain model

  • Add typed PanelId, ContentId, and AssetId.
  • Add first-class Panel and typed ContentItem models.
  • Allow multiple content items within one labeled panel.
  • Keep ordinary layout groups distinct from semantic panels.
  • Disallow nested panels and invalid multi-parent structures.
  • Support empty panels and page-level loose content.
  • Make LayoutGroup the single source of truth for grouping.

Panel labels and descriptions

  • Move panel-label ownership from plots to panels.
  • Support automatic, locked automatic, manual, and hidden labels.
  • Preserve stable automatic-label allocation.
  • Allow Unicode and duplicate manual labels with non-blocking warnings.
  • Render labels independently from the first content item.
  • Restore automatic labels and descriptions in default, DOSY, region-analysis, stack, and existing-canvas insertion workflows.
  • Use meaningful dataset or analysis names instead of Plot 1.
  • Allow panel descriptions to be edited directly below the canvas or through Panel → Description.

Layout and interaction

  • Establish one page-space layout-frame contract for panel-aware editing.
  • Keep panel frames in page coordinates and child content in panel-local coordinates.
  • Update hit testing, selection outlines, dragging, resizing, snapping, arranging, object geometry, and canvas scaling to use that contract.
  • Preserve panel identity and properties during cross-canvas moves.
  • Assign destination-appropriate automatic labels without label drift.
  • Preserve panels, groups, labels, and geometry through undo/redo.
  • Keep objects visible and selectable when temporarily moved outside the page.
  • Continue clipping exported output to the page boundary.
  • Keep untouched processing and region-analysis task cards anchored to the workspace top-right.

Persistence and assets

  • Update the single final schema v1 directly; no migration or legacy fallback code is introduced.
  • Persist panels, content parentage, loose-item order, groups, and next_panel_label_slot.
  • Add immutable, SHA-256-addressed asset records referenced through AssetId.
  • Validate asset IDs, hashes, formats, paths, lengths, dimensions, and shared-blob metadata.
  • Deduplicate physical blobs while allowing multiple asset IDs to reference identical content.
  • Reject invalid projects before producing an unreadable archive.

Rendering

  • Add independent PanelLabel document items.
  • Render panel labels in screen, SVG, and EMF backends.
  • Propagate panel visibility to its content and label.
  • Add an editor rendering mode that permits visible page overflow without changing export clipping.

Product behavior

  • Three visual items may belong to one panel and share one label.
  • A panel may contain plots, raster-image references, text, and shapes.
  • Moving a panel between canvases preserves its semantic identity.
  • Moving b to an empty canvas displays it as a; moving it back beside a restores b.
  • New and copied panels continue to receive stable new label slots.
  • Panel descriptions use meaningful scientific names and are directly editable.
  • Content outside the page remains recoverable in the editor but is excluded from export.

Project-format policy

This change modifies the only supported final schema v1.

It intentionally adds no:

  • draft-format migration;
  • legacy DTO;
  • old-field alias;
  • compatibility fallback;
  • old configuration recovery path.

Validation

  • cargo pr-check

- model semantic panels and typed content/assets in the final v1 schema
- preserve labels, groups, assets, and identity through actions and persistence
- unify panel-aware layout, rendering, captions, transfers, and editor interactions
@nmrtist
nmrtist merged commit edfaa10 into main Aug 9, 2026
11 checks passed
@nmrtist
nmrtist deleted the feat/panel-content-foundation branch August 9, 2026 14:48
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 9, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant