Fix contact add link to use Contacts_Edit_Action SPA route

Add multi-route support for controllers and SPA actions
Add screenshot feature to rsx:debug and convert contacts edit to SPA

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
root
2025-11-20 19:55:49 +00:00
parent 0e19c811e3
commit ff77724e2b
11 changed files with 555 additions and 61 deletions

View File

@@ -28,10 +28,13 @@ class Route_ManifestSupport extends ManifestSupport_Abstract
*/
public static function process(array &$manifest_data): void
{
// Initialize routes key
// Initialize routes structures
if (!isset($manifest_data['data']['routes'])) {
$manifest_data['data']['routes'] = [];
}
if (!isset($manifest_data['data']['routes_by_target'])) {
$manifest_data['data']['routes_by_target'] = [];
}
// Look for Route attributes - must check all namespaces since Route is not a real class
// PHP attributes without an import will use the current namespace
@@ -99,8 +102,8 @@ class Route_ManifestSupport extends ManifestSupport_Abstract
);
}
// Store route with flat structure
$manifest_data['data']['routes'][$pattern] = [
// Store route with flat structure (for dispatcher)
$route_data = [
'methods' => array_map('strtoupper', (array) $methods),
'type' => $type,
'class' => $item['fqcn'] ?? $item['class'],
@@ -108,7 +111,17 @@ class Route_ManifestSupport extends ManifestSupport_Abstract
'name' => $name,
'file' => $item['file'],
'require' => $require_attrs,
'pattern' => $pattern,
];
$manifest_data['data']['routes'][$pattern] = $route_data;
// Also store by target for URL generation (group multiple routes per controller method)
$target = $item['class'] . '::' . $item['method'];
if (!isset($manifest_data['data']['routes_by_target'][$target])) {
$manifest_data['data']['routes_by_target'][$target] = [];
}
$manifest_data['data']['routes_by_target'][$target][] = $route_data;
}
}
}
@@ -116,5 +129,6 @@ class Route_ManifestSupport extends ManifestSupport_Abstract
// Sort routes alphabetically by path to ensure deterministic behavior and prevent race condition bugs
ksort($manifest_data['data']['routes']);
ksort($manifest_data['data']['routes_by_target']);
}
}