Skip to content

Commit

Permalink
Fix code block cancel button (#373)
Browse files Browse the repository at this point in the history
* Disable arrow keys if text area is empty

* Fix unrelated changes introduced by stash apply

* Support select all and copy shortcuts in chat (#353)

* Support select all and copy keyboard shortcuts in chat

* Fix submitted code block cancel button (#354)

* Fix submitted code block cancel button

* Fix empty overflow bubble (#356)

* Fix empty pop-up when no overflow in follow up question text

* Fix accidentally removed copy event listener

* Fix checkstyle issues

* Fix Mynah UI checkstyle issues

* Fix Mynah UI checkstyle issues (#369)

* Fix code block cancel button in mynah

* Fix mynah UI progress indicator (#374)

* Fix progress indicator not disappearing after complete result has streamed

* Fix Amazon Q progress spinner bug (#376)

* Fix mynah show more icon (#377)

* Fix progress indicator not disappearing after complete result has streamed

* Fix Amazon Q progress spinner bug

* Fix show more icon in MynahUI
  • Loading branch information
taldekar authored Feb 20, 2025
1 parent 6f760f1 commit ecb105d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 8 deletions.
2 changes: 1 addition & 1 deletion plugin/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="3.31.0",
org.apache.commons.logging;bundle-version="1.2.0",
slf4j.api;bundle-version="2.0.13",
org.apache.commons.lang3;bundle-version="3.14.0"
Bundle-Classpath: target/classes/,
Bundle-Classpath: .,
target/dependency/annotations-2.28.26.jar,
target/dependency/apache-client-2.28.26.jar,
target/dependency/auth-2.28.26.jar,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,10 @@ private String generateCss() {
mask-position: center;
scale: 60%;
}
.mynah-button.mynah-button-secondary.fill-state-always.code-snippet-close-button
.mynah-ui-clickable-item
.mynah-ui-icon-cancel {
-webkit-mask-size: 187.5% !important;
mask-size: 187.5% !important;
.code-snippet-close-button i.mynah-ui-icon-cancel,
.mynah-chat-item-card-related-content-show-more i.mynah-ui-icon-down-open {
-webkit-mask-size: 195.5% !important;
mask-size: 195.5% !important;
mask-position: center;
aspect-ratio: 1/1;
width: 15px;
Expand All @@ -252,6 +251,9 @@ private String generateCss() {
textarea:placeholder-shown {
line-height: 1.5rem;
}
.mynah-ui-spinner-container > span.mynah-ui-spinner-logo-part > .mynah-ui-spinner-logo-mask.text {
opacity: 1 !important;
}
</style>
""";
}
Expand All @@ -270,7 +272,8 @@ private String generateJS(final String jsEntrypoint) {
postMessage: (message) => {
ideCommand(JSON.stringify(message));
}
}, {
},
{
quickActionCommands: %s,
disclaimerAcknowledged: %b
});
Expand All @@ -286,10 +289,12 @@ private String generateJS(final String jsEntrypoint) {
%s
%s
</script>
""", jsEntrypoint, getWaitFunction(), chatQuickActionConfig,
"true".equals(disclaimerAcknowledged), getArrowKeyBlockingFunction(),
getSelectAllAndCopySupportFunctions(), getPreventEmptyPopupFunction());
getSelectAllAndCopySupportFunctions(), getPreventEmptyPopupFunction(), getFocusOnChatPromptFunction());
}

/*
Expand Down Expand Up @@ -425,6 +430,21 @@ function attachEventListeners(element) {
""".formatted(selector);
}

private String getFocusOnChatPromptFunction() {
return """
window.addEventListener('load', () => {
const chatContainer = document.querySelector('.mynah-chat-prompt');
if (chatContainer) {
chatContainer.addEventListener('click', (event) => {
if (!event.target.closest('.mynah-chat-prompt-input')) {
keepFocusOnPrompt();
}
});
}
});
""";
}

@Override
public final void onSendToChatUi(final String message) {
String script = "window.postMessage(" + message + ");";
Expand Down

0 comments on commit ecb105d

Please sign in to comment.