title( function_exists( 'openstation_my_wordpress_app_title' ) ? openstation_my_wordpress_app_title() : __( 'WP Explorer', 'desktop-mode' ) ) ->icon( function_exists( 'openstation_my_wordpress_icon_svg' ) ? openstation_my_wordpress_icon_svg() : ICON ) ->size( 960, 640 ) ->min_size( 640, 420 ) ->placement( 'none' ) ->desktop_icon( array( 'position' => -1, 'pinned' => true, ) ) ->capabilities( 'edit_posts' ) ->watch( '*' ) ->state( array( 'group' => '', 'section' => '', 'item' => 0, 'into' => 0, 'relation' => '', // The activity footprint: whose fills the body (0 = closed), // and their name for the breadcrumb before the payload lands. 'footprint' => 0, 'fpName' => '', 'query' => '', 'page' => 1, 'sort' => '', 'selected' => array(), // How a section lists: the tile canvas (`icons`) or the // sortable table (`list`). Remembered per user — restored // on mount, saved by the `view` action. 'view' => 'icons', // The Agents section. `item` doubles as the selected agent; // the rest is the wizard: which detail tab is open, whether // the create flow is on and at which station, the agent // taking shape in it (an untyped slot — the client rolls // its face and its seeds, the server drafts into it and // creates from it), and the two message rails the original // kept in renderer state. 'pane' => 'define', 'casting' => false, 'wstep' => 0, 'cast' => null, 'agentNotice' => '', 'briefError' => '', ) ) ->title_bar_button( 'refresh', array( 'label' => __( 'Refresh', 'desktop-mode' ), 'icon' => 'reload', 'action' => 'refresh', ) ) // `refresh` is the framework's built-in: recompute data(), re-render. // The remembered view mode lands before the first paint. ->mount( __NAMESPACE__ . '\mount' ) // Navigation — parts/actions.php. ->action( 'go', __NAMESPACE__ . '\go_action' ) ->action( 'back', __NAMESPACE__ . '\back_action' ) ->action( 'open', __NAMESPACE__ . '\open_action' ) ->action( 'into', __NAMESPACE__ . '\into_action' ) ->action( 'relation', __NAMESPACE__ . '\relation_action' ) ->action( 'footprint', __NAMESPACE__ . '\footprint_action' ) ->action( 'sub-open-post', __NAMESPACE__ . '\sub_open_post_action' ) // List controls: the bound values already arrived with the state; // these only reposition the query window. ->action( 'search', static function ( State $state ) { $state->set( 'page', 1 )->set( 'item', 0 )->reset( 'selected' ); } ) ->action( 'more', static function ( State $state ) { $state->set( 'page', (int) $state->get( 'page' ) + 1 ); } ) ->action( 'sort', static function ( State $state ) { $state->set( 'page', 1 )->reset( 'selected' ); } ) // The list view: the mode switch and the column chooser, both // remembered per user — parts/actions.php. ->action( 'view', __NAMESPACE__ . '\view_action' ) ->action( 'set-columns', __NAMESPACE__ . '\set_columns_action' ) // Content mutations — parts/actions.php. ->action( 'edit', __NAMESPACE__ . '\edit_action' ) ->action( 'add-user', __NAMESPACE__ . '\add_user_action' ) ->action( 'trash', __NAMESPACE__ . '\trash_action' ) ->action( 'sub-open', __NAMESPACE__ . '\sub_open_action' ) ->action( 'quick-edit', __NAMESPACE__ . '\quick_edit_action' ) ->action( 'bulk-trash', __NAMESPACE__ . '\bulk_trash_action' ) // The Agents section — parts/agents.php. ->action( 'agent-draft', __NAMESPACE__ . '\agent_draft_action' ) ->action( 'agent-create', __NAMESPACE__ . '\agent_create_action' ) ->action( 'agent-update', __NAMESPACE__ . '\agent_update_action' ) ->action( 'agent-delete', __NAMESPACE__ . '\agent_delete_action' ) // The data payload — parts/payload.php. ->data( __NAMESPACE__ . '\payload' );