Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate from PhosphorJS to Lumino #14320

Draft
wants to merge 23 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
8a72f37
[lumino] consume lumino packages
sdirix Oct 15, 2024
765afa3
[lumino] migrate to lumino styles
sdirix Oct 15, 2024
d8b6b24
[lumino] code changes
sdirix Oct 15, 2024
c4fbdd9
[lumino] lumino patch
sdirix Oct 15, 2024
b3dddca
[lumino] remove no longer needed underline adjustment
sdirix Oct 15, 2024
986a738
Merge branch 'upstream/master' into lumino-migration
sdirix Nov 28, 2024
2e8a052
chore: replace mentions of Phosphor with Lumino
sdirix Nov 28, 2024
b074e61
[lumino] mock DragEvent in test setup
sdirix Nov 29, 2024
8844c4f
[lumino] further DragEvent adaptations
sdirix Nov 29, 2024
891f912
[lumino] adjust search-in-workspace-widget
sdirix Nov 29, 2024
5230998
[lumino] remove check in 'MenuBar' subclass
sdirix Nov 29, 2024
d39fbbc
Use widget document as context menu host.
tsmaeder Dec 2, 2024
45a3fb4
Fix scroll bar behavior on editor tab bar
tsmaeder Dec 6, 2024
9092eb3
Fix sidebar ellipsis behavior
tsmaeder Dec 20, 2024
f4dc983
Merge remote-tracking branch 'origin/master' into lumino-migration
tsmaeder Dec 20, 2024
e5629f3
Fix compile error
tsmaeder Dec 20, 2024
09a94d4
Add "overflow: hidden" to preferences editor widget
tsmaeder Dec 20, 2024
cba31c9
[lumino] never return empty menus
sdirix Dec 23, 2024
168b3cd
[lumino] wip - adapt menu focus behavior
sdirix Dec 23, 2024
d9d3f91
[lumino] fix terminal id
sdirix Dec 23, 2024
ba01608
[lumino] update lumino patch
sdirix Dec 23, 2024
cbc68a9
[lumino] streamline menu focus
sdirix Dec 23, 2024
e588806
Merge remote-tracking branch 'upstream/master' into lumino-migration
sdirix Jan 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions configs/mocharc.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require:
- 'ignore-styles'
- 'reflect-metadata/Reflect'
- '@theia/test-setup'
reporter: 'spec'
watch-files:
- '**/*.js'
Expand Down
449 changes: 449 additions & 0 deletions dev-packages/cli/patches/@lumino+widgets+2.5.0.patch

Large diffs are not rendered by default.

157 changes: 0 additions & 157 deletions dev-packages/cli/patches/@phosphor+widgets+1.9.3.patch

This file was deleted.

2 changes: 1 addition & 1 deletion dev-packages/cli/src/run-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default async function runTest(options: TestOptions): Promise<void> {
// When launching in non-headless mode (with a UI and dev-tools open), make sure
// the app has focus, to avoid failures of tests that query the UI's state.
if (launch && launch.devtools) {
promises.push(testPage.waitForSelector('#theia-app-shell.p-Widget.theia-ApplicationShell')
promises.push(testPage.waitForSelector('#theia-app-shell.lm-Widget.theia-ApplicationShell')
.then(e => {
// eslint-disable-next-line no-null/no-null
if (e !== null) {
Expand Down
32 changes: 32 additions & 0 deletions dev-packages/private-test-setup/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<div align='center'>

<br />

<img src='https://raw.githubusercontent.com/eclipse-theia/theia/master/logo/theia.svg?sanitize=true' alt='theia-ext-logo' width='100px' />

<h2>ECLIPSE THEIA - TEST SETUP</h2>

<hr />

</div>

## Description

The `@theia/test-setup` contributes a setup script for mocha executed tests in Theia.
This setup script is executed before any test file is loaded or compiled.
This is for example useful for globals which must exist before dependencies are loaded.

## Additional Information

- [Theia - GitHub](https://github.com/eclipse-theia/theia)
- [Theia - Website](https://theia-ide.org/)

## License

- [Eclipse Public License 2.0](http://www.eclipse.org/legal/epl-2.0/)
- [一 (Secondary) GNU General Public License, version 2 with the GNU Classpath Exception](https://projects.eclipse.org/license/secondary-gpl-2.0-cp)

## Trademark

"Theia" is a trademark of the Eclipse Foundation
https://www.eclipse.org/theia
7 changes: 7 additions & 0 deletions dev-packages/private-test-setup/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"private": true,
"name": "@theia/test-setup",
"version": "1.56.0",
"description": "Custom setup for mocha tests",
"main": "test-setup.js"
}
18 changes: 18 additions & 0 deletions dev-packages/private-test-setup/test-setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// *****************************************************************************
// Copyright (C) 2024 STMicroelectronics and others.
//
// This program and the accompanying materials are made available under the
// terms of the Eclipse Public License v. 2.0 which is available at
// http://www.eclipse.org/legal/epl-2.0.
//
// This Source Code may also be made available under the following Secondary
// Licenses when the conditions for such availability set forth in the Eclipse
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
// with the GNU Classpath Exception which is available at
// https://www.gnu.org/software/classpath/license.html.
//
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
// *****************************************************************************

// Mock DragEvent as '@lumino/dragdrop' already requires it at require time
global.DragEvent = class DragEvent { };
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// *****************************************************************************

import { injectable, ContainerModule } from '@theia/core/shared/inversify';
import { Menu as MenuWidget } from '@theia/core/shared/@phosphor/widgets';
import { Menu as MenuWidget } from '@theia/core/shared/@lumino/widgets';
import { Disposable } from '@theia/core/lib/common/disposable';
import { MenuNode, CompoundMenuNode, MenuPath } from '@theia/core/lib/common/menu';
import { BrowserMainMenuFactory, MenuCommandRegistry, DynamicMenuWidget, BrowserMenuOptions } from '@theia/core/lib/browser/menu/browser-menu-plugin';
Expand Down Expand Up @@ -74,7 +74,7 @@ class SampleMenuCommandRegistry extends MenuCommandRegistry {
return this.addCommand(id, {
execute: () => { /* NOOP */ },
label: menu.label,
icon: menu.icon,
iconClass: menu.icon,
isEnabled: () => false,
isVisible: () => true
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { inject, injectable, interfaces } from '@theia/core/shared/inversify';
import { FileService } from '@theia/filesystem/lib/browser/file-service';
import { WorkspaceService } from '@theia/workspace/lib/browser';
import { PreferenceItem, PreferenceValidationService } from '@theia/core/lib/browser';
import { JSONValue } from '@theia/core/shared/@phosphor/coreutils';
import { JSONValue } from '@theia/core/shared/@lumino/coreutils';
import { JsonType } from '@theia/core/lib/common/json-schema';
import { editorOptionsRegistry } from '@theia/monaco-editor-core/esm/vs/editor/common/config/editorOptions';
import { MonacoEditorProvider } from '@theia/monaco/lib/browser/monaco-editor-provider';
Expand Down
2 changes: 1 addition & 1 deletion examples/playwright/src/theia-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export class TheiaApp {
}

protected async visibleTabIds(): Promise<string[]> {
const tabs = await this.page.$$('.p-TabBar-tab');
const tabs = await this.page.$$('.lm-TabBar-tab');
const tabIds = (await Promise.all(tabs.map(tab => tab.getAttribute('id')))).filter(id => !!id);
return tabIds as string[];
}
Expand Down
4 changes: 2 additions & 2 deletions examples/playwright/src/theia-main-menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { TheiaPageObject } from './theia-page-object';
import { normalizeId, toTextContentArray } from './util';

export class TheiaMainMenu extends TheiaMenu {
override selector = '.p-Menu.p-MenuBar-menu';
override selector = '.lm-Menu.lm-MenuBar-menu';
}

export class TheiaMenuBar extends TheiaPageObject {
Expand All @@ -48,7 +48,7 @@ export class TheiaMenuBar extends TheiaPageObject {
}

protected menuBarItemSelector(label = ''): string {
return `${normalizeId('#theia:menubar')} .p-MenuBar-itemLabel >> text=${label}`;
return `${normalizeId('#theia:menubar')} .lm-MenuBar-itemLabel >> text=${label}`;
}

}
10 changes: 5 additions & 5 deletions examples/playwright/src/theia-menu-item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ export class TheiaMenuItem {
constructor(protected element: ElementHandle<SVGElement | HTMLElement>) { }

protected labelElementHandle(): Promise<ElementHandle<SVGElement | HTMLElement>> {
return this.element.waitForSelector('.p-Menu-itemLabel');
return this.element.waitForSelector('.lm-Menu-itemLabel');
}

protected shortCutElementHandle(): Promise<ElementHandle<SVGElement | HTMLElement>> {
return this.element.waitForSelector('.p-Menu-itemShortcut');
return this.element.waitForSelector('.lm-Menu-itemShortcut');
}

protected isHidden(): Promise<boolean> {
return elementContainsClass(this.element, 'p-mod-collapsed');
return elementContainsClass(this.element, 'lm-mod-collapsed');
}

async label(): Promise<string | undefined> {
Expand Down Expand Up @@ -60,11 +60,11 @@ export class TheiaMenuItem {
if (classAttribute === undefined || classAttribute === null) {
return false;
}
return !classAttribute.includes('p-mod-disabled') && !classAttribute.includes('p-mod-collapsed');
return !classAttribute.includes('lm-mod-disabled') && !classAttribute.includes('lm-mod-collapsed');
}

async click(): Promise<void> {
return this.element.waitForSelector('.p-Menu-itemLabel')
return this.element.waitForSelector('.lm-Menu-itemLabel')
.then(labelElement => labelElement.click({ position: { x: 10, y: 10 } }));
}

Expand Down
6 changes: 3 additions & 3 deletions examples/playwright/src/theia-menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { isDefined } from './util';

export class TheiaMenu extends TheiaPageObject {

selector = '.p-Menu';
selector = '.lm-Menu';

protected async menuElementHandle(): Promise<ElementHandle<SVGElement | HTMLElement> | null> {
return this.page.$(this.selector);
Expand Down Expand Up @@ -50,7 +50,7 @@ export class TheiaMenu extends TheiaPageObject {
if (!menuHandle) {
return [];
}
const items = await menuHandle.$$('.p-Menu-content .p-Menu-item');
const items = await menuHandle.$$('.lm-Menu-content .lm-Menu-item');
return items.map(element => new TheiaMenuItem(element));
}

Expand Down Expand Up @@ -84,7 +84,7 @@ export class TheiaMenu extends TheiaPageObject {
}

protected menuItemSelector(label = ''): string {
return `.p-Menu-content .p-Menu-itemLabel >> text=${label}`;
return `.lm-Menu-content .lm-Menu-itemLabel >> text=${label}`;
}

async visibleMenuItems(): Promise<string[]> {
Expand Down
2 changes: 1 addition & 1 deletion examples/playwright/src/theia-output-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export class TheiaOutputView extends TheiaView {
await this.activate();
const channel = new TheiaOutputViewChannel(
{
viewSelector: 'div.p-Widget.theia-editor.p-DockPanel-widget > div.monaco-editor',
viewSelector: 'div.lm-Widget.theia-editor.lm-DockPanel-widget > div.monaco-editor',
dataUri: normalizeId(`output:/${encodeURIComponent(outputChannelName)}`),
channelName: outputChannelName
},
Expand Down
2 changes: 1 addition & 1 deletion examples/playwright/src/theia-preference-view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export class TheiaPreferenceView extends TheiaView {
}

protected getScopeSelector(scope: TheiaPreferenceScope): string {
return `li.preferences-scope-tab div.p-TabBar-tabLabel:has-text("${scope}")`;
return `li.preferences-scope-tab div.lm-TabBar-tabLabel:has-text("${scope}")`;
}

async openPreferenceScope(scope: TheiaPreferenceScope): Promise<void> {
Expand Down
2 changes: 1 addition & 1 deletion examples/playwright/src/theia-toolbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { TheiaPageObject } from './theia-page-object';
import { TheiaToolbarItem } from './theia-toolbar-item';

export class TheiaToolbar extends TheiaPageObject {
selector = 'div#main-toolbar.p-TabBar-toolbar';
selector = 'div#main-toolbar.lm-TabBar-toolbar';

protected async toolbarElementHandle(): Promise<ElementHandle<SVGElement | HTMLElement> | null> {
return this.page.$(this.selector);
Expand Down
Loading
Loading