Auto-open dev extensions after loading

- Dev extensions are now automatically opened in a window after successful load
- Simplified extension finding logic by using devExtensions directly
- Fixed table name handling to support both double quotes and backticks in permission manager
This commit is contained in:
2025-11-04 00:46:46 +01:00
parent 405cf25aab
commit cffb129e4f
2 changed files with 18 additions and 1 deletions

View File

@ -196,7 +196,8 @@ impl PermissionManager {
table_name: &str,
) -> Result<(), ExtensionError> {
// Remove quotes from table name if present (from SDK's getTableName())
let clean_table_name = table_name.trim_matches('"');
// Support both double quotes and backticks (Drizzle uses backticks by default)
let clean_table_name = table_name.trim_matches('"').trim_matches('`');
// Auto-allow: Extensions have full access to their own tables
// Table format: {publicKey}__{extensionName}__{tableName}

View File

@ -122,6 +122,7 @@ const browseExtensionPathAsync = async () => {
}
}
const windowManagerStore = useWindowManagerStore()
// Load a dev extension
const loadDevExtensionAsync = async () => {
if (!extensionPath.value) return
@ -140,9 +141,24 @@ const loadDevExtensionAsync = async () => {
// Reload list
await loadDevExtensionListAsync()
// Get the newly loaded extension info from devExtensions
const newlyLoadedExtension = devExtensions.value.find((ext) =>
extensionPath.value.includes(ext.name),
)
// Reload all extensions in the main extension store so they appear in the launcher
await loadExtensionsAsync()
// Open the newly loaded extension
if (newlyLoadedExtension) {
await windowManagerStore.openWindowAsync({
sourceId: newlyLoadedExtension.id,
type: 'extension',
icon: newlyLoadedExtension.icon || 'i-heroicons-puzzle-piece-solid',
title: newlyLoadedExtension.name,
})
}
// Clear input
extensionPath.value = ''
} catch (error) {