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:
yuding
2026-02-02 16:36:17 +08:00
parent 41abd9ed67
commit 4a09d52283
44 changed files with 17877 additions and 10807 deletions

View 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();
}
};
};

View File

@@ -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());