refactor(managers): accept registry parameter via constructor injection
All 16 managers now receive ManagerRegistry instance through constructor instead of calling ManagerRegistry.getInstance(). This enables each BimEngine instance to have its own isolated set of managers. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -23,8 +23,8 @@ export class EngineManager extends BaseManager {
|
||||
/** 右键菜单管理器 */
|
||||
public rightKey: RightKeyManager | null = null;
|
||||
|
||||
constructor(container: HTMLElement) {
|
||||
super();
|
||||
constructor(container: HTMLElement, registry: ManagerRegistry) {
|
||||
super(registry);
|
||||
this.container = container;
|
||||
}
|
||||
|
||||
@@ -44,11 +44,11 @@ export class EngineManager extends BaseManager {
|
||||
this.engineInstance = new Engine({
|
||||
container: this.container,
|
||||
...options,
|
||||
});
|
||||
}, this.registry);
|
||||
|
||||
this.engineInstance.init();
|
||||
|
||||
this.rightKey = new RightKeyManager(this.container);
|
||||
this.rightKey = new RightKeyManager(this.container, this.registry);
|
||||
|
||||
this.rightKey.registerHandler((_e) => {
|
||||
const selected = this.getSelectedComponent();
|
||||
@@ -63,7 +63,7 @@ export class EngineManager extends BaseManager {
|
||||
order: 1,
|
||||
divider: true,
|
||||
onClick: () => {
|
||||
const registry = ManagerRegistry.getInstance();
|
||||
const registry = this.registry;
|
||||
registry.componentDetail?.show();
|
||||
this.rightKey?.hide();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user