@theia/core 1.77.0-next.7 → 1.77.0-next.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/lib/browser/breadcrumbs/breadcrumbs-renderer.js +1 -1
- package/lib/browser/breadcrumbs/breadcrumbs-renderer.js.map +1 -1
- package/lib/browser/catalog.json +304 -18
- package/lib/browser/color-application-contribution.d.ts +7 -1
- package/lib/browser/color-application-contribution.d.ts.map +1 -1
- package/lib/browser/color-application-contribution.js +15 -4
- package/lib/browser/color-application-contribution.js.map +1 -1
- package/lib/browser/color-application-contribution.spec.d.ts +2 -0
- package/lib/browser/color-application-contribution.spec.d.ts.map +1 -0
- package/lib/browser/color-application-contribution.spec.js +96 -0
- package/lib/browser/color-application-contribution.spec.js.map +1 -0
- package/lib/browser/color-registry.d.ts +7 -1
- package/lib/browser/color-registry.d.ts.map +1 -1
- package/lib/browser/color-registry.js +12 -0
- package/lib/browser/color-registry.js.map +1 -1
- package/lib/browser/common-commands.d.ts +3 -0
- package/lib/browser/common-commands.d.ts.map +1 -1
- package/lib/browser/common-commands.js +15 -0
- package/lib/browser/common-commands.js.map +1 -1
- package/lib/browser/common-frontend-contribution.d.ts +8 -1
- package/lib/browser/common-frontend-contribution.d.ts.map +1 -1
- package/lib/browser/common-frontend-contribution.js +47 -3
- package/lib/browser/common-frontend-contribution.js.map +1 -1
- package/lib/browser/common-frontend-contribution.spec.js +2 -1
- package/lib/browser/common-frontend-contribution.spec.js.map +1 -1
- package/lib/browser/components/card.d.ts +1 -1
- package/lib/browser/components/card.d.ts.map +1 -1
- package/lib/browser/components/card.js +3 -2
- package/lib/browser/components/card.js.map +1 -1
- package/lib/browser/connection-status-service.spec.js +2 -1
- package/lib/browser/connection-status-service.spec.js.map +1 -1
- package/lib/browser/context-key-service.d.ts +11 -0
- package/lib/browser/context-key-service.d.ts.map +1 -1
- package/lib/browser/context-key-service.js +7 -0
- package/lib/browser/context-key-service.js.map +1 -1
- package/lib/browser/decorations-service.spec.js +2 -1
- package/lib/browser/decorations-service.spec.js.map +1 -1
- package/lib/browser/dialogs/react-dialog.spec.js +2 -1
- package/lib/browser/dialogs/react-dialog.spec.js.map +1 -1
- package/lib/browser/diff-uris.js +1 -1
- package/lib/browser/diff-uris.js.map +1 -1
- package/lib/browser/endpoint.js +2 -1
- package/lib/browser/endpoint.js.map +1 -1
- package/lib/browser/endpoint.spec.js +2 -1
- package/lib/browser/endpoint.spec.js.map +1 -1
- package/lib/browser/frontend-application-module.d.ts.map +1 -1
- package/lib/browser/frontend-application-module.js +3 -0
- package/lib/browser/frontend-application-module.js.map +1 -1
- package/lib/browser/keybinding.d.ts +95 -17
- package/lib/browser/keybinding.d.ts.map +1 -1
- package/lib/browser/keybinding.js +406 -76
- package/lib/browser/keybinding.js.map +1 -1
- package/lib/browser/keybinding.spec.js +804 -33
- package/lib/browser/keybinding.spec.js.map +1 -1
- package/lib/browser/keyboard/browser-keyboard-frontend-contribution.js +1 -1
- package/lib/browser/keyboard/browser-keyboard-frontend-contribution.js.map +1 -1
- package/lib/browser/keyboard/browser-keyboard-layout-provider.d.ts +3 -4
- package/lib/browser/keyboard/browser-keyboard-layout-provider.d.ts.map +1 -1
- package/lib/browser/keyboard/browser-keyboard-layout-provider.js +3 -3
- package/lib/browser/keyboard/browser-keyboard-layout-provider.js.map +1 -1
- package/lib/browser/keyboard/browser-keyboard-layout-provider.spec.js +42 -3
- package/lib/browser/keyboard/browser-keyboard-layout-provider.spec.js.map +1 -1
- package/lib/browser/keyboard/keyboard-layout-service.d.ts +67 -15
- package/lib/browser/keyboard/keyboard-layout-service.d.ts.map +1 -1
- package/lib/browser/keyboard/keyboard-layout-service.js +313 -98
- package/lib/browser/keyboard/keyboard-layout-service.js.map +1 -1
- package/lib/browser/keyboard/keyboard-layout-service.spec.js +570 -15
- package/lib/browser/keyboard/keyboard-layout-service.spec.js.map +1 -1
- package/lib/browser/keyboard/keys.spec.js +187 -3
- package/lib/browser/keyboard/keys.spec.js.map +1 -1
- package/lib/browser/label-provider.d.ts.map +1 -1
- package/lib/browser/label-provider.js +5 -3
- package/lib/browser/label-provider.js.map +1 -1
- package/lib/browser/label-provider.spec.js +2 -1
- package/lib/browser/label-provider.spec.js.map +1 -1
- package/lib/browser/markdown-rendering/markdown-link-handler.js +2 -1
- package/lib/browser/markdown-rendering/markdown-link-handler.js.map +1 -1
- package/lib/browser/markdown-rendering/markdown-renderer.d.ts +1 -1
- package/lib/browser/markdown-rendering/markdown-renderer.d.ts.map +1 -1
- package/lib/browser/markdown-rendering/markdown-renderer.js +4 -4
- package/lib/browser/markdown-rendering/markdown-renderer.js.map +1 -1
- package/lib/browser/markdown-rendering/markdown.js +2 -1
- package/lib/browser/markdown-rendering/markdown.js.map +1 -1
- package/lib/browser/markdown-rendering/markdown.spec.js +2 -1
- package/lib/browser/markdown-rendering/markdown.spec.js.map +1 -1
- package/lib/browser/menu/action-menu-node.d.ts +5 -3
- package/lib/browser/menu/action-menu-node.d.ts.map +1 -1
- package/lib/browser/menu/action-menu-node.js +2 -11
- package/lib/browser/menu/action-menu-node.js.map +1 -1
- package/lib/browser/menu/action-menu-node.spec.d.ts +2 -0
- package/lib/browser/menu/action-menu-node.spec.d.ts.map +1 -0
- package/lib/browser/menu/action-menu-node.spec.js +54 -0
- package/lib/browser/menu/action-menu-node.spec.js.map +1 -0
- package/lib/browser/menu/browser-menu-plugin.js +1 -1
- package/lib/browser/menu/browser-menu-plugin.js.map +1 -1
- package/lib/browser/menu/menu.spec.js +2 -1
- package/lib/browser/menu/menu.spec.js.map +1 -1
- package/lib/browser/opener-service.spec.js +3 -2
- package/lib/browser/opener-service.spec.js.map +1 -1
- package/lib/browser/perspective-service.spec.js +2 -1
- package/lib/browser/perspective-service.spec.js.map +1 -1
- package/lib/browser/preferences/preference-proxy.spec.js +2 -1
- package/lib/browser/preferences/preference-proxy.spec.js.map +1 -1
- package/lib/browser/preferences/preference-schema-provider.spec.js +2 -1
- package/lib/browser/preferences/preference-schema-provider.spec.js.map +1 -1
- package/lib/browser/preferences/preference-service.spec.js +2 -1
- package/lib/browser/preferences/preference-service.spec.js.map +1 -1
- package/lib/browser/preferences/preference-validation-service.spec.js +78 -77
- package/lib/browser/preferences/preference-validation-service.spec.js.map +1 -1
- package/lib/browser/quick-input/quick-command-service.d.ts +10 -1
- package/lib/browser/quick-input/quick-command-service.d.ts.map +1 -1
- package/lib/browser/quick-input/quick-command-service.js +31 -6
- package/lib/browser/quick-input/quick-command-service.js.map +1 -1
- package/lib/browser/quick-input/quick-command-service.spec.d.ts +2 -0
- package/lib/browser/quick-input/quick-command-service.spec.d.ts.map +1 -0
- package/lib/browser/quick-input/quick-command-service.spec.js +130 -0
- package/lib/browser/quick-input/quick-command-service.spec.js.map +1 -0
- package/lib/browser/quick-input/quick-help-service.js +1 -1
- package/lib/browser/quick-input/quick-help-service.js.map +1 -1
- package/lib/browser/quick-input/quick-input-service.spec.js +2 -1
- package/lib/browser/quick-input/quick-input-service.spec.js.map +1 -1
- package/lib/browser/quick-input/quick-pick-service-impl.d.ts +6 -6
- package/lib/browser/quick-input/quick-pick-service-impl.d.ts.map +1 -1
- package/lib/browser/quick-input/quick-view-service.spec.js +2 -1
- package/lib/browser/quick-input/quick-view-service.spec.js.map +1 -1
- package/lib/browser/secondary-window-handler.d.ts +4 -4
- package/lib/browser/secondary-window-handler.d.ts.map +1 -1
- package/lib/browser/shell/application-shell.js +1 -1
- package/lib/browser/shell/application-shell.js.map +1 -1
- package/lib/browser/shell/application-shell.spec.js +2 -1
- package/lib/browser/shell/application-shell.spec.js.map +1 -1
- package/lib/browser/shell/index.d.ts +1 -0
- package/lib/browser/shell/index.d.ts.map +1 -1
- package/lib/browser/shell/index.js +1 -0
- package/lib/browser/shell/index.js.map +1 -1
- package/lib/browser/shell/shell-layout-restorer.d.ts +2 -0
- package/lib/browser/shell/shell-layout-restorer.d.ts.map +1 -1
- package/lib/browser/shell/shell-layout-restorer.js +6 -0
- package/lib/browser/shell/shell-layout-restorer.js.map +1 -1
- package/lib/browser/shell/shell-layout-restorer.spec.js +9 -1
- package/lib/browser/shell/shell-layout-restorer.spec.js.map +1 -1
- package/lib/browser/shell/side-panel-handler.d.ts +12 -1
- package/lib/browser/shell/side-panel-handler.d.ts.map +1 -1
- package/lib/browser/shell/side-panel-handler.js +73 -0
- package/lib/browser/shell/side-panel-handler.js.map +1 -1
- package/lib/browser/shell/side-panel-handler.spec.d.ts +2 -0
- package/lib/browser/shell/side-panel-handler.spec.d.ts.map +1 -0
- package/lib/browser/shell/side-panel-handler.spec.js +85 -0
- package/lib/browser/shell/side-panel-handler.spec.js.map +1 -0
- package/lib/browser/shell/side-panel-item-visibility.d.ts +55 -0
- package/lib/browser/shell/side-panel-item-visibility.d.ts.map +1 -0
- package/lib/browser/shell/side-panel-item-visibility.js +100 -0
- package/lib/browser/shell/side-panel-item-visibility.js.map +1 -0
- package/lib/browser/shell/side-panel-item-visibility.spec.d.ts +2 -0
- package/lib/browser/shell/side-panel-item-visibility.spec.d.ts.map +1 -0
- package/lib/browser/shell/side-panel-item-visibility.spec.js +80 -0
- package/lib/browser/shell/side-panel-item-visibility.spec.js.map +1 -0
- package/lib/browser/shell/side-panel-toolbar.d.ts +1 -1
- package/lib/browser/shell/side-panel-toolbar.d.ts.map +1 -1
- package/lib/browser/shell/sidebar-menu-widget.js +1 -1
- package/lib/browser/shell/sidebar-menu-widget.js.map +1 -1
- package/lib/browser/shell/tab-bar-toolbar/tab-bar-toolbar.js +1 -1
- package/lib/browser/shell/tab-bar-toolbar/tab-bar-toolbar.js.map +1 -1
- package/lib/browser/shell/tab-bar-toolbar/tab-bar-toolbar.spec.js +2 -1
- package/lib/browser/shell/tab-bar-toolbar/tab-bar-toolbar.spec.js.map +1 -1
- package/lib/browser/shell/tab-bars.d.ts +17 -0
- package/lib/browser/shell/tab-bars.d.ts.map +1 -1
- package/lib/browser/shell/tab-bars.js +33 -15
- package/lib/browser/shell/tab-bars.js.map +1 -1
- package/lib/browser/shell/tab-bars.spec.js +86 -0
- package/lib/browser/shell/tab-bars.spec.js.map +1 -1
- package/lib/browser/status-bar/status-bar.js +1 -1
- package/lib/browser/status-bar/status-bar.js.map +1 -1
- package/lib/browser/storage-service.spec.js +2 -1
- package/lib/browser/storage-service.spec.js.map +1 -1
- package/lib/browser/test/jsdom.d.ts.map +1 -1
- package/lib/browser/test/jsdom.js +11 -0
- package/lib/browser/test/jsdom.js.map +1 -1
- package/lib/browser/tooltip-service.js +1 -1
- package/lib/browser/tooltip-service.js.map +1 -1
- package/lib/browser/tree/tree-compression/compressed-tree-model.d.ts +2 -0
- package/lib/browser/tree/tree-compression/compressed-tree-model.d.ts.map +1 -1
- package/lib/browser/tree/tree-compression/compressed-tree-model.js +6 -2
- package/lib/browser/tree/tree-compression/compressed-tree-model.js.map +1 -1
- package/lib/browser/tree/tree-compression/compressed-tree-model.spec.d.ts +2 -0
- package/lib/browser/tree/tree-compression/compressed-tree-model.spec.d.ts.map +1 -0
- package/lib/browser/tree/tree-compression/compressed-tree-model.spec.js +52 -0
- package/lib/browser/tree/tree-compression/compressed-tree-model.spec.js.map +1 -0
- package/lib/browser/tree/tree-consistency.spec.js +1 -1
- package/lib/browser/tree/tree-consistency.spec.js.map +1 -1
- package/lib/browser/tree/tree-container.spec.js +6 -5
- package/lib/browser/tree/tree-container.spec.js.map +1 -1
- package/lib/browser/tree/tree-iterator.js +1 -1
- package/lib/browser/tree/tree-iterator.js.map +1 -1
- package/lib/browser/tree/tree-model.js +2 -2
- package/lib/browser/tree/tree-model.js.map +1 -1
- package/lib/browser/tree/tree-selection-state.d.ts +23 -1
- package/lib/browser/tree/tree-selection-state.d.ts.map +1 -1
- package/lib/browser/tree/tree-selection-state.js +23 -1
- package/lib/browser/tree/tree-selection-state.js.map +1 -1
- package/lib/browser/tree/tree-view-welcome-widget.js +1 -1
- package/lib/browser/tree/tree-view-welcome-widget.js.map +1 -1
- package/lib/browser/tree/tree-widget.d.ts +2 -2
- package/lib/browser/tree/tree-widget.d.ts.map +1 -1
- package/lib/browser/tree/tree-widget.js +3 -4
- package/lib/browser/tree/tree-widget.js.map +1 -1
- package/lib/browser/tree/tree-widget.spec.js +18 -0
- package/lib/browser/tree/tree-widget.spec.js.map +1 -1
- package/lib/browser/tree/tree.spec.js +2 -1
- package/lib/browser/tree/tree.spec.js.map +1 -1
- package/lib/browser/user-working-directory-provider.js +1 -1
- package/lib/browser/user-working-directory-provider.js.map +1 -1
- package/lib/browser/view-container.d.ts.map +1 -1
- package/lib/browser/view-container.js +2 -1
- package/lib/browser/view-container.js.map +1 -1
- package/lib/browser/widget-status-bar-service.d.ts +3 -1
- package/lib/browser/widget-status-bar-service.d.ts.map +1 -1
- package/lib/browser/widget-status-bar-service.js +15 -2
- package/lib/browser/widget-status-bar-service.js.map +1 -1
- package/lib/browser/widget-status-bar-service.spec.d.ts +2 -0
- package/lib/browser/widget-status-bar-service.spec.d.ts.map +1 -0
- package/lib/browser/widget-status-bar-service.spec.js +92 -0
- package/lib/browser/widget-status-bar-service.spec.js.map +1 -0
- package/lib/browser/widgets/react-renderer.js +1 -1
- package/lib/browser/widgets/react-renderer.js.map +1 -1
- package/lib/browser/widgets/react-widget.js +1 -1
- package/lib/browser/widgets/react-widget.js.map +1 -1
- package/lib/browser/widgets/select-component.d.ts.map +1 -1
- package/lib/browser/widgets/select-component.js +10 -14
- package/lib/browser/widgets/select-component.js.map +1 -1
- package/lib/browser/widgets/select-component.spec.d.ts +2 -0
- package/lib/browser/widgets/select-component.spec.d.ts.map +1 -0
- package/lib/browser/widgets/select-component.spec.js +67 -0
- package/lib/browser/widgets/select-component.spec.js.map +1 -0
- package/lib/browser/widgets/widget.js +1 -1
- package/lib/browser/widgets/widget.js.map +1 -1
- package/lib/common/buffer.js +3 -2
- package/lib/common/buffer.js.map +1 -1
- package/lib/common/cancellation.js.map +1 -1
- package/lib/common/command.spec.js +2 -1
- package/lib/common/command.spec.js.map +1 -1
- package/lib/common/core-preferences.js +5 -5
- package/lib/common/core-preferences.js.map +1 -1
- package/lib/common/disposable.spec.js +3 -2
- package/lib/common/disposable.spec.js.map +1 -1
- package/lib/common/encoding-service.js +2 -2
- package/lib/common/encoding-service.js.map +1 -1
- package/lib/common/event.d.ts +1 -1
- package/lib/common/event.d.ts.map +1 -1
- package/lib/common/event.js +0 -1
- package/lib/common/event.js.map +1 -1
- package/lib/common/file-uri.js +2 -1
- package/lib/common/file-uri.js.map +1 -1
- package/lib/common/fuzzy-search.js +1 -1
- package/lib/common/fuzzy-search.js.map +1 -1
- package/lib/common/glob.d.ts.map +1 -1
- package/lib/common/glob.js +9 -15
- package/lib/common/glob.js.map +1 -1
- package/lib/common/index.js +1 -1
- package/lib/common/index.js.map +1 -1
- package/lib/common/keyboard/keyboard-layout-provider.d.ts +7 -0
- package/lib/common/keyboard/keyboard-layout-provider.d.ts.map +1 -1
- package/lib/common/keyboard/keyboard-layout-provider.js.map +1 -1
- package/lib/common/keys.d.ts +86 -3
- package/lib/common/keys.d.ts.map +1 -1
- package/lib/common/keys.js +263 -24
- package/lib/common/keys.js.map +1 -1
- package/lib/common/message-rpc/channel.spec.js +3 -2
- package/lib/common/message-rpc/channel.spec.js.map +1 -1
- package/lib/common/messaging/proxy-factory.js +2 -2
- package/lib/common/messaging/proxy-factory.js.map +1 -1
- package/lib/common/messaging/proxy-factory.spec.js +2 -1
- package/lib/common/messaging/proxy-factory.spec.js.map +1 -1
- package/lib/common/messaging/web-socket-channel.d.ts +1 -1
- package/lib/common/messaging/web-socket-channel.d.ts.map +1 -1
- package/lib/common/path.spec.js +2 -1
- package/lib/common/path.spec.js.map +1 -1
- package/lib/common/performance/stopwatch.spec.js +2 -1
- package/lib/common/performance/stopwatch.spec.js.map +1 -1
- package/lib/common/preferences/preference-schema-service.d.ts +2 -2
- package/lib/common/preferences/preference-schema-service.d.ts.map +1 -1
- package/lib/common/preferences/preference-service.js +1 -1
- package/lib/common/preferences/preference-service.js.map +1 -1
- package/lib/common/promise-util.d.ts.map +1 -1
- package/lib/common/promise-util.js +5 -2
- package/lib/common/promise-util.js.map +1 -1
- package/lib/common/promise-util.spec.js +17 -1
- package/lib/common/promise-util.spec.js.map +1 -1
- package/lib/common/quick-pick-service.d.ts +5 -0
- package/lib/common/quick-pick-service.d.ts.map +1 -1
- package/lib/common/quick-pick-service.js +2 -1
- package/lib/common/quick-pick-service.js.map +1 -1
- package/lib/common/reference.spec.js +2 -1
- package/lib/common/reference.spec.js.map +1 -1
- package/lib/common/resource.js +1 -1
- package/lib/common/resource.js.map +1 -1
- package/lib/common/selection-service.spec.js +2 -1
- package/lib/common/selection-service.spec.js.map +1 -1
- package/lib/common/selection.js +2 -1
- package/lib/common/selection.js.map +1 -1
- package/lib/common/stream.d.ts.map +1 -1
- package/lib/common/stream.js +2 -1
- package/lib/common/stream.js.map +1 -1
- package/lib/common/strings.d.ts.map +1 -1
- package/lib/common/strings.js +1 -2
- package/lib/common/strings.js.map +1 -1
- package/lib/common/ternary-search-tree.js +2 -2
- package/lib/common/ternary-search-tree.js.map +1 -1
- package/lib/common/ternary-search-tree.spec.js +12 -0
- package/lib/common/ternary-search-tree.spec.js.map +1 -1
- package/lib/common/test/mock-resource-provider.js +1 -1
- package/lib/common/test/mock-resource-provider.js.map +1 -1
- package/lib/common/types.spec.js +2 -1
- package/lib/common/types.spec.js.map +1 -1
- package/lib/common/uri-command-handler.js +4 -3
- package/lib/common/uri-command-handler.js.map +1 -1
- package/lib/common/uri-command-handler.spec.js +3 -2
- package/lib/common/uri-command-handler.spec.js.map +1 -1
- package/lib/common/uri.spec.js +3 -2
- package/lib/common/uri.spec.js.map +1 -1
- package/lib/electron-browser/electron-clipboard-service.d.ts +1 -1
- package/lib/electron-browser/electron-clipboard-service.d.ts.map +1 -1
- package/lib/electron-browser/keyboard/electron-keyboard-module.d.ts +2 -0
- package/lib/electron-browser/keyboard/electron-keyboard-module.d.ts.map +1 -1
- package/lib/electron-browser/keyboard/electron-keyboard-module.js +8 -1
- package/lib/electron-browser/keyboard/electron-keyboard-module.js.map +1 -1
- package/lib/electron-browser/keyboard/electron-keyboard-module.spec.d.ts +2 -0
- package/lib/electron-browser/keyboard/electron-keyboard-module.spec.d.ts.map +1 -0
- package/lib/electron-browser/keyboard/electron-keyboard-module.spec.js +28 -0
- package/lib/electron-browser/keyboard/electron-keyboard-module.spec.js.map +1 -0
- package/lib/electron-browser/menu/electron-main-menu-factory.d.ts.map +1 -1
- package/lib/electron-browser/menu/electron-main-menu-factory.js +3 -2
- package/lib/electron-browser/menu/electron-main-menu-factory.js.map +1 -1
- package/lib/electron-browser/menu/electron-menu-contribution.d.ts.map +1 -1
- package/lib/electron-browser/menu/electron-menu-contribution.js +3 -0
- package/lib/electron-browser/menu/electron-menu-contribution.js.map +1 -1
- package/lib/electron-browser/preload.js +1 -1
- package/lib/electron-browser/preload.js.map +1 -1
- package/lib/electron-browser/window/window-zoom-action-bar.js +2 -1
- package/lib/electron-browser/window/window-zoom-action-bar.js.map +1 -1
- package/lib/electron-common/electron-api.d.ts +6 -1
- package/lib/electron-common/electron-api.d.ts.map +1 -1
- package/lib/electron-common/electron-api.js +21 -0
- package/lib/electron-common/electron-api.js.map +1 -1
- package/lib/electron-common/electron-api.spec.d.ts +2 -0
- package/lib/electron-common/electron-api.spec.d.ts.map +1 -0
- package/lib/electron-common/electron-api.spec.js +40 -0
- package/lib/electron-common/electron-api.spec.js.map +1 -0
- package/lib/electron-main/electron-api-main.d.ts +0 -1
- package/lib/electron-main/electron-api-main.d.ts.map +1 -1
- package/lib/electron-main/electron-api-main.js +8 -18
- package/lib/electron-main/electron-api-main.js.map +1 -1
- package/lib/electron-main/electron-main-application.d.ts.map +1 -1
- package/lib/electron-main/electron-main-application.js +10 -7
- package/lib/electron-main/electron-main-application.js.map +1 -1
- package/lib/electron-node/hosting/electron-backend-hosting-module.spec.js +2 -1
- package/lib/electron-node/hosting/electron-backend-hosting-module.spec.js.map +1 -1
- package/lib/electron-node/keyboard/electron-keyboard-layout-provider.js +1 -1
- package/lib/electron-node/keyboard/electron-keyboard-layout-provider.js.map +1 -1
- package/lib/electron-node/token/electron-token-validator.js +2 -2
- package/lib/electron-node/token/electron-token-validator.js.map +1 -1
- package/lib/node/backend-application.d.ts +11 -5
- package/lib/node/backend-application.d.ts.map +1 -1
- package/lib/node/backend-application.js +34 -12
- package/lib/node/backend-application.js.map +1 -1
- package/lib/node/backend-application.spec.js +52 -3
- package/lib/node/backend-application.spec.js.map +1 -1
- package/lib/node/bundled-resource-provider.js +4 -4
- package/lib/node/bundled-resource-provider.js.map +1 -1
- package/lib/node/bundled-resource-provider.spec.js +5 -4
- package/lib/node/bundled-resource-provider.spec.js.map +1 -1
- package/lib/node/cli.d.ts +1 -1
- package/lib/node/cli.d.ts.map +1 -1
- package/lib/node/cli.js +2 -2
- package/lib/node/cli.js.map +1 -1
- package/lib/node/cli.spec.js +3 -2
- package/lib/node/cli.spec.js.map +1 -1
- package/lib/node/console-logger-server.js +1 -1
- package/lib/node/console-logger-server.js.map +1 -1
- package/lib/node/env-variables/env-variables-server.js +1 -1
- package/lib/node/env-variables/env-variables-server.js.map +1 -1
- package/lib/node/environment-utils.spec.js +2 -1
- package/lib/node/environment-utils.spec.js.map +1 -1
- package/lib/node/file-uri.spec.js +4 -3
- package/lib/node/file-uri.spec.js.map +1 -1
- package/lib/node/filesystem-locking.js +1 -1
- package/lib/node/filesystem-locking.js.map +1 -1
- package/lib/node/hosting/browser-connection-token.js +2 -2
- package/lib/node/hosting/browser-connection-token.js.map +1 -1
- package/lib/node/i18n/localization-contribution.js +1 -1
- package/lib/node/i18n/localization-contribution.js.map +1 -1
- package/lib/node/key-store-server.js +1 -1
- package/lib/node/key-store-server.js.map +1 -1
- package/lib/node/logger-cli-contribution.js +2 -2
- package/lib/node/logger-cli-contribution.js.map +1 -1
- package/lib/node/logger-cli-contribution.spec.js +17 -16
- package/lib/node/logger-cli-contribution.spec.js.map +1 -1
- package/lib/node/messaging/binary-message-pipe.d.ts.map +1 -1
- package/lib/node/messaging/binary-message-pipe.js +5 -3
- package/lib/node/messaging/binary-message-pipe.js.map +1 -1
- package/lib/node/messaging/binary-message-pipe.spec.d.ts +2 -0
- package/lib/node/messaging/binary-message-pipe.spec.d.ts.map +1 -0
- package/lib/node/messaging/binary-message-pipe.spec.js +71 -0
- package/lib/node/messaging/binary-message-pipe.spec.js.map +1 -0
- package/lib/node/messaging/ipc-connection-provider.js +2 -2
- package/lib/node/messaging/ipc-connection-provider.js.map +1 -1
- package/lib/node/process-utils.d.ts +61 -0
- package/lib/node/process-utils.d.ts.map +1 -1
- package/lib/node/process-utils.js +157 -4
- package/lib/node/process-utils.js.map +1 -1
- package/lib/node/process-utils.slow-spec.d.ts +2 -0
- package/lib/node/process-utils.slow-spec.d.ts.map +1 -0
- package/lib/node/process-utils.slow-spec.js +106 -0
- package/lib/node/process-utils.slow-spec.js.map +1 -0
- package/lib/node/process-utils.spec.js +139 -1
- package/lib/node/process-utils.spec.js.map +1 -1
- package/lib/node/request/backend-request-facade.spec.js +2 -1
- package/lib/node/request/backend-request-facade.spec.js.map +1 -1
- package/lib/node/setting-service.spec.js +2 -1
- package/lib/node/setting-service.spec.js.map +1 -1
- package/lib/node/test/exiting-backend.d.ts +18 -0
- package/lib/node/test/exiting-backend.d.ts.map +1 -0
- package/lib/node/test/exiting-backend.js +71 -0
- package/lib/node/test/exiting-backend.js.map +1 -0
- package/package.json +16 -16
- package/src/browser/color-application-contribution.spec.ts +108 -0
- package/src/browser/color-application-contribution.ts +16 -4
- package/src/browser/color-registry.ts +13 -0
- package/src/browser/common-commands.ts +15 -0
- package/src/browser/common-frontend-contribution.ts +46 -2
- package/src/browser/components/card.tsx +1 -1
- package/src/browser/context-key-service.ts +15 -0
- package/src/browser/frontend-application-module.ts +3 -0
- package/src/browser/keybinding.spec.ts +895 -34
- package/src/browser/keybinding.ts +470 -85
- package/src/browser/keyboard/browser-keyboard-frontend-contribution.ts +1 -1
- package/src/browser/keyboard/browser-keyboard-layout-provider.spec.ts +52 -1
- package/src/browser/keyboard/browser-keyboard-layout-provider.ts +5 -5
- package/src/browser/keyboard/keyboard-layout-service.spec.ts +673 -15
- package/src/browser/keyboard/keyboard-layout-service.ts +362 -106
- package/src/browser/keyboard/keys.spec.ts +206 -1
- package/src/browser/label-provider.ts +3 -1
- package/src/browser/markdown-rendering/markdown-renderer.ts +1 -1
- package/src/browser/menu/action-menu-node.spec.ts +60 -0
- package/src/browser/menu/action-menu-node.ts +8 -14
- package/src/browser/menu/browser-menu-plugin.ts +1 -1
- package/src/browser/preferences/preference-validation-service.spec.ts +1 -1
- package/src/browser/quick-input/quick-command-service.spec.ts +159 -0
- package/src/browser/quick-input/quick-command-service.ts +36 -9
- package/src/browser/quick-input/quick-help-service.ts +1 -1
- package/src/browser/shell/index.ts +1 -0
- package/src/browser/shell/shell-layout-restorer.spec.ts +10 -0
- package/src/browser/shell/shell-layout-restorer.ts +5 -0
- package/src/browser/shell/side-panel-handler.spec.ts +94 -0
- package/src/browser/shell/side-panel-handler.ts +75 -1
- package/src/browser/shell/side-panel-item-visibility.spec.ts +91 -0
- package/src/browser/shell/side-panel-item-visibility.ts +115 -0
- package/src/browser/shell/tab-bars.spec.ts +96 -1
- package/src/browser/shell/tab-bars.ts +36 -13
- package/src/browser/style/hover-service.css +0 -2
- package/src/browser/test/jsdom.ts +11 -0
- package/src/browser/tree/tree-compression/compressed-tree-model.spec.ts +57 -0
- package/src/browser/tree/tree-compression/compressed-tree-model.ts +11 -2
- package/src/browser/tree/tree-container.spec.ts +1 -1
- package/src/browser/tree/tree-iterator.ts +1 -1
- package/src/browser/tree/tree-model.ts +2 -2
- package/src/browser/tree/tree-selection-state.ts +40 -1
- package/src/browser/tree/tree-widget.spec.tsx +20 -0
- package/src/browser/tree/tree-widget.tsx +4 -5
- package/src/browser/view-container.ts +2 -1
- package/src/browser/widget-status-bar-service.spec.ts +106 -0
- package/src/browser/widget-status-bar-service.ts +16 -3
- package/src/browser/widgets/select-component.spec.ts +77 -0
- package/src/browser/widgets/select-component.tsx +6 -10
- package/src/common/cancellation.ts +1 -1
- package/src/common/core-preferences.ts +5 -5
- package/src/common/disposable.spec.ts +1 -1
- package/src/common/event.ts +1 -2
- package/src/common/glob.ts +13 -30
- package/src/common/json-schema.ts +1 -1
- package/src/common/keyboard/keyboard-layout-provider.ts +8 -0
- package/src/common/keys.ts +312 -27
- package/src/common/message-rpc/channel.spec.ts +1 -1
- package/src/common/messaging/proxy-factory.ts +2 -2
- package/src/common/promise-util.spec.ts +18 -2
- package/src/common/promise-util.ts +5 -2
- package/src/common/quick-pick-service.ts +5 -0
- package/src/common/stream.ts +4 -3
- package/src/common/strings.ts +2 -5
- package/src/common/ternary-search-tree.spec.ts +14 -0
- package/src/common/ternary-search-tree.ts +3 -3
- package/src/common/uri-command-handler.ts +2 -2
- package/src/electron-browser/electron-clipboard-service.ts +1 -1
- package/src/electron-browser/keyboard/electron-keyboard-module.spec.ts +29 -0
- package/src/electron-browser/keyboard/electron-keyboard-module.ts +9 -2
- package/src/electron-browser/menu/electron-main-menu-factory.ts +3 -3
- package/src/electron-browser/menu/electron-menu-contribution.ts +4 -0
- package/src/electron-browser/preload.ts +2 -2
- package/src/electron-common/electron-api.spec.ts +42 -0
- package/src/electron-common/electron-api.ts +24 -1
- package/src/electron-main/electron-api-main.ts +7 -17
- package/src/electron-main/electron-main-application.ts +8 -5
- package/src/node/backend-application.spec.ts +68 -2
- package/src/node/backend-application.ts +28 -6
- package/src/node/cli.ts +1 -1
- package/src/node/logger-cli-contribution.spec.ts +1 -1
- package/src/node/messaging/binary-message-pipe.spec.ts +81 -0
- package/src/node/messaging/binary-message-pipe.ts +5 -4
- package/src/node/process-utils.slow-spec.ts +122 -0
- package/src/node/process-utils.spec.ts +162 -0
- package/src/node/process-utils.ts +166 -3
- package/src/node/test/exiting-backend.ts +75 -0
|
@@ -51,6 +51,7 @@ describe('ShellLayoutRestorer - Perspective Support', () => {
|
|
|
51
51
|
let mockMigrations: { getContributions: sinon.SinonStub };
|
|
52
52
|
let mockWindowService: { isSafeToShutDown: sinon.SinonStub; reload: sinon.SinonStub };
|
|
53
53
|
let mockThemeService: { reset: sinon.SinonStub };
|
|
54
|
+
let mockSidePanelItemVisibility: { reset: sinon.SinonStub };
|
|
54
55
|
let toTearDown: () => void;
|
|
55
56
|
|
|
56
57
|
beforeEach(() => {
|
|
@@ -108,6 +109,8 @@ describe('ShellLayoutRestorer - Perspective Support', () => {
|
|
|
108
109
|
(restorer as unknown as Record<string, unknown>)['migrations'] = mockMigrations;
|
|
109
110
|
(restorer as unknown as Record<string, unknown>)['windowService'] = mockWindowService;
|
|
110
111
|
(restorer as unknown as Record<string, unknown>)['themeService'] = mockThemeService;
|
|
112
|
+
mockSidePanelItemVisibility = { reset: sinon.stub() };
|
|
113
|
+
(restorer as unknown as Record<string, unknown>)['sidePanelItemVisibility'] = mockSidePanelItemVisibility;
|
|
111
114
|
});
|
|
112
115
|
|
|
113
116
|
afterEach(() => {
|
|
@@ -670,6 +673,13 @@ describe('ShellLayoutRestorer - Perspective Support', () => {
|
|
|
670
673
|
|
|
671
674
|
expect(mockWindowService.reload.calledOnce).to.be.true;
|
|
672
675
|
});
|
|
676
|
+
|
|
677
|
+
it('should reset hidden side panel items', async () => {
|
|
678
|
+
|
|
679
|
+
await (restorer as unknown as Record<string, () => Promise<void>>)['resetLayout']();
|
|
680
|
+
|
|
681
|
+
expect(mockSidePanelItemVisibility.reset.calledOnce).to.be.true;
|
|
682
|
+
});
|
|
673
683
|
});
|
|
674
684
|
|
|
675
685
|
describe('onLayoutRestored callback', () => {
|
|
@@ -19,6 +19,7 @@ import { Widget } from '@lumino/widgets';
|
|
|
19
19
|
import { FrontendApplication } from '../frontend-application';
|
|
20
20
|
import { WidgetManager, WidgetConstructionOptions } from '../widget-manager';
|
|
21
21
|
import { StorageService } from '../storage-service';
|
|
22
|
+
import { SidePanelItemVisibility } from './side-panel-item-visibility';
|
|
22
23
|
import { ILogger } from '../../common/logger';
|
|
23
24
|
import { CommandContribution, CommandRegistry, Command } from '../../common/command';
|
|
24
25
|
import { ThemeService } from '../theming';
|
|
@@ -152,6 +153,9 @@ export class ShellLayoutRestorer implements CommandContribution {
|
|
|
152
153
|
@inject(PerspectiveServiceInternal)
|
|
153
154
|
protected readonly perspectiveService: PerspectiveServiceInternal;
|
|
154
155
|
|
|
156
|
+
@inject(SidePanelItemVisibility)
|
|
157
|
+
protected readonly sidePanelItemVisibility: SidePanelItemVisibility;
|
|
158
|
+
|
|
155
159
|
constructor(
|
|
156
160
|
@inject(WidgetManager) protected widgetManager: WidgetManager,
|
|
157
161
|
@inject(ILogger) @named('core:ShellLayoutRestorer')
|
|
@@ -172,6 +176,7 @@ export class ShellLayoutRestorer implements CommandContribution {
|
|
|
172
176
|
this.perspectiveService.clearSavedLayouts();
|
|
173
177
|
this.storageService.setData(PERSPECTIVE_LAYOUTS_STORAGE_KEY, undefined);
|
|
174
178
|
this.themeService.reset();
|
|
179
|
+
this.sidePanelItemVisibility.reset();
|
|
175
180
|
this.logger.info('<<< The layout has been successfully reset.');
|
|
176
181
|
this.windowService.reload();
|
|
177
182
|
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2026 JuliaHub and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
import { enableJSDOM } from '../test/jsdom';
|
|
18
|
+
let disableJSDOM = enableJSDOM();
|
|
19
|
+
|
|
20
|
+
import { expect } from 'chai';
|
|
21
|
+
import { Title, Widget } from '@lumino/widgets';
|
|
22
|
+
import { SidePanelHandler } from './side-panel-handler';
|
|
23
|
+
import { CommandMenu, CompoundMenuNode } from '../../common/menu';
|
|
24
|
+
import { RenderContextMenuOptions } from '../context-menu-renderer';
|
|
25
|
+
disableJSDOM();
|
|
26
|
+
|
|
27
|
+
describe('SidePanelHandler', () => {
|
|
28
|
+
|
|
29
|
+
beforeEach(() => {
|
|
30
|
+
disableJSDOM = enableJSDOM();
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
afterEach(() => {
|
|
34
|
+
disableJSDOM();
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
function createHandler(ids: string[]): { titles: Title<Widget>[], hidden: Set<string>, openItemsMenu(): CommandMenu[] } {
|
|
38
|
+
const titles = ids.map(id => {
|
|
39
|
+
const widget = new Widget();
|
|
40
|
+
widget.id = id;
|
|
41
|
+
widget.title.label = id;
|
|
42
|
+
return widget.title;
|
|
43
|
+
});
|
|
44
|
+
const hidden = new Set<string>();
|
|
45
|
+
let menu: CompoundMenuNode | undefined;
|
|
46
|
+
const handler = Object.create(SidePanelHandler.prototype) as SidePanelHandler;
|
|
47
|
+
Object.assign(handler, {
|
|
48
|
+
side: 'left',
|
|
49
|
+
tabBar: {
|
|
50
|
+
titles,
|
|
51
|
+
node: document.createElement('div'),
|
|
52
|
+
canHideTitle: (title: Title<Widget>) => !hidden.has(title.owner.id) && titles.some(other => other !== title && !hidden.has(other.owner.id))
|
|
53
|
+
},
|
|
54
|
+
itemVisibility: {
|
|
55
|
+
isHidden: (id: string) => hidden.has(id),
|
|
56
|
+
setHidden: (id: string, value: boolean) => value ? hidden.add(id) : hidden.delete(id)
|
|
57
|
+
},
|
|
58
|
+
contextMenuRenderer: {
|
|
59
|
+
render: (options: RenderContextMenuOptions) => {
|
|
60
|
+
menu = options.menu;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
return {
|
|
65
|
+
titles,
|
|
66
|
+
hidden,
|
|
67
|
+
openItemsMenu: () => {
|
|
68
|
+
handler['showItemsContextMenu'](new MouseEvent('contextmenu'));
|
|
69
|
+
return (menu?.children ?? []).filter(CommandMenu.is);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
it('lists every item as a checked toggle that hides it when run', async () => {
|
|
75
|
+
const { hidden, openItemsMenu } = createHandler(['explorer', 'search']);
|
|
76
|
+
|
|
77
|
+
const [explorer, search] = openItemsMenu();
|
|
78
|
+
expect([explorer.label, search.label]).to.deep.equal(['explorer', 'search']);
|
|
79
|
+
expect(search.isToggled([])).to.be.true;
|
|
80
|
+
|
|
81
|
+
await search.run([]);
|
|
82
|
+
expect(hidden.has('search')).to.be.true;
|
|
83
|
+
expect(search.isToggled([])).to.be.false;
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
it('disables the toggle of the last visible item', () => {
|
|
87
|
+
const { hidden, openItemsMenu } = createHandler(['explorer', 'search']);
|
|
88
|
+
hidden.add('search');
|
|
89
|
+
|
|
90
|
+
const [explorer, search] = openItemsMenu();
|
|
91
|
+
expect(explorer.isEnabled([])).to.be.false;
|
|
92
|
+
expect(search.isEnabled([])).to.be.true;
|
|
93
|
+
});
|
|
94
|
+
});
|
|
@@ -30,11 +30,12 @@ import { SidePanelToolbar } from './side-panel-toolbar';
|
|
|
30
30
|
import { TabBarToolbarRegistry, TabBarToolbarFactory, TabBarToolbar } from './tab-bar-toolbar';
|
|
31
31
|
import { DisposableCollection, Disposable } from '../../common/disposable';
|
|
32
32
|
import { ContextMenuRenderer } from '../context-menu-renderer';
|
|
33
|
-
import { MenuPath } from '../../common/menu';
|
|
33
|
+
import { CommandMenu, GroupImpl, MenuPath } from '../../common/menu';
|
|
34
34
|
import { SidebarBottomMenuWidget } from './sidebar-bottom-menu-widget';
|
|
35
35
|
import { SidebarTopMenuWidget } from './sidebar-top-menu-widget';
|
|
36
36
|
import { PINNED_CLASS } from '../widgets';
|
|
37
37
|
import { AdditionalViewsMenuWidget, AdditionalViewsMenuWidgetFactory } from './additional-views-menu-widget';
|
|
38
|
+
import { SidePanelItemVisibility } from './side-panel-item-visibility';
|
|
38
39
|
|
|
39
40
|
/** The class name added to the left and right area panels. */
|
|
40
41
|
export const LEFT_RIGHT_AREA_CLASS = 'theia-app-sides';
|
|
@@ -132,6 +133,9 @@ export class SidePanelHandler {
|
|
|
132
133
|
@inject(ContextMenuRenderer)
|
|
133
134
|
protected readonly contextMenuRenderer: ContextMenuRenderer;
|
|
134
135
|
|
|
136
|
+
@inject(SidePanelItemVisibility)
|
|
137
|
+
protected readonly itemVisibility: SidePanelItemVisibility;
|
|
138
|
+
|
|
135
139
|
/**
|
|
136
140
|
* Create the side bar and dock panel widgets.
|
|
137
141
|
*/
|
|
@@ -184,6 +188,13 @@ export class SidePanelHandler {
|
|
|
184
188
|
sideBar.currentChanged.connect(this.onCurrentTabChanged, this);
|
|
185
189
|
sideBar.tabDetachRequested.connect(this.onTabDetachRequested, this);
|
|
186
190
|
sideBar.tabsOverflowChanged.connect(this.onTabsOverflowChanged, this);
|
|
191
|
+
sideBar.shouldHideTitle = title => this.itemVisibility.isHidden(title.owner.id);
|
|
192
|
+
sideBar.node.addEventListener('contextmenu', e => this.showItemsContextMenu(e));
|
|
193
|
+
this.itemVisibility.onDidChange(widgetId => this.onItemVisibilityChanged(widgetId));
|
|
194
|
+
// A reset or the stored choices loading only change what renders: the current item stays current
|
|
195
|
+
// even when it turns out hidden, the same as opening a hidden item.
|
|
196
|
+
this.itemVisibility.onDidReset(() => sideBar.update());
|
|
197
|
+
this.itemVisibility.ready.then(() => sideBar.update());
|
|
187
198
|
return sideBar;
|
|
188
199
|
}
|
|
189
200
|
|
|
@@ -245,6 +256,69 @@ export class SidePanelHandler {
|
|
|
245
256
|
});
|
|
246
257
|
}
|
|
247
258
|
|
|
259
|
+
protected onItemVisibilityChanged(widgetId: string): void {
|
|
260
|
+
const current = this.tabBar.currentTitle;
|
|
261
|
+
if (current?.owner.id === widgetId && this.itemVisibility.isHidden(widgetId)) {
|
|
262
|
+
this.moveOffHiddenItem(current);
|
|
263
|
+
}
|
|
264
|
+
this.tabBar.update();
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Makes the next item that is not hidden current, else the previous one, or collapses the panel
|
|
269
|
+
* if there is none.
|
|
270
|
+
*/
|
|
271
|
+
protected moveOffHiddenItem(title: Title<Widget>): void {
|
|
272
|
+
const titles = this.tabBar.titles;
|
|
273
|
+
const index = titles.indexOf(title);
|
|
274
|
+
const isShown = (other: Title<Widget>) => !this.itemVisibility.isHidden(other.owner.id);
|
|
275
|
+
const next = titles.slice(index + 1).find(isShown) ?? titles.slice(0, index).reverse().find(isShown);
|
|
276
|
+
if (next) {
|
|
277
|
+
this.tabBar.currentTitle = next;
|
|
278
|
+
} else {
|
|
279
|
+
this.collapse();
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
protected showItemsContextMenu(e: MouseEvent): void {
|
|
284
|
+
if (this.tabBar.titles.length === 0) {
|
|
285
|
+
return;
|
|
286
|
+
}
|
|
287
|
+
e.stopPropagation();
|
|
288
|
+
e.preventDefault();
|
|
289
|
+
const menu = new GroupImpl('sidePanelItems');
|
|
290
|
+
menu.addNode(...this.tabBar.titles.map((title, index) => this.createItemMenuNode(title, index)));
|
|
291
|
+
this.contextMenuRenderer.render({
|
|
292
|
+
menu,
|
|
293
|
+
menuPath: ['side-panel-items'],
|
|
294
|
+
anchor: e,
|
|
295
|
+
context: this.tabBar.node
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
protected createItemMenuNode(title: Title<Widget>, index: number): CommandMenu {
|
|
300
|
+
const widgetId = title.owner.id;
|
|
301
|
+
return {
|
|
302
|
+
id: widgetId,
|
|
303
|
+
label: title.label || title.caption,
|
|
304
|
+
sortString: index.toString().padStart(4, '0'),
|
|
305
|
+
isVisible: () => true,
|
|
306
|
+
isEnabled: () => this.itemVisibility.isHidden(widgetId) || this.tabBar.canHideTitle(title),
|
|
307
|
+
isToggled: () => !this.itemVisibility.isHidden(widgetId),
|
|
308
|
+
run: async () => this.toggleItem(title)
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
protected toggleItem(title: Title<Widget>): void {
|
|
313
|
+
const id = title.owner.id;
|
|
314
|
+
if (this.itemVisibility.isHidden(id)) {
|
|
315
|
+
this.itemVisibility.setHidden(id, false);
|
|
316
|
+
this.activate(id);
|
|
317
|
+
} else {
|
|
318
|
+
this.itemVisibility.setHidden(id, true);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
248
322
|
protected createContainer(): Panel {
|
|
249
323
|
const contentBox = new BoxLayout({ direction: 'top-to-bottom', spacing: 0 });
|
|
250
324
|
BoxPanel.setStretch(this.toolBar, 0);
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2026 JuliaHub and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
import { expect } from 'chai';
|
|
18
|
+
import { Container, injectable } from 'inversify';
|
|
19
|
+
import { LocalStorageService } from '../storage-service';
|
|
20
|
+
import { MockStorageService } from '../test/mock-storage-service';
|
|
21
|
+
import { SidePanelItemVisibilityImpl } from './side-panel-item-visibility';
|
|
22
|
+
|
|
23
|
+
const STORAGE_KEY = SidePanelItemVisibilityImpl.STORAGE_KEY;
|
|
24
|
+
|
|
25
|
+
@injectable()
|
|
26
|
+
class DebugHiddenByDefault extends SidePanelItemVisibilityImpl {
|
|
27
|
+
protected override isHiddenByDefault(widgetId: string): boolean {
|
|
28
|
+
return widgetId === 'debug';
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
describe('SidePanelItemVisibility', () => {
|
|
33
|
+
|
|
34
|
+
let storage: MockStorageService;
|
|
35
|
+
|
|
36
|
+
async function create(implementation: typeof SidePanelItemVisibilityImpl = SidePanelItemVisibilityImpl): Promise<SidePanelItemVisibilityImpl> {
|
|
37
|
+
const container = new Container();
|
|
38
|
+
container.bind(LocalStorageService).toConstantValue(storage as unknown as LocalStorageService);
|
|
39
|
+
container.bind(implementation).toSelf();
|
|
40
|
+
const visibility = container.get(implementation);
|
|
41
|
+
await visibility.ready;
|
|
42
|
+
return visibility;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
beforeEach(() => {
|
|
46
|
+
storage = new MockStorageService();
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
it('shows items by default', async () => {
|
|
50
|
+
const visibility = await create();
|
|
51
|
+
expect(visibility.isHidden('explorer-view-container')).to.be.false;
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it('persists only explicit choices and restores them', async () => {
|
|
55
|
+
const visibility = await create();
|
|
56
|
+
const changed: string[] = [];
|
|
57
|
+
visibility.onDidChange(id => changed.push(id));
|
|
58
|
+
|
|
59
|
+
visibility.setHidden('explorer-view-container', true);
|
|
60
|
+
visibility.setHidden('explorer-view-container', true);
|
|
61
|
+
|
|
62
|
+
expect(changed).to.deep.equal(['explorer-view-container']);
|
|
63
|
+
expect(storage.data.get(STORAGE_KEY)).to.deep.equal({ 'explorer-view-container': true });
|
|
64
|
+
expect((await create()).isHidden('explorer-view-container')).to.be.true;
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
it('lets an explicit choice override the default', async () => {
|
|
68
|
+
const visibility = await create(DebugHiddenByDefault);
|
|
69
|
+
expect(visibility.isHidden('debug')).to.be.true;
|
|
70
|
+
|
|
71
|
+
visibility.setHidden('debug', false);
|
|
72
|
+
|
|
73
|
+
expect(visibility.isHidden('debug')).to.be.false;
|
|
74
|
+
expect(storage.data.get(STORAGE_KEY)).to.deep.equal({ debug: false });
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it('falls back to the defaults on reset and clears storage', async () => {
|
|
78
|
+
const visibility = await create(DebugHiddenByDefault);
|
|
79
|
+
visibility.setHidden('debug', false);
|
|
80
|
+
visibility.setHidden('scm-view-container', true);
|
|
81
|
+
let resets = 0;
|
|
82
|
+
visibility.onDidReset(() => resets++);
|
|
83
|
+
|
|
84
|
+
visibility.reset();
|
|
85
|
+
|
|
86
|
+
expect(visibility.isHidden('debug')).to.be.true;
|
|
87
|
+
expect(visibility.isHidden('scm-view-container')).to.be.false;
|
|
88
|
+
expect(storage.data.get(STORAGE_KEY)).to.be.undefined;
|
|
89
|
+
expect(resets).to.equal(1);
|
|
90
|
+
});
|
|
91
|
+
});
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
// *****************************************************************************
|
|
2
|
+
// Copyright (C) 2026 JuliaHub and others.
|
|
3
|
+
//
|
|
4
|
+
// This program and the accompanying materials are made available under the
|
|
5
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
//
|
|
8
|
+
// This Source Code may also be made available under the following Secondary
|
|
9
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
10
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
11
|
+
// with the GNU Classpath Exception which is available at
|
|
12
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
13
|
+
//
|
|
14
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
15
|
+
// *****************************************************************************
|
|
16
|
+
|
|
17
|
+
import { inject, injectable, postConstruct } from 'inversify';
|
|
18
|
+
import { Emitter, Event } from '../../common/event';
|
|
19
|
+
import { Deferred } from '../../common/promise-util';
|
|
20
|
+
import { LocalStorageService } from '../storage-service';
|
|
21
|
+
|
|
22
|
+
export const SidePanelItemVisibility = Symbol('SidePanelItemVisibility');
|
|
23
|
+
/**
|
|
24
|
+
* Tracks which side panel items are hidden from the side bar. A hidden item keeps its widget
|
|
25
|
+
* attached: its view still opens through commands and its tab shows while it is the current one.
|
|
26
|
+
* Items are identified by the id of the widget that owns the tab.
|
|
27
|
+
*/
|
|
28
|
+
export interface SidePanelItemVisibility {
|
|
29
|
+
/** Fires with the id of the widget whose hidden state the user changed. */
|
|
30
|
+
readonly onDidChange: Event<string>;
|
|
31
|
+
/** Fires when the user's choices are discarded and every item falls back to its default. */
|
|
32
|
+
readonly onDidReset: Event<void>;
|
|
33
|
+
/** Resolves once the user's stored choices are loaded; until then every item has its default state. */
|
|
34
|
+
readonly ready: Promise<void>;
|
|
35
|
+
isHidden(widgetId: string): boolean;
|
|
36
|
+
setHidden(widgetId: string, hidden: boolean): void;
|
|
37
|
+
/** Discards the user's choices so every item falls back to its default. */
|
|
38
|
+
reset(): void;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* To keep the user's choices somewhere other than local storage, override `load()` and `save()`
|
|
43
|
+
* rather than rebinding `LocalStorageService`, which every other consumer of it shares.
|
|
44
|
+
*/
|
|
45
|
+
@injectable()
|
|
46
|
+
export class SidePanelItemVisibilityImpl implements SidePanelItemVisibility {
|
|
47
|
+
|
|
48
|
+
static readonly STORAGE_KEY = 'sidePanel.hiddenItems';
|
|
49
|
+
|
|
50
|
+
/** Hidden items hold across workspaces, and `@theia/workspace` scopes the bound `StorageService` per workspace. */
|
|
51
|
+
@inject(LocalStorageService)
|
|
52
|
+
protected readonly storageService: LocalStorageService;
|
|
53
|
+
|
|
54
|
+
protected readonly onDidChangeEmitter = new Emitter<string>();
|
|
55
|
+
readonly onDidChange = this.onDidChangeEmitter.event;
|
|
56
|
+
|
|
57
|
+
protected readonly onDidResetEmitter = new Emitter<void>();
|
|
58
|
+
readonly onDidReset = this.onDidResetEmitter.event;
|
|
59
|
+
|
|
60
|
+
protected readonly loaded = new Deferred<void>();
|
|
61
|
+
readonly ready = this.loaded.promise;
|
|
62
|
+
|
|
63
|
+
/** Explicit user choices only, so items the user never touched follow `isHiddenByDefault`. */
|
|
64
|
+
protected overrides: Record<string, boolean> = {};
|
|
65
|
+
|
|
66
|
+
@postConstruct()
|
|
67
|
+
protected init(): void {
|
|
68
|
+
this.load().finally(() => this.loaded.resolve());
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
protected async load(): Promise<void> {
|
|
72
|
+
const stored = await this.storageService.getData<Record<string, boolean>>(SidePanelItemVisibilityImpl.STORAGE_KEY);
|
|
73
|
+
this.overrides = { ...stored, ...this.overrides };
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
isHidden(widgetId: string): boolean {
|
|
77
|
+
return this.overrides[widgetId] ?? this.isHiddenByDefault(widgetId);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
setHidden(widgetId: string, hidden: boolean): void {
|
|
81
|
+
if (this.isHidden(widgetId) === hidden) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
this.overrides[widgetId] = hidden;
|
|
85
|
+
this.save();
|
|
86
|
+
this.onDidChangeEmitter.fire(widgetId);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
reset(): void {
|
|
90
|
+
if (Object.keys(this.overrides).length === 0) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
this.overrides = {};
|
|
94
|
+
this.save();
|
|
95
|
+
this.onDidResetEmitter.fire();
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Whether an item the user has neither hidden nor shown starts hidden. Override this to
|
|
100
|
+
* give an application its own defaults.
|
|
101
|
+
*
|
|
102
|
+
* Defaults are not limited to leaving one item visible per side the way the user's choices are,
|
|
103
|
+
* so an application can start every item on a side hidden. Expanding a side panel without naming
|
|
104
|
+
* a view can still open a hidden item, through the last active index or the first tab, and its
|
|
105
|
+
* tab then shows while it is current, the same as opening it by command.
|
|
106
|
+
*/
|
|
107
|
+
protected isHiddenByDefault(widgetId: string): boolean {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
protected save(): void {
|
|
112
|
+
const data = Object.keys(this.overrides).length > 0 ? this.overrides : undefined;
|
|
113
|
+
this.storageService.setData(SidePanelItemVisibilityImpl.STORAGE_KEY, data);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
@@ -19,7 +19,7 @@ let disableJSDOM = enableJSDOM();
|
|
|
19
19
|
import { expect } from 'chai';
|
|
20
20
|
|
|
21
21
|
import { Title, Widget } from '@lumino/widgets';
|
|
22
|
-
import { TabBarRenderer } from './tab-bars';
|
|
22
|
+
import { SideTabBar, TabBarRenderer } from './tab-bars';
|
|
23
23
|
|
|
24
24
|
disableJSDOM();
|
|
25
25
|
|
|
@@ -60,4 +60,99 @@ describe('tab bar', () => {
|
|
|
60
60
|
expect(pathMap.get(tabPaths[5])).to.be.equal('.../ccc');
|
|
61
61
|
expect(pathMap.get(tabPaths[6])).to.be.equal(undefined);
|
|
62
62
|
});
|
|
63
|
+
|
|
64
|
+
describe('side tab bar', () => {
|
|
65
|
+
|
|
66
|
+
class TestSideTabBar extends SideTabBar {
|
|
67
|
+
render(): void {
|
|
68
|
+
this.renderTabs(this.contentNode);
|
|
69
|
+
}
|
|
70
|
+
renderedClasses(): string[] {
|
|
71
|
+
return Array.from(this.contentNode.children, tab => tab.className);
|
|
72
|
+
}
|
|
73
|
+
overflowFrom(startIndex: number): void {
|
|
74
|
+
this.hideOverflowingTabs = () => startIndex;
|
|
75
|
+
this.computeOverflowingTabsData();
|
|
76
|
+
}
|
|
77
|
+
firstOverflowingIndex(): number {
|
|
78
|
+
return this.hideOverflowingTabs();
|
|
79
|
+
}
|
|
80
|
+
setOverflowData(): void {
|
|
81
|
+
this.tabsOverflowData = { titles: [], startIndex: 0 };
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function createSideTabBar(hiddenIds: string[]): { bar: TestSideTabBar, titles: Title<Widget>[] } {
|
|
86
|
+
const renderer = new TabBarRenderer();
|
|
87
|
+
const bar = new TestSideTabBar({ orientation: 'vertical', renderer });
|
|
88
|
+
const titles = ['explorer', 'debug', 'search'].map(id => {
|
|
89
|
+
const owner = new Widget();
|
|
90
|
+
owner.id = id;
|
|
91
|
+
owner.title.label = id;
|
|
92
|
+
return bar.addTab(owner.title);
|
|
93
|
+
});
|
|
94
|
+
bar.shouldHideTitle = title => hiddenIds.includes(title.owner.id);
|
|
95
|
+
return { bar, titles };
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
it('keeps a hidden tab in the DOM at its title index, hidden unless it is current', () => {
|
|
99
|
+
const { bar, titles } = createSideTabBar(['debug']);
|
|
100
|
+
|
|
101
|
+
bar.currentTitle = titles[0];
|
|
102
|
+
bar.render();
|
|
103
|
+
expect(bar.renderedClasses().map(c => c.includes('lm-mod-hidden'))).to.deep.equal([false, true, false]);
|
|
104
|
+
|
|
105
|
+
bar.currentTitle = titles[1];
|
|
106
|
+
bar.render();
|
|
107
|
+
expect(bar.renderedClasses().map(c => c.includes('lm-mod-hidden'))).to.deep.equal([false, false, false]);
|
|
108
|
+
expect(bar.isHiddenTab(titles[1])).to.be.false;
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
it('refuses to hide the last title that is not hidden', () => {
|
|
112
|
+
const { bar, titles } = createSideTabBar(['debug', 'search']);
|
|
113
|
+
expect(bar.canHideTitle(titles[0])).to.be.false;
|
|
114
|
+
expect(bar.canHideTitle(titles[1])).to.be.false;
|
|
115
|
+
bar.shouldHideTitle = title => title.owner.id === 'debug';
|
|
116
|
+
expect(bar.canHideTitle(titles[0])).to.be.true;
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
it('leaves hidden tabs out of the overflow menu', () => {
|
|
120
|
+
const { bar, titles } = createSideTabBar(['debug']);
|
|
121
|
+
bar.currentTitle = titles[0];
|
|
122
|
+
const overflowing: string[][] = [];
|
|
123
|
+
bar.tabsOverflowChanged.connect((_, { titles: overflow }) => overflowing.push(overflow.map(title => title.owner.id)));
|
|
124
|
+
const requestAnimationFrame = window.requestAnimationFrame;
|
|
125
|
+
window.requestAnimationFrame = callback => {
|
|
126
|
+
callback(0);
|
|
127
|
+
return 0;
|
|
128
|
+
};
|
|
129
|
+
try {
|
|
130
|
+
bar.overflowFrom(1);
|
|
131
|
+
} finally {
|
|
132
|
+
window.requestAnimationFrame = requestAnimationFrame;
|
|
133
|
+
}
|
|
134
|
+
expect(overflowing).to.deep.equal([['search']]);
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
it('keeps the last shown tab when it fits beside the overflow menu, even with hidden tabs after it', () => {
|
|
138
|
+
const { bar, titles } = createSideTabBar(['search']);
|
|
139
|
+
bar.currentTitle = titles[0];
|
|
140
|
+
bar.render();
|
|
141
|
+
const parent = document.createElement('div');
|
|
142
|
+
const overflowMenu = document.createElement('div');
|
|
143
|
+
overflowMenu.className = 'theia-additional-views-menu';
|
|
144
|
+
Object.defineProperty(overflowMenu, 'offsetHeight', { value: 20 });
|
|
145
|
+
parent.append(bar.node, overflowMenu);
|
|
146
|
+
Object.defineProperty(bar.node, 'clientHeight', { value: 70 });
|
|
147
|
+
// explorer and debug stack 40px each; search is hidden, so it measures 0 like a `display: none` tab.
|
|
148
|
+
const tabs = Array.from(bar.contentNode.children);
|
|
149
|
+
[[0, 40], [40, 40], [0, 0]].forEach(([offsetTop, offsetHeight], i) => {
|
|
150
|
+
Object.defineProperty(tabs[i], 'offsetTop', { value: offsetTop });
|
|
151
|
+
Object.defineProperty(tabs[i], 'offsetHeight', { value: offsetHeight });
|
|
152
|
+
});
|
|
153
|
+
bar.setOverflowData();
|
|
154
|
+
|
|
155
|
+
expect(bar.firstOverflowingIndex()).to.equal(-1);
|
|
156
|
+
});
|
|
157
|
+
});
|
|
63
158
|
});
|