Nodes

← Documentation
STRVCT

The core domain object abstraction, object graph hierarchy, and subnode management in Strvct.

Overview

Nodes (SvNode) are the fundamental domain abstraction in Strvct. Every piece of application state—a document, a user profile, a RPG character sheet, a project folder, or a settings item—is represented as an object inheriting from SvNode.

Nodes form a hierarchical object graph: every node holds an ordered array of child subnodes and a reference to its parentNode. The framework automatically derives the complete user interface from this object graph without hand-authored UI components.

SvNode Subnode tree & parent relationships SvTitledNode Title, subtitle, & path labels SvInspectableNode Property Inspector field generation SvViewableNode View class resolution & tile layout SvStorableNode Persistence & dirty tracking SvSummaryNode Base class for application domain models Each node class level adds an isolated capability. Application domain models typically extend SvSummaryNode or SvStorableNode.

The Node Inheritance Chain

Class NameKey Capability AddedUsage
SvNodeSubnode management, parent/owner referencesRoot base class
SvTitledNodeTitle, subtitle, note, ARIA accessibility, navigation pathLabeled nodes
SvTranslatableNodePer-node translation string cache for i18nInternationalization
SvInspectableNodeProperty Inspector field generation from slot metadataLive debugging
SvViewableNodeView class selection, layout orientation, tile settingsVisual UI presentation
SvStyledNodeTheme class name resolutionProgrammatic styling
SvStorableNodePersistence dirty tracking & IndexedDB serializationPersistent models
SvSummaryNodeConfigurable summary tile formattingStandard app model base

Subnode Operations

The primary structural relationship in Strvct is the parent-child node tree managed via subnodes():

// Adding subnodes
parentNode.addSubnode(childNode);
parentNode.addSubnodeAt(childNode, 0);

// Querying subnodes
parentNode.subnodeCount();
parentNode.subnodeAt(index);
parentNode.hasSubnode(childNode);

// Removing subnodes
parentNode.removeSubnode(childNode);

// Reordering subnodes
parentNode.moveSubnodesToIndex([nodeA, nodeB], 2);

When addSubnode() or removeSubnode() is called, the node automatically posts a change notification ("didChangeSubnodes"), causing active views (SvNavView, SvTilesView) to update smoothly without manual page refreshes.