feat(clipping): implement hide/recover toggle for all section dialogs
Update all three section dialogs to support hide/show toggle: SectionAxisDialogManager: - onHideToggle now calls hideSection()/recoverSection() SectionBoxDialogManager: - onHideToggle now calls hideSection()/recoverSection() SectionPlanePanel: - Add isHidden state tracking - Change onHide to onHideToggle(isHidden) - Add setHiddenState/getHiddenState methods - Update button to toggle active state SectionPlaneDialogManager: - Switch to onHideToggle callback - Call hideSection()/recoverSection() based on toggle state Behavior: Click hide button to hide section, click again to recover.
This commit is contained in:
28
src/components/button-group/toolbar/buttons/ai-chat/index.ts
Normal file
28
src/components/button-group/toolbar/buttons/ai-chat/index.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import type { ButtonConfig } from '../../../index.type';
|
||||
import { getIcon } from '../../../../../utils/icon-manager';
|
||||
import { ManagerRegistry } from '../../../../../core/manager-registry';
|
||||
|
||||
export const createAiChatButton = (): ButtonConfig => {
|
||||
const registry = ManagerRegistry.getInstance();
|
||||
|
||||
registry.on('aiChat:opened', () => {
|
||||
registry.toolbar?.setBtnActive('aiChat', true);
|
||||
});
|
||||
|
||||
registry.on('aiChat:closed', () => {
|
||||
registry.toolbar?.setBtnActive('aiChat', false);
|
||||
});
|
||||
|
||||
return {
|
||||
id: 'aiChat',
|
||||
groupId: 'group-2',
|
||||
type: 'button',
|
||||
label: 'aiChat.title',
|
||||
align: 'vertical',
|
||||
keepActive: true,
|
||||
icon: getIcon('bot'),
|
||||
onClick: () => {
|
||||
registry.aiChat?.toggle();
|
||||
}
|
||||
};
|
||||
};
|
||||
@@ -17,6 +17,7 @@ export class Toolbar extends BimButtonGroup {
|
||||
const { createSectionPlaneButton } = await import('./buttons/section/section-plane');
|
||||
const { createSectionAxisButton } = await import('./buttons/section/section-axis');
|
||||
const { createSectionBoxButton } = await import('./buttons/section/section-box');
|
||||
const { createAiChatButton } = await import('./buttons/ai-chat');
|
||||
|
||||
this.addGroup('group-1');
|
||||
|
||||
@@ -31,6 +32,7 @@ export class Toolbar extends BimButtonGroup {
|
||||
this.addButton(createMapButton());
|
||||
this.addButton(createPropertyButton());
|
||||
this.addGroup('group-2');
|
||||
this.addButton(createAiChatButton());
|
||||
this.addButton(createSettingButton());
|
||||
this.addButton(createInfoButton());
|
||||
this.addButton(createFullscreenButton());
|
||||
|
||||
Reference in New Issue
Block a user