How the view layer connects to model nodes, resolves view classes, synchronizes state, and provides navigation without hand-authored UI code.
In STRVCT, every domain node (SvNode) automatically receives a visual presentation: the framework discovers the matching view class, instantiates views lazily on demand, wires up observation notifications, and keeps views synchronized as model slots mutate.
Rather than subclassing raw HTML elements directly, STRVCT wraps DOM elements in a single-inheritance hierarchy where each layer adds one capability:
| View Class Layer | Added Capability |
|---|---|
SvElementDomView | Wraps DOM element; manages creation, type, and class attributes. |
SvVisibleDomView | Visibility toggling (setIsVisible(bool)). |
SvResponderDomView | Responder chain for keyboard and mouse event routing. |
SvListenerDomView | DOM event listener registration and removal. |
SvControlDomView | Target/action pattern connecting views to event handlers. |
SvSelectableDomView | Selection state with styled visual feedback. |
SvEditableDomView | Content editability and edit mode toggling. |
SvGesturableDomView | Gesture recognizers (tap, double-tap, pan, long-press, pinch). |
SvFlexDomView | Flexbox layout properties (direction, wrap, grow, shrink, alignment). |
SvStyledDomView | State-based styling (unselected, selected, active, disabled) with theme support. |
SvSubviewsDomView | Parent/child subview hierarchy management. |
SvCssDomView | Applies CSS variables from dictionaries to element styles. |
SvDomView | Aggregates all layers above into the complete DOM view wrapper. |
SvNodeView | Binds model SvNode to DOM presentation; handles observation & sync. |
SvNodeView is the primary class for application views:
setNode(aNode): Assigns a model node and registers change observations via SvNotificationCenter.syncFromNode(): Diffs visible subnodes against active subviews, instantiating, reusing, or purging views as needed.subviewProtoForSubnode(aSubnode): Resolves which view class to instantiate for a child subnode.syncCssFromNode(): Applies CSS variables defined on the model node to the DOM element.When a node becomes visible, the framework discovers its view class using naming conventions:
nodeViewClassName override on the node.SvNode).ClassName + "View" in global scope.SvNodeView.Example: For Character extending SvStorableNode, resolution checks CharacterView $\rightarrow$ SvStorableNodeView $\rightarrow$ SvNodeView.
SvStackViewSvStackView is the recursive building block of navigation, splitting into two areas:
SvNavView (Master): A column containing a header, scrollable SvTilesView, and footer.otherView (Detail): Content area for the selected tile—typically a child SvStackView.Selecting a tile creates a new child SvStackView in the detail area. Orientation is set per node ("right" for horizontal master-left/detail-right, "down" for vertical master-top/detail-below).
SvBrowserViewTop-level application container managing nested SvStackView columns to arbitrary depth. Includes a breadcrumb header that auto-compacts on narrow viewports:
navigateToNode(aNode): Navigates directly to a target node in the graph.selectNodePathArray(pathArray): Programmatically sets the full navigation path.Tiles are individual items rendered inside SvTilesView columns:
| Tile Class | Purpose & Visual Presentation |
|---|---|
SvTile | Base tile class. Handles selection, long-press reorder, slide-to-delete, and style state cascades. |
SvTitledTile | Default tile. Displays title, subtitle, and note from SvSummaryNode. |
SvHeaderTile | Non-selectable section header tile. |
SvBreadCrumbsTile | Compact breadcrumb trail tile. |
SvFieldTile):Field tiles render key-value property slots as editable controls:
| Field Tile Class | Property Control Type |
|---|---|
SvStringFieldTile | Single-line text input |
SvTextAreaFieldTile | Multi-line text area editor |
SvBooleanFieldTile | Checkbox toggle control |
SvPasswordFieldTile | Masked password text input |
SvActionFieldTile | Button triggering a node method |
SvPointerFieldTile | Object reference with navigation arrow |
SvImageWellFieldTile | Image preview well with drag-and-drop support |
SvVideoWellFieldTile | Video player well with drag-and-drop support |