Skip to content

Commit fa26dcf

Browse files
committed
refactor: update uiMap to use component names instead of HTML file names in UIRegistry
1 parent 8154bf0 commit fa26dcf

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

src/ui/registry/registry.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ export class UIRegistry {
8383
}
8484

8585
// Check if we have a mapping for this tool
86-
const htmlFileName = uiMap[toolName];
87-
if (!htmlFileName) {
86+
const componentName = uiMap[toolName];
87+
if (!componentName) {
8888
return undefined;
8989
}
9090

@@ -93,8 +93,8 @@ export class UIRegistry {
9393
return this.cache.get(toolName);
9494
}
9595

96-
// Try to load from disk
97-
const filePath = join(this.uiDistPath, htmlFileName);
96+
// Try to load from disk (component name -> HTML file)
97+
const filePath = join(this.uiDistPath, `${componentName}.html`);
9898
if (!existsSync(filePath)) {
9999
return undefined;
100100
}

src/ui/registry/uiMap.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
/**
2-
* Mapping from tool names to their bundled UI HTML file names
2+
* Mapping from tool names to their UI component names.
33
* Tool names use kebab-case (e.g., 'list-databases')
4-
* HTML files use PascalCase (e.g., 'ListDatabases.html')
4+
* Component names use PascalCase (e.g., 'ListDatabases')
5+
*
6+
* The component name corresponds to the folder in src/ui/components/
7+
* The registry handles resolving this to the built HTML file.
58
*/
69
export const uiMap: Record<string, string> = {
7-
"list-databases": "ListDatabases.html",
10+
"list-databases": "ListDatabases",
811
};

0 commit comments

Comments
 (0)