From db14c4898e7c760a438e52ae1af02fc59f632f2e Mon Sep 17 00:00:00 2001 From: Ishan Taldekar Date: Tue, 25 Feb 2025 12:30:34 -0500 Subject: [PATCH] Merge main into feature/viewRefactor --- plugin/plugin.xml | 3 - .../assets/ChatWebViewAssetProvider.java | 59 ------------------- .../browser/AmazonQBrowserProvider.java | 4 -- .../amazonq/views/AmazonQViewContainer.java | 27 --------- .../amazonq/views/router/ViewRouter.java | 2 +- 5 files changed, 1 insertion(+), 94 deletions(-) diff --git a/plugin/plugin.xml b/plugin/plugin.xml index 376056c0..78478f73 100644 --- a/plugin/plugin.xml +++ b/plugin/plugin.xml @@ -72,7 +72,6 @@ relationship="right" visible="false"> -<<<<<<< HEAD -======= ->>>>>>> 4c33324 (Integrate browser based views in ViewContainer (#359)) - body, - html { - background-color: var(--mynah-color-bg); - color: var(--mynah-color-text-default); - height: 100vh; - width: 100%%; - overflow: hidden; - margin: 0; - padding: 0; - } - .mynah-ui-icon-plus, - .mynah-ui-icon-cancel { - -webkit-mask-size: 155% !important; - mask-size: 155% !important; - mask-position: center; - scale: 60%; - } - .mynah-ui-icon-tabs { - -webkit-mask-size: 102% !important; - mask-size: 102% !important; - mask-position: center; - } - textarea:placeholder-shown { - line-height: 1.5rem; - } - - """; - } - - private String generateJS(final String jsEntrypoint) { - var chatQuickActionConfig = generateQuickActionConfig(); - var disclaimerAcknowledged = Activator.getPluginStore().get(PluginStoreKeys.CHAT_DISCLAIMER_ACKNOWLEDGED); - return String.format(""" - - - """, jsEntrypoint, getWaitFunction(), chatQuickActionConfig, "true".equals(disclaimerAcknowledged)); - } - /* * Generates javascript for chat options to be supplied to Chat UI defined here * https://github.com/aws/language-servers/blob/ diff --git a/plugin/src/software/aws/toolkits/eclipse/amazonq/providers/browser/AmazonQBrowserProvider.java b/plugin/src/software/aws/toolkits/eclipse/amazonq/providers/browser/AmazonQBrowserProvider.java index 2d27388a..ad11d179 100644 --- a/plugin/src/software/aws/toolkits/eclipse/amazonq/providers/browser/AmazonQBrowserProvider.java +++ b/plugin/src/software/aws/toolkits/eclipse/amazonq/providers/browser/AmazonQBrowserProvider.java @@ -25,10 +25,6 @@ public AmazonQBrowserProvider() { // Test constructor that accepts a platform public AmazonQBrowserProvider(final PluginPlatform platform) { this.pluginPlatform = platform; -<<<<<<< HEAD -======= - Display.getDefault().asyncExec(this::publishBrowserCompatibilityState); ->>>>>>> 4c33324 (Integrate browser based views in ViewContainer (#359)) } /* diff --git a/plugin/src/software/aws/toolkits/eclipse/amazonq/views/AmazonQViewContainer.java b/plugin/src/software/aws/toolkits/eclipse/amazonq/views/AmazonQViewContainer.java index 4a825e7f..b6073554 100644 --- a/plugin/src/software/aws/toolkits/eclipse/amazonq/views/AmazonQViewContainer.java +++ b/plugin/src/software/aws/toolkits/eclipse/amazonq/views/AmazonQViewContainer.java @@ -15,7 +15,6 @@ import org.eclipse.swt.widgets.Display; import org.eclipse.ui.part.ViewPart; -import io.reactivex.rxjava3.disposables.Disposable; import software.aws.toolkits.eclipse.amazonq.broker.api.EventObserver; import software.aws.toolkits.eclipse.amazonq.plugin.Activator; import software.aws.toolkits.eclipse.amazonq.views.router.AmazonQViewType; @@ -27,14 +26,8 @@ public final class AmazonQViewContainer extends ViewPart implements EventObserve private Composite parentComposite; private volatile StackLayout layout; private Map views; -<<<<<<< HEAD private volatile AmazonQViewType activeViewType; private volatile BaseAmazonQView currentView; -======= - private AmazonQViewType activeViewType; - private BaseAmazonQView currentView; - private Disposable activeViewTypeSubscription; ->>>>>>> 4c33324 (Integrate browser based views in ViewContainer (#359)) private final ReentrantLock containerLock; public AmazonQViewContainer() { @@ -64,20 +57,10 @@ public void createPartControl(final Composite parent) { parent.setLayout(gridLayout); parentComposite = parent; -<<<<<<< HEAD - updateChildView(); -======= - - setupStaticMenuActions(); updateChildView(); } - private void setupStaticMenuActions() { - new AmazonQStaticActions(getViewSite()); ->>>>>>> 4c33324 (Integrate browser based views in ViewContainer (#359)) - } - private void updateChildView() { Display.getDefault().asyncExec(() -> { try { @@ -85,12 +68,9 @@ private void updateChildView() { BaseAmazonQView newView = views.get(activeViewType); if (currentView != null) { -<<<<<<< HEAD if (currentView instanceof AmazonQChatWebview) { ((AmazonQChatWebview) currentView).disposeBrowserState(); } -======= ->>>>>>> 4c33324 (Integrate browser based views in ViewContainer (#359)) Control[] children = parentComposite.getChildren(); for (Control child : children) { if (child != null && !child.isDisposed()) { @@ -101,14 +81,7 @@ private void updateChildView() { currentView.dispose(); } -<<<<<<< HEAD newView.setViewSite(getViewSite()); -======= - if (activeViewType == AmazonQViewType.CHAT_VIEW - || activeViewType == AmazonQViewType.TOOLKIT_LOGIN_VIEW) { - ((AmazonQView) newView).setViewSite(getViewSite()); - } ->>>>>>> 4c33324 (Integrate browser based views in ViewContainer (#359)) Composite newViewComposite = newView.setupView(parentComposite); GridData gridData = new GridData(SWT.CENTER, SWT.CENTER, true, true); diff --git a/plugin/src/software/aws/toolkits/eclipse/amazonq/views/router/ViewRouter.java b/plugin/src/software/aws/toolkits/eclipse/amazonq/views/router/ViewRouter.java index bbe319af..add317e3 100644 --- a/plugin/src/software/aws/toolkits/eclipse/amazonq/views/router/ViewRouter.java +++ b/plugin/src/software/aws/toolkits/eclipse/amazonq/views/router/ViewRouter.java @@ -103,7 +103,7 @@ private void refreshActiveView(final PluginState pluginState) { if (pluginState.browserCompatibilityState() == BrowserCompatibilityState.DEPENDENCY_MISSING) { newActiveView = AmazonQViewType.DEPENDENCY_MISSING_VIEW; - } else if (pluginState.lspState().hasFailed()) { + } else if (pluginState.lspState() == LspState.FAILED) { newActiveView = AmazonQViewType.LSP_STARTUP_FAILED_VIEW; } else if (pluginState.chatWebViewAssetState() == ChatWebViewAssetState.DEPENDENCY_MISSING || pluginState.toolkitLoginWebViewAssetState() == ToolkitLoginWebViewAssetState.DEPENDENCY_MISSING) {