From 91ab35533a7a227f58a249fce2f486ea6ac375ed Mon Sep 17 00:00:00 2001 From: chungjac Date: Thu, 2 Oct 2025 14:47:54 -0700 Subject: [PATCH 1/5] feat: add tooltip to select dropdown (#438) --- example/src/config.ts | 10 ++++-- .../chat-item/chat-item-form-items.ts | 1 + src/components/form-items/select.ts | 31 ++++++++++++++----- src/static.ts | 1 + 4 files changed, 33 insertions(+), 10 deletions(-) diff --git a/example/src/config.ts b/example/src/config.ts index f0053c539..efba9d3f0 100644 --- a/example/src/config.ts +++ b/example/src/config.ts @@ -309,18 +309,22 @@ export const mynahUIDefaults: Partial = { id: 'model-select', mandatory: true, hideMandatoryIcon: true, + showDescriptionAsTooltip: true, options: [ { label: 'Fast', - value: 'fast' + value: 'fast', + description: 'Quick responses with good accuracy' }, { label: 'Fast 2.0 (Exp.)', - value: 'fast-2-experimental' + value: 'fast-2-experimental', + description: 'Experimental faster model with enhanced capabilities' }, { label: 'Decisive', - value: 'decisive' + value: 'decisive', + description: 'More thorough analysis with detailed responses' }, ] } diff --git a/src/components/chat-item/chat-item-form-items.ts b/src/components/chat-item/chat-item-form-items.ts index d691c14c2..3fe19682b 100644 --- a/src/components/chat-item/chat-item-form-items.ts +++ b/src/components/chat-item/chat-item-form-items.ts @@ -117,6 +117,7 @@ export class ChatItemFormItemsWrapper { optional: chatItemOption.mandatory !== true, placeholder: chatItemOption.placeholder ?? Config.getInstance().config.texts.pleaseSelect, tooltip: chatItemOption.selectTooltip ?? '', + showDescriptionAsTooltip: chatItemOption.showDescriptionAsTooltip, ...(this.getHandlers(chatItemOption)) }); if (chatItemOption.disabled === true) { diff --git a/src/components/form-items/select.ts b/src/components/form-items/select.ts index 8263f1382..eba07a036 100644 --- a/src/components/form-items/select.ts +++ b/src/components/form-items/select.ts @@ -36,6 +36,7 @@ export interface SelectProps { wrapperTestId?: string; optionTestId?: string; tooltip?: string; + showDescriptionAsTooltip?: boolean; } export abstract class SelectAbstract { @@ -97,8 +98,8 @@ export class SelectInternal { ] }; - // Add disabled description option if description exists - if (option.description != null && option.description.trim() !== '') { + // Add disabled description option if description exists and not using tooltip + if (props.showDescriptionAsTooltip !== true && option.description != null && option.description.trim() !== '') { return [ mainOption, { @@ -149,13 +150,18 @@ export class SelectInternal { ] }); - // Add tooltip functionality if tooltip is provided - if (props.tooltip != null && props.tooltip.trim() !== '') { + // Add tooltip functionality + this.setupTooltip(); + } + + private readonly setupTooltip = (): void => { + if (this.props.showDescriptionAsTooltip === true) { this.selectContainer.update({ events: { mouseenter: () => { - if (props.tooltip != null && props.tooltip.trim() !== '') { - this.showTooltip(props.tooltip); + const currentTooltip = this.getCurrentTooltip(); + if (currentTooltip != null && currentTooltip.trim() !== '') { + this.showTooltip(currentTooltip); } }, mouseleave: () => { @@ -164,7 +170,18 @@ export class SelectInternal { } }); } - } + }; + + private readonly getCurrentTooltip = (): string => { + const currentValue = this.selectElement.value; + const selectedOption = this.props.options?.find(option => option.value === currentValue); + + // Show label and description for tooltip mode; otherwise use base tooltip + if (this.props.showDescriptionAsTooltip === true && selectedOption?.description != null) { + return `${selectedOption.label}
${selectedOption.description}`; + } + return this.props.tooltip ?? ''; + }; setValue = (value: string): void => { this.selectElement.value = value; diff --git a/src/static.ts b/src/static.ts index 505294955..2ab926936 100644 --- a/src/static.ts +++ b/src/static.ts @@ -551,6 +551,7 @@ type DropdownFormItem = BaseFormItem & { }>; disabled?: boolean; selectTooltip?: string; + showDescriptionAsTooltip?: boolean; }; type Stars = BaseFormItem & { From 3132c290d16a51ebc7be5a02070fadc75fb51064 Mon Sep 17 00:00:00 2001 From: chungjac Date: Thu, 2 Oct 2025 15:11:24 -0700 Subject: [PATCH 2/5] bump version to 4.36.7 (#439) --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0671a0762..294fd2b37 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@aws/mynah-ui", - "version": "4.36.6", + "version": "4.36.7", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@aws/mynah-ui", - "version": "4.36.6", + "version": "4.36.7", "hasInstallScript": true, "license": "Apache License 2.0", "dependencies": { diff --git a/package.json b/package.json index e5fe4f163..664b0b42b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@aws/mynah-ui", "displayName": "AWS Mynah UI", - "version": "4.36.6", + "version": "4.36.7", "description": "AWS Toolkit VSCode and Intellij IDE Extension Mynah UI", "publisher": "Amazon Web Services", "license": "Apache License 2.0", From cbb43b73551907c5a05d56802407995aa7d9aeba Mon Sep 17 00:00:00 2001 From: Laxman Reddy <141967714+laileni-aws@users.noreply.github.com> Date: Thu, 2 Oct 2025 15:50:12 -0700 Subject: [PATCH 3/5] feat: node 18 to 24 upgrade (#435) --- .github/workflows/beta.yml | 2 +- .github/workflows/deploy.yml | 2 +- .github/workflows/lint.yml | 2 +- .github/workflows/publish.yml | 2 +- .github/workflows/unit-tests.yml | 2 +- package-lock.json | 21 ++++++++++++++++----- package.json | 2 +- 7 files changed, 22 insertions(+), 11 deletions(-) diff --git a/.github/workflows/beta.yml b/.github/workflows/beta.yml index 920e5e7eb..5c5fa8648 100644 --- a/.github/workflows/beta.yml +++ b/.github/workflows/beta.yml @@ -10,7 +10,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: '20.x' + node-version: '24.x' registry-url: 'https://registry.npmjs.org' scope: '@aws' - run: npm ci diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b8fa1c638..dd7aaa3fe 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -26,7 +26,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: '20.x' + node-version: '24.x' registry-url: 'https://registry.npmjs.org' scope: '@aws' - run: npm ci diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index af85381cd..d840fc393 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -12,7 +12,7 @@ jobs: - name: Set up Node uses: actions/setup-node@v4 with: - node-version: '20.x' + node-version: '24.x' registry-url: 'https://registry.npmjs.org' scope: '@aws' diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 0e590193c..25c20faa9 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -16,7 +16,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: '20.x' + node-version: '24.x' registry-url: 'https://registry.npmjs.org' scope: '@aws' - name: Install dependencies and build diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 857345928..6819f8ccd 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -11,7 +11,7 @@ jobs: - name: Set up Node uses: actions/setup-node@v4 with: - node-version: '20.x' + node-version: '24.x' registry-url: 'https://registry.npmjs.org' scope: '@aws' diff --git a/package-lock.json b/package-lock.json index 294fd2b37..fb7adb7d5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,7 +26,7 @@ "@types/jest": "^29.5.5", "@types/json-schema": "7.0.7", "@types/minimatch": "^5.1.2", - "@types/node": "17.0.29", + "@types/node": "^24.0.0", "@types/sanitize-html": "^2.11.0", "@typescript-eslint/eslint-plugin": "^5.34.0", "@typescript-eslint/parser": "^5.62.0", @@ -1749,10 +1749,14 @@ "dev": true }, "node_modules/@types/node": { - "version": "17.0.29", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.29.tgz", - "integrity": "sha512-tx5jMmMFwx7wBwq/V7OohKDVb/JwJU5qCVkeLMh1//xycAJ/ESuw9aJ9SEtlCZDYi2pBfe4JkisSoAtbOsBNAA==", - "dev": true + "version": "24.5.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.5.0.tgz", + "integrity": "sha512-y1dMvuvJspJiPSDZUQ+WMBvF7dpnEqN4x9DDC9ie5Fs/HUZJA3wFp7EhHoVaKX/iI0cRoECV8X2jL8zi0xrHCg==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~7.12.0" + } }, "node_modules/@types/sanitize-html": { "version": "2.11.0", @@ -10214,6 +10218,13 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/undici-types": { + "version": "7.12.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.12.0.tgz", + "integrity": "sha512-goOacqME2GYyOZZfb5Lgtu+1IDmAlAEu5xnD3+xTzS10hT0vzpf0SPjkXwAw9Jm+4n/mQGDP3LO8CPbYROeBfQ==", + "dev": true, + "license": "MIT" + }, "node_modules/unescape-html": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/unescape-html/-/unescape-html-1.1.0.tgz", diff --git a/package.json b/package.json index 664b0b42b..c3863bd76 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,7 @@ "@types/jest": "^29.5.5", "@types/json-schema": "7.0.7", "@types/minimatch": "^5.1.2", - "@types/node": "17.0.29", + "@types/node": "^24.0.0", "@types/sanitize-html": "^2.11.0", "@typescript-eslint/eslint-plugin": "^5.34.0", "@typescript-eslint/parser": "^5.62.0", From 50eaf8146bb4602432a3ac17f100b1442dfa5d07 Mon Sep 17 00:00:00 2001 From: chungjac Date: Mon, 6 Oct 2025 13:46:04 -0700 Subject: [PATCH 4/5] fix: edit tooltip to select dropdown (#442) This reverts commit 91ab35533a7a227f58a249fce2f486ea6ac375ed. --- example/src/config.ts | 1 - .../chat-item/chat-item-form-items.ts | 1 - src/components/form-items/select.ts | 75 ++++++------------- src/static.ts | 1 - 4 files changed, 24 insertions(+), 54 deletions(-) diff --git a/example/src/config.ts b/example/src/config.ts index efba9d3f0..5525b23ab 100644 --- a/example/src/config.ts +++ b/example/src/config.ts @@ -309,7 +309,6 @@ export const mynahUIDefaults: Partial = { id: 'model-select', mandatory: true, hideMandatoryIcon: true, - showDescriptionAsTooltip: true, options: [ { label: 'Fast', diff --git a/src/components/chat-item/chat-item-form-items.ts b/src/components/chat-item/chat-item-form-items.ts index 3fe19682b..d691c14c2 100644 --- a/src/components/chat-item/chat-item-form-items.ts +++ b/src/components/chat-item/chat-item-form-items.ts @@ -117,7 +117,6 @@ export class ChatItemFormItemsWrapper { optional: chatItemOption.mandatory !== true, placeholder: chatItemOption.placeholder ?? Config.getInstance().config.texts.pleaseSelect, tooltip: chatItemOption.selectTooltip ?? '', - showDescriptionAsTooltip: chatItemOption.showDescriptionAsTooltip, ...(this.getHandlers(chatItemOption)) }); if (chatItemOption.disabled === true) { diff --git a/src/components/form-items/select.ts b/src/components/form-items/select.ts index eba07a036..31c7b2d60 100644 --- a/src/components/form-items/select.ts +++ b/src/components/form-items/select.ts @@ -36,7 +36,6 @@ export interface SelectProps { wrapperTestId?: string; optionTestId?: string; tooltip?: string; - showDescriptionAsTooltip?: boolean; } export abstract class SelectAbstract { @@ -84,41 +83,17 @@ export class SelectInternal { value: '', description: undefined } ] - : []), ...props.options ?? [] ].flatMap(option => { - const mainOption = { - type: 'option', - testId: props.optionTestId, - classNames: option.value === '' ? [ 'empty-option' ] : [], - attributes: { - value: option.value, - ...(option.description != null && option.description.trim() !== '' ? { 'data-description': option.description } : {}) - }, - children: [ - option.label - ] - }; - - // Add disabled description option if description exists and not using tooltip - if (props.showDescriptionAsTooltip !== true && option.description != null && option.description.trim() !== '') { - return [ - mainOption, - { - type: 'option', - testId: props.optionTestId, - classNames: [ 'description-option' ], - attributes: { - value: '', - disabled: 'disabled' - }, - children: [ - ` ${option.description}` - ] - } - ]; - } - - return [ mainOption ]; - }) as DomBuilderObject[] + : []), ...props.options ?? [] ].map(option => ({ + type: 'option', + testId: props.optionTestId, + classNames: option.value === '' ? [ 'empty-option' ] : [], + attributes: { + value: option.value, + }, + children: [ + option.label + ] + })) as DomBuilderObject[] }); if (props.value !== undefined) { this.selectElement.value = props.value; @@ -155,29 +130,27 @@ export class SelectInternal { } private readonly setupTooltip = (): void => { - if (this.props.showDescriptionAsTooltip === true) { - this.selectContainer.update({ - events: { - mouseenter: () => { - const currentTooltip = this.getCurrentTooltip(); - if (currentTooltip != null && currentTooltip.trim() !== '') { - this.showTooltip(currentTooltip); - } - }, - mouseleave: () => { - this.hideTooltip(); + this.selectContainer.update({ + events: { + mouseenter: () => { + const currentTooltip = this.getCurrentTooltip(); + if (currentTooltip != null && currentTooltip.trim() !== '') { + this.showTooltip(currentTooltip); } + }, + mouseleave: () => { + this.hideTooltip(); } - }); - } + } + }); }; private readonly getCurrentTooltip = (): string => { const currentValue = this.selectElement.value; const selectedOption = this.props.options?.find(option => option.value === currentValue); - // Show label and description for tooltip mode; otherwise use base tooltip - if (this.props.showDescriptionAsTooltip === true && selectedOption?.description != null) { + // If there's a selected option, show label and description; otherwise use the base tooltip + if (selectedOption?.description != null) { return `${selectedOption.label}
${selectedOption.description}`; } return this.props.tooltip ?? ''; diff --git a/src/static.ts b/src/static.ts index 2ab926936..505294955 100644 --- a/src/static.ts +++ b/src/static.ts @@ -551,7 +551,6 @@ type DropdownFormItem = BaseFormItem & { }>; disabled?: boolean; selectTooltip?: string; - showDescriptionAsTooltip?: boolean; }; type Stars = BaseFormItem & { From 69af727ff32b3edc94a618da1b10802b250886d7 Mon Sep 17 00:00:00 2001 From: chungjac Date: Mon, 6 Oct 2025 14:12:10 -0700 Subject: [PATCH 5/5] bump to 4.36.8 (#443) --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index fb7adb7d5..1e05f86e9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@aws/mynah-ui", - "version": "4.36.7", + "version": "4.36.8", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@aws/mynah-ui", - "version": "4.36.7", + "version": "4.36.8", "hasInstallScript": true, "license": "Apache License 2.0", "dependencies": { diff --git a/package.json b/package.json index c3863bd76..d37399fbe 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@aws/mynah-ui", "displayName": "AWS Mynah UI", - "version": "4.36.7", + "version": "4.36.8", "description": "AWS Toolkit VSCode and Intellij IDE Extension Mynah UI", "publisher": "Amazon Web Services", "license": "Apache License 2.0",