@gitlab/duo-ui 8.7.0 → 8.7.1

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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [8.7.1](https://gitlab.com/gitlab-org/duo-ui/compare/v8.7.0...v8.7.1) (2025-03-11)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Duo Chat overflow on header ([90b37c7](https://gitlab.com/gitlab-org/duo-ui/commit/90b37c70ccb25f93dfdb1f3709b59c8125c1b428))
7
+
1
8
  # [8.7.0](https://gitlab.com/gitlab-org/duo-ui/compare/v8.6.0...v8.7.0) (2025-03-11)
2
9
 
3
10
 
@@ -262,7 +262,8 @@ var script = {
262
262
  compositionJustEnded: false,
263
263
  contextItemsMenuIsOpen: false,
264
264
  contextItemMenuRef: null,
265
- currentView: this.multiThreadedView
265
+ currentView: this.multiThreadedView,
266
+ headerHeight: 0
266
267
  };
267
268
  },
268
269
  computed: {
@@ -369,8 +370,13 @@ var script = {
369
370
  },
370
371
  mounted() {
371
372
  this.scrollToBottom();
373
+ this.positionContent();
372
374
  },
373
375
  methods: {
376
+ positionContent() {
377
+ var _this$$refs, _this$$refs$header, _this$$refs$header$$e, _this$$refs$header$$e2;
378
+ this.headerHeight = ((_this$$refs = this.$refs) === null || _this$$refs === void 0 ? void 0 : (_this$$refs$header = _this$$refs.header) === null || _this$$refs$header === void 0 ? void 0 : (_this$$refs$header$$e = _this$$refs$header.$el) === null || _this$$refs$header$$e === void 0 ? void 0 : (_this$$refs$header$$e2 = _this$$refs$header$$e.getBoundingClientRect()) === null || _this$$refs$header$$e2 === void 0 ? void 0 : _this$$refs$header$$e2.height) || 0;
379
+ },
374
380
  onGoBack() {
375
381
  this.$emit('back-to-list');
376
382
  },
@@ -592,7 +598,7 @@ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=
592
598
  },attrs:{"width":_vm.shouldRenderResizable ? _vm.dimensions.width : null,"height":_vm.shouldRenderResizable ? _vm.dimensions.height : null,"max-width":_vm.shouldRenderResizable ? _vm.dimensions.maxWidth : null,"max-height":_vm.shouldRenderResizable ? _vm.dimensions.maxHeight : null,"min-width":_vm.shouldRenderResizable ? _vm.dimensions.minWidth : null,"left":_vm.shouldRenderResizable ? _vm.dimensions.left : null,"top":_vm.shouldRenderResizable ? _vm.dimensions.top : null,"fit-parent":true,"min-height":_vm.shouldRenderResizable ? _vm.dimensions.minHeight : null,"active":_vm.shouldRenderResizable ? ['l', 't', 'lt'] : null},on:{"resize:end":_vm.updateSize}},[(!_vm.isHidden)?_c('aside',{staticClass:"markdown-code-block duo-chat gl-bottom-0 gl-max-h-full",class:{
593
599
  'resizable-content': _vm.shouldRenderResizable,
594
600
  'duo-chat-drawer': !_vm.shouldRenderResizable,
595
- },attrs:{"id":"chat-component","role":"complementary","data-testid":"chat-component"}},[(_vm.showHeader)?_c('duo-chat-header',{attrs:{"active-thread-id":_vm.activeThreadId,"title":_vm.isMultithreaded && _vm.currentView === 'list' ? _vm.$options.i18n.CHAT_HISTORY_TITLE : _vm.title,"error":_vm.error,"is-multithreaded":_vm.isMultithreaded,"current-view":_vm.currentView,"should-render-resizable":_vm.shouldRenderResizable,"badge-type":_vm.isMultithreaded ? null : _vm.badgeType},on:{"go-back":_vm.onGoBack,"new-chat":_vm.onNewChat,"close":_vm.hideChat},scopedSlots:_vm._u([{key:"subheader",fn:function(){return [_vm._t("subheader")]},proxy:true}],null,true)}):_vm._e(),_vm._v(" "),(_vm.shouldShowThreadList)?_c('div',{staticClass:"gl-h-full"},[_c('duo-chat-threads',{attrs:{"threads":_vm.threadList,"preferred-locale":_vm.preferredLocale},on:{"new-chat":_vm.onNewChat,"select-thread":_vm.onSelectThread,"delete-thread":_vm.onDeleteThread,"close":_vm.hideChat}})],1):_c('span',{staticClass:"gl-h-full gl-flex gl-flex-col gl-justify-end"},[_c('div',{staticClass:"duo-chat-drawer-body gl-bg-default",attrs:{"data-testid":"chat-history"},on:{"scroll":_vm.handleScrollingTrottled}},[_c('transition-group',{staticClass:"duo-chat-history gl-flex gl-flex-col gl-justify-end",class:[
601
+ },attrs:{"id":"chat-component","role":"complementary","data-testid":"chat-component"}},[(_vm.showHeader)?_c('duo-chat-header',{ref:"header",attrs:{"active-thread-id":_vm.activeThreadId,"title":_vm.isMultithreaded && _vm.currentView === 'list' ? _vm.$options.i18n.CHAT_HISTORY_TITLE : _vm.title,"error":_vm.error,"is-multithreaded":_vm.isMultithreaded,"current-view":_vm.currentView,"should-render-resizable":_vm.shouldRenderResizable,"badge-type":_vm.isMultithreaded ? null : _vm.badgeType},on:{"go-back":_vm.onGoBack,"new-chat":_vm.onNewChat,"close":_vm.hideChat},scopedSlots:_vm._u([{key:"subheader",fn:function(){return [_vm._t("subheader")]},proxy:true}],null,true)}):_vm._e(),_vm._v(" "),(_vm.shouldShowThreadList)?_c('div',{staticClass:"gl-h-full"},[_c('duo-chat-threads',{attrs:{"threads":_vm.threadList,"preferred-locale":_vm.preferredLocale},on:{"new-chat":_vm.onNewChat,"select-thread":_vm.onSelectThread,"delete-thread":_vm.onDeleteThread,"close":_vm.hideChat}})],1):_c('span',{staticClass:"gl-h-full gl-flex gl-flex-col gl-justify-end"},[_c('div',{staticClass:"duo-chat-drawer-body gl-bg-default",style:({ marginTop: (_vm.headerHeight + "px") }),attrs:{"data-testid":"chat-history"},on:{"scroll":_vm.handleScrollingTrottled}},[_c('transition-group',{staticClass:"duo-chat-history gl-flex gl-flex-col gl-justify-end",class:[
596
602
  {
597
603
  'gl-h-full': !_vm.hasMessages,
598
604
  'force-scroll-bar': _vm.hasMessages,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gitlab/duo-ui",
3
- "version": "8.7.0",
3
+ "version": "8.7.1",
4
4
  "description": "Duo UI Components",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -318,6 +318,7 @@ export default {
318
318
  contextItemsMenuIsOpen: false,
319
319
  contextItemMenuRef: null,
320
320
  currentView: this.multiThreadedView,
321
+ headerHeight: 0,
321
322
  };
322
323
  },
323
324
  computed: {
@@ -437,9 +438,13 @@ export default {
437
438
  },
438
439
  mounted() {
439
440
  this.scrollToBottom();
441
+ this.positionContent();
440
442
  },
441
443
 
442
444
  methods: {
445
+ positionContent() {
446
+ this.headerHeight = this.$refs?.header?.$el?.getBoundingClientRect()?.height || 0;
447
+ },
443
448
  onGoBack() {
444
449
  this.$emit('back-to-list');
445
450
  },
@@ -684,6 +689,7 @@ export default {
684
689
  >
685
690
  <duo-chat-header
686
691
  v-if="showHeader"
692
+ ref="header"
687
693
  :active-thread-id="activeThreadId"
688
694
  :title="
689
695
  isMultithreaded && currentView === 'list' ? $options.i18n.CHAT_HISTORY_TITLE : title
@@ -716,6 +722,7 @@ export default {
716
722
  <div
717
723
  class="duo-chat-drawer-body gl-bg-default"
718
724
  data-testid="chat-history"
725
+ :style="{ marginTop: `${headerHeight}px` }"
719
726
  @scroll="handleScrollingTrottled"
720
727
  >
721
728
  <transition-group