@genesislcap/ai-assistant 14.437.3 → 14.437.5-canary.gs-datepicker
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/dist/ai-assistant.d.ts +9 -0
- package/dist/dts/components/chat-interaction-wrapper/chat-interaction-wrapper.d.ts +17 -0
- package/dist/dts/components/chat-interaction-wrapper/chat-interaction-wrapper.d.ts.map +1 -1
- package/dist/dts/main/main.d.ts +9 -0
- package/dist/dts/main/main.d.ts.map +1 -1
- package/dist/esm/components/chat-interaction-wrapper/chat-interaction-wrapper.js +36 -0
- package/dist/esm/main/main.js +13 -0
- package/package.json +16 -16
- package/src/components/chat-interaction-wrapper/chat-interaction-wrapper.ts +40 -0
- package/src/main/main.ts +13 -0
package/dist/ai-assistant.d.ts
CHANGED
|
@@ -985,6 +985,15 @@ export declare class FoundationAiAssistant extends GenesisElement {
|
|
|
985
985
|
private _userScrolledAway;
|
|
986
986
|
private _scrollListener?;
|
|
987
987
|
private static readonly SCROLL_BOTTOM_THRESHOLD_PX;
|
|
988
|
+
/**
|
|
989
|
+
* Interaction widgets that grow mid-lifecycle (e.g. expanding a "More info"
|
|
990
|
+
* panel, appending an SSE status row, revealing generated code) bubble a
|
|
991
|
+
* `request-scroll-to-bottom` event up from `ai-chat-interaction-wrapper`,
|
|
992
|
+
* which observes them with a ResizeObserver. We re-snap to the bottom on
|
|
993
|
+
* receipt, honouring `_userScrolledAway` so a user reading old messages is
|
|
994
|
+
* not yanked back when content elsewhere grows.
|
|
995
|
+
*/
|
|
996
|
+
private readonly _handleRequestScrollToBottom;
|
|
988
997
|
/**
|
|
989
998
|
* Unsubscribes a one-shot state subscription created when this element connects
|
|
990
999
|
* mid-execution. The subscription watches for `state` becoming 'idle' so that
|
|
@@ -22,9 +22,26 @@ export declare class AiChatInteractionWrapper extends GenesisElement {
|
|
|
22
22
|
resolved: InteractionResult<unknown> | undefined;
|
|
23
23
|
/** @internal */
|
|
24
24
|
container: HTMLElement;
|
|
25
|
+
/** Observes the rendered widget for mid-lifecycle size changes — see {@link observeWidgetResize}. */
|
|
26
|
+
private _resizeObserver?;
|
|
25
27
|
connectedCallback(): void;
|
|
28
|
+
disconnectedCallback(): void;
|
|
26
29
|
componentNameChanged(): void;
|
|
27
30
|
resolvedChanged(): void;
|
|
31
|
+
/**
|
|
32
|
+
* Watch the rendered widget element for box-size changes. When the widget
|
|
33
|
+
* grows or shrinks mid-lifecycle (e.g. expanding a "More info" panel,
|
|
34
|
+
* appending an SSE status row, revealing generated code), bubble a
|
|
35
|
+
* `request-scroll-to-bottom` event so `FoundationAiAssistant` re-snaps to
|
|
36
|
+
* the bottom. `scrollToBottom` respects `_userScrolledAway`, so a user
|
|
37
|
+
* reading old messages is not yanked back.
|
|
38
|
+
*
|
|
39
|
+
* The first ResizeObserver callback fires synchronously with the initial
|
|
40
|
+
* size when `observe()` is called; we skip it so freshly-rendered widgets
|
|
41
|
+
* don't double up with the existing `handleMessagesUpdate` auto-scroll for
|
|
42
|
+
* new messages.
|
|
43
|
+
*/
|
|
44
|
+
private observeWidgetResize;
|
|
28
45
|
private renderComponent;
|
|
29
46
|
}
|
|
30
47
|
//# sourceMappingURL=chat-interaction-wrapper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat-interaction-wrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/chat-interaction-wrapper/chat-interaction-wrapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAiB,cAAc,EAAc,MAAM,uBAAuB,CAAC;AAKlF,MAAM,MAAM,wBAAwB,GAAG;IACrC,uBAAuB,EAAE,iBAAiB,CAAC,OAAO,CAAC,GAAG;QAAE,aAAa,EAAE,MAAM,CAAA;KAAE,CAAC;CACjF,CAAC;AAEF;;;;;GAKG;AACH,qBAKa,wBAAyB,SAAQ,cAAc;IAC1D,gBAAgB;IACJ,aAAa,EAAE,MAAM,CAAM;IACvC,gBAAgB;IACJ,IAAI,EAAE,GAAG,CAAC;IACtB,gBAAgB;IACJ,aAAa,EAAE,MAAM,CAAM;IACvC,6GAA6G;IACjG,QAAQ,EAAE,iBAAiB,CAAC,OAAO,CAAC,GAAG,SAAS,CAAa;IAEzE,gBAAgB;IAChB,SAAS,EAAG,WAAW,CAAC;IAExB,iBAAiB;IAKjB,oBAAoB;IAIpB,eAAe;IAOf,OAAO,CAAC,eAAe;
|
|
1
|
+
{"version":3,"file":"chat-interaction-wrapper.d.ts","sourceRoot":"","sources":["../../../../src/components/chat-interaction-wrapper/chat-interaction-wrapper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAiB,cAAc,EAAc,MAAM,uBAAuB,CAAC;AAKlF,MAAM,MAAM,wBAAwB,GAAG;IACrC,uBAAuB,EAAE,iBAAiB,CAAC,OAAO,CAAC,GAAG;QAAE,aAAa,EAAE,MAAM,CAAA;KAAE,CAAC;CACjF,CAAC;AAEF;;;;;GAKG;AACH,qBAKa,wBAAyB,SAAQ,cAAc;IAC1D,gBAAgB;IACJ,aAAa,EAAE,MAAM,CAAM;IACvC,gBAAgB;IACJ,IAAI,EAAE,GAAG,CAAC;IACtB,gBAAgB;IACJ,aAAa,EAAE,MAAM,CAAM;IACvC,6GAA6G;IACjG,QAAQ,EAAE,iBAAiB,CAAC,OAAO,CAAC,GAAG,SAAS,CAAa;IAEzE,gBAAgB;IAChB,SAAS,EAAG,WAAW,CAAC;IAExB,qGAAqG;IACrG,OAAO,CAAC,eAAe,CAAC,CAAiB;IAEzC,iBAAiB;IAKjB,oBAAoB;IAMpB,oBAAoB;IAIpB,eAAe;IAOf;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,mBAAmB;IAe3B,OAAO,CAAC,eAAe;CAuDxB"}
|
package/dist/dts/main/main.d.ts
CHANGED
|
@@ -144,6 +144,15 @@ export declare class FoundationAiAssistant extends GenesisElement {
|
|
|
144
144
|
private _userScrolledAway;
|
|
145
145
|
private _scrollListener?;
|
|
146
146
|
private static readonly SCROLL_BOTTOM_THRESHOLD_PX;
|
|
147
|
+
/**
|
|
148
|
+
* Interaction widgets that grow mid-lifecycle (e.g. expanding a "More info"
|
|
149
|
+
* panel, appending an SSE status row, revealing generated code) bubble a
|
|
150
|
+
* `request-scroll-to-bottom` event up from `ai-chat-interaction-wrapper`,
|
|
151
|
+
* which observes them with a ResizeObserver. We re-snap to the bottom on
|
|
152
|
+
* receipt, honouring `_userScrolledAway` so a user reading old messages is
|
|
153
|
+
* not yanked back when content elsewhere grows.
|
|
154
|
+
*/
|
|
155
|
+
private readonly _handleRequestScrollToBottom;
|
|
147
156
|
/**
|
|
148
157
|
* Unsubscribes a one-shot state subscription created when this element connects
|
|
149
158
|
* mid-execution. The subscription watches for `state` becoming 'idle' so that
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../src/main/main.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,KAAK,EACV,cAAc,EACd,UAAU,EACV,4BAA4B,EAC5B,WAAW,EACZ,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAGL,cAAc,EAIf,MAAM,uBAAuB,CAAC;AAW/B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAgBpD,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,gBAAgB,EAChB,UAAU,EACV,gBAAgB,EACjB,MAAM,cAAc,CAAC;AAwEtB;;;;;;;;;;;;;GAaG;AACH,qBAOa,qBAAsB,SAAQ,cAAc;IAC3C,UAAU,EAAG,UAAU,CAAC;IAExB,kBAAkB,EAAE,MAAM,CAAW;IACZ,WAAW,EAAE,MAAM,CAAuB;IAC7C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC5C,W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B,8BAA8B;IAI9B,oBAAoB,CAAC,UAAU,EAAE,oBAAoB,EAAE;IAIvD,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAqDX,gBAAgB;IAehB,gBAAgB,IAAI,IAAI;IAIxB,gBAAgB,CAAC,CAAC,EAAE,KAAK,GAAG,IAAI;IAIhC,gBAAgB,CAAC,UAAU,EAAE,cAAc,GAAG,IAAI;IAIlD,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAU5C,OAAO,CAAC,cAAc;IAetB,OAAO,CAAC,cAAc;YASR,iBAAiB;IAmC/B,eAAe;IAIf,qBAAqB,CAAC,UAAU,EAAE,MAAM;YAK1B,gBAAgB;YA4DhB,IAAI;IAwClB,qBAAqB,CAAC,CAAC,EAAE,UAAU;IAYnC,0BAA0B,CAAC,CAAC,EAAE,KAAK;CAQpC"}
|
|
@@ -23,6 +23,12 @@ let AiChatInteractionWrapper = class AiChatInteractionWrapper extends GenesisEle
|
|
|
23
23
|
super.connectedCallback();
|
|
24
24
|
this.renderComponent();
|
|
25
25
|
}
|
|
26
|
+
disconnectedCallback() {
|
|
27
|
+
var _a;
|
|
28
|
+
super.disconnectedCallback();
|
|
29
|
+
(_a = this._resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
30
|
+
this._resizeObserver = undefined;
|
|
31
|
+
}
|
|
26
32
|
componentNameChanged() {
|
|
27
33
|
this.renderComponent();
|
|
28
34
|
}
|
|
@@ -33,10 +39,39 @@ let AiChatInteractionWrapper = class AiChatInteractionWrapper extends GenesisEle
|
|
|
33
39
|
element.resolved = this.resolved;
|
|
34
40
|
}
|
|
35
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* Watch the rendered widget element for box-size changes. When the widget
|
|
44
|
+
* grows or shrinks mid-lifecycle (e.g. expanding a "More info" panel,
|
|
45
|
+
* appending an SSE status row, revealing generated code), bubble a
|
|
46
|
+
* `request-scroll-to-bottom` event so `FoundationAiAssistant` re-snaps to
|
|
47
|
+
* the bottom. `scrollToBottom` respects `_userScrolledAway`, so a user
|
|
48
|
+
* reading old messages is not yanked back.
|
|
49
|
+
*
|
|
50
|
+
* The first ResizeObserver callback fires synchronously with the initial
|
|
51
|
+
* size when `observe()` is called; we skip it so freshly-rendered widgets
|
|
52
|
+
* don't double up with the existing `handleMessagesUpdate` auto-scroll for
|
|
53
|
+
* new messages.
|
|
54
|
+
*/
|
|
55
|
+
observeWidgetResize(element) {
|
|
56
|
+
var _a;
|
|
57
|
+
(_a = this._resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
58
|
+
let initialFireSkipped = false;
|
|
59
|
+
this._resizeObserver = new ResizeObserver(() => {
|
|
60
|
+
if (!initialFireSkipped) {
|
|
61
|
+
initialFireSkipped = true;
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
this.dispatchEvent(new CustomEvent('request-scroll-to-bottom', { bubbles: true, composed: true }));
|
|
65
|
+
});
|
|
66
|
+
this._resizeObserver.observe(element);
|
|
67
|
+
}
|
|
36
68
|
renderComponent() {
|
|
69
|
+
var _a;
|
|
37
70
|
if (!this.container || !this.componentName)
|
|
38
71
|
return;
|
|
39
72
|
// Clear children without using innerHTML
|
|
73
|
+
(_a = this._resizeObserver) === null || _a === void 0 ? void 0 : _a.disconnect();
|
|
74
|
+
this._resizeObserver = undefined;
|
|
40
75
|
this.container.replaceChildren();
|
|
41
76
|
if (!customElements.get(this.componentName)) {
|
|
42
77
|
logger.warn(`Interactive component "\${this.componentName}" is not registered in the customElements registry.`);
|
|
@@ -68,6 +103,7 @@ let AiChatInteractionWrapper = class AiChatInteractionWrapper extends GenesisEle
|
|
|
68
103
|
this.$emit('interaction-completed', Object.assign({ interactionId: this.interactionId }, e.detail));
|
|
69
104
|
});
|
|
70
105
|
this.container.appendChild(element);
|
|
106
|
+
this.observeWidgetResize(element);
|
|
71
107
|
}
|
|
72
108
|
catch (e) {
|
|
73
109
|
logger.error(`Failed to create interactive component: \${this.componentName}`, e);
|
package/dist/esm/main/main.js
CHANGED
|
@@ -133,6 +133,17 @@ let FoundationAiAssistant = FoundationAiAssistant_1 = class FoundationAiAssistan
|
|
|
133
133
|
};
|
|
134
134
|
/** True when the user has intentionally scrolled away from the bottom — suppresses auto-scroll. */
|
|
135
135
|
this._userScrolledAway = false;
|
|
136
|
+
/**
|
|
137
|
+
* Interaction widgets that grow mid-lifecycle (e.g. expanding a "More info"
|
|
138
|
+
* panel, appending an SSE status row, revealing generated code) bubble a
|
|
139
|
+
* `request-scroll-to-bottom` event up from `ai-chat-interaction-wrapper`,
|
|
140
|
+
* which observes them with a ResizeObserver. We re-snap to the bottom on
|
|
141
|
+
* receipt, honouring `_userScrolledAway` so a user reading old messages is
|
|
142
|
+
* not yanked back when content elsewhere grows.
|
|
143
|
+
*/
|
|
144
|
+
this._handleRequestScrollToBottom = () => {
|
|
145
|
+
this.scrollToBottom();
|
|
146
|
+
};
|
|
136
147
|
this.showHalo = 'no';
|
|
137
148
|
this._settingsToggle = new AnimatedPanelToggle(this, '.settings-panel', SETTINGS_CLOSE_MS, () => this.settingsOpen, (v) => {
|
|
138
149
|
this.settingsOpen = v;
|
|
@@ -740,6 +751,7 @@ let FoundationAiAssistant = FoundationAiAssistant_1 = class FoundationAiAssistan
|
|
|
740
751
|
};
|
|
741
752
|
this.messagesEl.addEventListener('scroll', this._scrollListener);
|
|
742
753
|
}
|
|
754
|
+
this.addEventListener('request-scroll-to-bottom', this._handleRequestScrollToBottom);
|
|
743
755
|
// Track whether the user's most recent interaction was inside this assistant.
|
|
744
756
|
// Capture phase + composedPath() pierces shadow boundaries reliably.
|
|
745
757
|
document.addEventListener('pointerdown', this._handleGlobalInteraction, true);
|
|
@@ -765,6 +777,7 @@ let FoundationAiAssistant = FoundationAiAssistant_1 = class FoundationAiAssistan
|
|
|
765
777
|
}
|
|
766
778
|
this._scrollListener = undefined;
|
|
767
779
|
this._userScrolledAway = false;
|
|
780
|
+
this.removeEventListener('request-scroll-to-bottom', this._handleRequestScrollToBottom);
|
|
768
781
|
document.removeEventListener('pointerdown', this._handleGlobalInteraction, true);
|
|
769
782
|
document.removeEventListener('focusin', this._handleGlobalInteraction, true);
|
|
770
783
|
// Finalise any in-flight panel-close animations before clearing
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genesislcap/ai-assistant",
|
|
3
3
|
"description": "Genesis AI Assistant micro-frontend",
|
|
4
|
-
"version": "14.437.
|
|
4
|
+
"version": "14.437.5-canary.gs-datepicker",
|
|
5
5
|
"license": "SEE LICENSE IN license.txt",
|
|
6
6
|
"main": "dist/esm/index.js",
|
|
7
7
|
"types": "dist/ai-assistant.d.ts",
|
|
@@ -64,24 +64,24 @@
|
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@genesislcap/foundation-testing": "14.437.
|
|
68
|
-
"@genesislcap/genx": "14.437.
|
|
69
|
-
"@genesislcap/rollup-builder": "14.437.
|
|
70
|
-
"@genesislcap/ts-builder": "14.437.
|
|
71
|
-
"@genesislcap/uvu-playwright-builder": "14.437.
|
|
72
|
-
"@genesislcap/vite-builder": "14.437.
|
|
73
|
-
"@genesislcap/webpack-builder": "14.437.
|
|
67
|
+
"@genesislcap/foundation-testing": "14.437.5-canary.gs-datepicker",
|
|
68
|
+
"@genesislcap/genx": "14.437.5-canary.gs-datepicker",
|
|
69
|
+
"@genesislcap/rollup-builder": "14.437.5-canary.gs-datepicker",
|
|
70
|
+
"@genesislcap/ts-builder": "14.437.5-canary.gs-datepicker",
|
|
71
|
+
"@genesislcap/uvu-playwright-builder": "14.437.5-canary.gs-datepicker",
|
|
72
|
+
"@genesislcap/vite-builder": "14.437.5-canary.gs-datepicker",
|
|
73
|
+
"@genesislcap/webpack-builder": "14.437.5-canary.gs-datepicker",
|
|
74
74
|
"@types/dompurify": "^3.0.5",
|
|
75
75
|
"@types/marked": "^5.0.2"
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
|
-
"@genesislcap/foundation-ai": "14.437.
|
|
79
|
-
"@genesislcap/foundation-logger": "14.437.
|
|
80
|
-
"@genesislcap/foundation-redux": "14.437.
|
|
81
|
-
"@genesislcap/foundation-ui": "14.437.
|
|
82
|
-
"@genesislcap/foundation-utils": "14.437.
|
|
83
|
-
"@genesislcap/rapid-design-system": "14.437.
|
|
84
|
-
"@genesislcap/web-core": "14.437.
|
|
78
|
+
"@genesislcap/foundation-ai": "14.437.5-canary.gs-datepicker",
|
|
79
|
+
"@genesislcap/foundation-logger": "14.437.5-canary.gs-datepicker",
|
|
80
|
+
"@genesislcap/foundation-redux": "14.437.5-canary.gs-datepicker",
|
|
81
|
+
"@genesislcap/foundation-ui": "14.437.5-canary.gs-datepicker",
|
|
82
|
+
"@genesislcap/foundation-utils": "14.437.5-canary.gs-datepicker",
|
|
83
|
+
"@genesislcap/rapid-design-system": "14.437.5-canary.gs-datepicker",
|
|
84
|
+
"@genesislcap/web-core": "14.437.5-canary.gs-datepicker",
|
|
85
85
|
"dompurify": "^3.3.1",
|
|
86
86
|
"marked": "^17.0.3"
|
|
87
87
|
},
|
|
@@ -93,5 +93,5 @@
|
|
|
93
93
|
"publishConfig": {
|
|
94
94
|
"access": "public"
|
|
95
95
|
},
|
|
96
|
-
"gitHead": "
|
|
96
|
+
"gitHead": "d926dcc5c1273bf6824c3e8121331ea88cdfc9e1"
|
|
97
97
|
}
|
|
@@ -32,11 +32,20 @@ export class AiChatInteractionWrapper extends GenesisElement {
|
|
|
32
32
|
/** @internal */
|
|
33
33
|
container!: HTMLElement;
|
|
34
34
|
|
|
35
|
+
/** Observes the rendered widget for mid-lifecycle size changes — see {@link observeWidgetResize}. */
|
|
36
|
+
private _resizeObserver?: ResizeObserver;
|
|
37
|
+
|
|
35
38
|
connectedCallback() {
|
|
36
39
|
super.connectedCallback();
|
|
37
40
|
this.renderComponent();
|
|
38
41
|
}
|
|
39
42
|
|
|
43
|
+
disconnectedCallback() {
|
|
44
|
+
super.disconnectedCallback();
|
|
45
|
+
this._resizeObserver?.disconnect();
|
|
46
|
+
this._resizeObserver = undefined;
|
|
47
|
+
}
|
|
48
|
+
|
|
40
49
|
componentNameChanged() {
|
|
41
50
|
this.renderComponent();
|
|
42
51
|
}
|
|
@@ -48,10 +57,40 @@ export class AiChatInteractionWrapper extends GenesisElement {
|
|
|
48
57
|
}
|
|
49
58
|
}
|
|
50
59
|
|
|
60
|
+
/**
|
|
61
|
+
* Watch the rendered widget element for box-size changes. When the widget
|
|
62
|
+
* grows or shrinks mid-lifecycle (e.g. expanding a "More info" panel,
|
|
63
|
+
* appending an SSE status row, revealing generated code), bubble a
|
|
64
|
+
* `request-scroll-to-bottom` event so `FoundationAiAssistant` re-snaps to
|
|
65
|
+
* the bottom. `scrollToBottom` respects `_userScrolledAway`, so a user
|
|
66
|
+
* reading old messages is not yanked back.
|
|
67
|
+
*
|
|
68
|
+
* The first ResizeObserver callback fires synchronously with the initial
|
|
69
|
+
* size when `observe()` is called; we skip it so freshly-rendered widgets
|
|
70
|
+
* don't double up with the existing `handleMessagesUpdate` auto-scroll for
|
|
71
|
+
* new messages.
|
|
72
|
+
*/
|
|
73
|
+
private observeWidgetResize(element: Element) {
|
|
74
|
+
this._resizeObserver?.disconnect();
|
|
75
|
+
let initialFireSkipped = false;
|
|
76
|
+
this._resizeObserver = new ResizeObserver(() => {
|
|
77
|
+
if (!initialFireSkipped) {
|
|
78
|
+
initialFireSkipped = true;
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
this.dispatchEvent(
|
|
82
|
+
new CustomEvent('request-scroll-to-bottom', { bubbles: true, composed: true }),
|
|
83
|
+
);
|
|
84
|
+
});
|
|
85
|
+
this._resizeObserver.observe(element);
|
|
86
|
+
}
|
|
87
|
+
|
|
51
88
|
private renderComponent() {
|
|
52
89
|
if (!this.container || !this.componentName) return;
|
|
53
90
|
|
|
54
91
|
// Clear children without using innerHTML
|
|
92
|
+
this._resizeObserver?.disconnect();
|
|
93
|
+
this._resizeObserver = undefined;
|
|
55
94
|
this.container.replaceChildren();
|
|
56
95
|
|
|
57
96
|
if (!customElements.get(this.componentName)) {
|
|
@@ -93,6 +132,7 @@ export class AiChatInteractionWrapper extends GenesisElement {
|
|
|
93
132
|
});
|
|
94
133
|
|
|
95
134
|
this.container.appendChild(element);
|
|
135
|
+
this.observeWidgetResize(element);
|
|
96
136
|
} catch (e) {
|
|
97
137
|
logger.error(`Failed to create interactive component: \${this.componentName}`, e);
|
|
98
138
|
const errorDiv = document.createElement('div');
|
package/src/main/main.ts
CHANGED
|
@@ -419,6 +419,17 @@ export class FoundationAiAssistant extends GenesisElement {
|
|
|
419
419
|
private _userScrolledAway = false;
|
|
420
420
|
private _scrollListener?: () => void;
|
|
421
421
|
private static readonly SCROLL_BOTTOM_THRESHOLD_PX = 50;
|
|
422
|
+
/**
|
|
423
|
+
* Interaction widgets that grow mid-lifecycle (e.g. expanding a "More info"
|
|
424
|
+
* panel, appending an SSE status row, revealing generated code) bubble a
|
|
425
|
+
* `request-scroll-to-bottom` event up from `ai-chat-interaction-wrapper`,
|
|
426
|
+
* which observes them with a ResizeObserver. We re-snap to the bottom on
|
|
427
|
+
* receipt, honouring `_userScrolledAway` so a user reading old messages is
|
|
428
|
+
* not yanked back when content elsewhere grows.
|
|
429
|
+
*/
|
|
430
|
+
private readonly _handleRequestScrollToBottom = () => {
|
|
431
|
+
this.scrollToBottom();
|
|
432
|
+
};
|
|
422
433
|
/**
|
|
423
434
|
* Unsubscribes a one-shot state subscription created when this element connects
|
|
424
435
|
* mid-execution. The subscription watches for `state` becoming 'idle' so that
|
|
@@ -842,6 +853,7 @@ export class FoundationAiAssistant extends GenesisElement {
|
|
|
842
853
|
};
|
|
843
854
|
this.messagesEl.addEventListener('scroll', this._scrollListener);
|
|
844
855
|
}
|
|
856
|
+
this.addEventListener('request-scroll-to-bottom', this._handleRequestScrollToBottom);
|
|
845
857
|
// Track whether the user's most recent interaction was inside this assistant.
|
|
846
858
|
// Capture phase + composedPath() pierces shadow boundaries reliably.
|
|
847
859
|
document.addEventListener('pointerdown', this._handleGlobalInteraction, true);
|
|
@@ -866,6 +878,7 @@ export class FoundationAiAssistant extends GenesisElement {
|
|
|
866
878
|
}
|
|
867
879
|
this._scrollListener = undefined;
|
|
868
880
|
this._userScrolledAway = false;
|
|
881
|
+
this.removeEventListener('request-scroll-to-bottom', this._handleRequestScrollToBottom);
|
|
869
882
|
document.removeEventListener('pointerdown', this._handleGlobalInteraction, true);
|
|
870
883
|
document.removeEventListener('focusin', this._handleGlobalInteraction, true);
|
|
871
884
|
// Finalise any in-flight panel-close animations before clearing
|