Fix blank page issue on module route refresh

- Pre-register all module routes automatically from module definitions in router configuration
- Add useModuleReady composable for clean reactive loading states during module initialization
- Update ChatPage and EventsPage with proper loading/error states and computed service access
- Remove duplicate route registration from plugin manager install phase
- Maintain modular architecture while ensuring routes are available immediately on app startup

Resolves blank pages and Vue Router warnings when refreshing on /chat, /events, /my-tickets routes.
Users now see proper loading indicators instead of blank screens during module initialization.

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

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
padreug 2025-09-06 16:33:32 +02:00
parent 85635cfc96
commit 7145af3f83
5 changed files with 140 additions and 15 deletions

View file

@ -53,6 +53,12 @@ export class PluginManager {
this.modules.set(plugin.name, registration)
console.log(`📦 Registered module: ${plugin.name} v${plugin.version}`)
// Routes are now pre-registered during router creation
// This registration step is kept for potential dynamic route additions in the future
if (plugin.routes && this.router) {
console.log(`🛤️ ${plugin.name} routes already pre-registered (${plugin.routes.length} routes)`)
}
// Auto-install if enabled and not lazy
if (config.enabled && !config.lazy) {
await this.install(plugin.name)
@ -98,12 +104,7 @@ export class PluginManager {
await plugin.install(this.app, { config: config.config })
// Register routes if provided
if (plugin.routes && this.router) {
for (const route of plugin.routes) {
this.router.addRoute(route)
}
}
// Routes are already registered during the register() phase
// Register services in DI container
if (plugin.services) {