cozy-search 0.29.0 → 0.29.2

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.
@@ -29,14 +29,11 @@
29
29
 
30
30
  .conversationViewport
31
31
  +mobile()
32
- // Indent the message column past the absolutely-positioned
33
- // sidebar toggle button (top-left of the screen when the sidebar
34
- // is closed) so text never overlaps the icon — even when the
35
- // conversation is scrolled. The menu button's right edge sits at
36
- // ~48px (8px header padding + 40px button), so we leave a small
37
- // buffer beyond that.
38
- padding-left 56px
39
- padding-right 16px
32
+ // Small symmetric gutter so the LLM response uses nearly the full
33
+ // mobile width. The floating sidebar-toggle button sits on an opaque
34
+ // tile, so text scrolling beneath it stays visually covered.
35
+ padding-left 8px
36
+ padding-right 8px
40
37
 
41
38
 
42
39
  .conversationBar-input
@@ -111,6 +108,8 @@
111
108
  padding 8px !important
112
109
  border-radius 8px !important
113
110
  align-items stretch !important
111
+ // force 0 gap to override cozy-ui gap 16px on .MuiListItem-root
112
+ gap: 0 !important
114
113
 
115
114
  &:hover .conversation-list-item-action,
116
115
  &:focus-within .conversation-list-item-action
@@ -128,7 +127,7 @@
128
127
 
129
128
  .conversation-list-item-divider
130
129
  // Counteract the item's 8px padding so the divider spans the full
131
- // width and sits flush with the bottom edge of the selected highlight.
130
+ // width and sits flush with the bottom edge of the selected highlight
132
131
  margin 8px -8px -8px -8px !important
133
132
 
134
133
  .conversation-list-item-action
@@ -54,7 +54,7 @@ var AssistantMessage = function AssistantMessage() {
54
54
  return (_s$metadata2 = s.metadata) === null || _s$metadata2 === void 0 ? void 0 : (_s$metadata2$custom = _s$metadata2.custom) === null || _s$metadata2$custom === void 0 ? void 0 : _s$metadata2$custom.sources;
55
55
  });
56
56
  return /*#__PURE__*/_react2.default.createElement(_react.MessagePrimitive.Root, {
57
- className: "u-mt-1-half u-mr-3"
57
+ className: "u-mt-1-half"
58
58
  }, isThinking && /*#__PURE__*/_react2.default.createElement(_Box.default, {
59
59
  display: "flex",
60
60
  alignItems: "center",
@@ -93,7 +93,12 @@ var Sidebar = function Sidebar(_ref) {
93
93
  var _useFetchConversation = (0, _useFetchConversations.default)(),
94
94
  conversations = _useFetchConversation.conversations,
95
95
  hasMore = _useFetchConversation.hasMore,
96
- fetchMore = _useFetchConversation.fetchMore;
96
+ fetchMore = _useFetchConversation.fetchMore; // When the sidebar is closed on mobile, the toggle sits over the scrolling
97
+ // conversation and must read as a distinct floating button, not blend into
98
+ // the text behind it.
99
+
100
+
101
+ var isFloatingToggle = !sidebarOpen && isMobile;
97
102
 
98
103
  var onToggleSidebar = function onToggleSidebar() {
99
104
  setSidebarOpen(!sidebarOpen);
@@ -120,24 +125,20 @@ var Sidebar = function Sidebar(_ref) {
120
125
  'u-w-auto': !sidebarOpen
121
126
  }, (0, _defineProperty2.default)(_cx, styles['sidebar-container'], sidebarOpen), (0, _defineProperty2.default)(_cx, 'u-left-0 u-pos-absolute', isMobile), _cx))
122
127
  }, /*#__PURE__*/_react.default.createElement("div", {
123
- className: (0, _classnames.default)('u-flex u-flex-items-center u-flex-justify-between u-ph-half u-pv-1', (0, _defineProperty2.default)({}, styles['menu-toggle-floating'], !sidebarOpen && isMobile))
128
+ className: "u-flex u-flex-items-center u-flex-justify-between u-ph-half u-pv-1"
129
+ }, /*#__PURE__*/_react.default.createElement("div", {
130
+ className: (0, _classnames.default)('u-flex', (0, _defineProperty2.default)({
131
+ 'u-bdrs-circle': isFloatingToggle
132
+ }, styles['menu-toggle-floating'], isFloatingToggle))
124
133
  }, /*#__PURE__*/_react.default.createElement(_IconButton.default, {
125
134
  size: "medium",
126
- className: (0, _classnames.default)('u-bdrs-6 u-p-0'),
135
+ className: "u-bdrs-6",
127
136
  onClick: onToggleSidebar,
128
137
  "aria-label": t('assistant.sidebar.toggle_sidebar')
129
- }, /*#__PURE__*/_react.default.createElement(_Buttons.default, {
130
- component: "div",
131
- variant: sidebarOpen ? 'ghost' : 'text',
132
- className: "u-miw-auto u-w-2-half u-h-2-half u-bdrs-6",
133
- classes: {
134
- label: 'u-flex u-w-auto'
135
- },
136
- label: /*#__PURE__*/_react.default.createElement(_Icon.default, {
137
- icon: _Menu.default,
138
- "aria-hidden": "true"
139
- })
140
- })), /*#__PURE__*/_react.default.createElement("div", null, sidebarOpen && (0, _cozyFlags.default)('cozy.assistant.search-conversation.enabled') && /*#__PURE__*/_react.default.createElement(_IconButton.default, {
138
+ }, /*#__PURE__*/_react.default.createElement(_Icon.default, {
139
+ icon: _Menu.default,
140
+ "aria-hidden": "true"
141
+ }))), /*#__PURE__*/_react.default.createElement("div", null, sidebarOpen && (0, _cozyFlags.default)('cozy.assistant.search-conversation.enabled') && /*#__PURE__*/_react.default.createElement(_IconButton.default, {
141
142
  size: "medium",
142
143
  className: "u-bdrs-6",
143
144
  onClick: onToggleSearch,
@@ -156,7 +157,7 @@ var Sidebar = function Sidebar(_ref) {
156
157
  })))), /*#__PURE__*/_react.default.createElement("div", {
157
158
  className: "u-ph-half u-pb-half"
158
159
  }, sidebarOpen ? /*#__PURE__*/_react.default.createElement(_Buttons.default, {
159
- className: "u-w-100",
160
+ className: "u-w-100 u-bdrs-6",
160
161
  label: t('assistant.sidebar.create_new'),
161
162
  startIcon: /*#__PURE__*/_react.default.createElement(_Icon.default, {
162
163
  icon: _Plus.default
@@ -176,7 +177,7 @@ var Sidebar = function Sidebar(_ref) {
176
177
  variant: "h6",
177
178
  className: "u-ml-half u-p-half"
178
179
  }, t('assistant.sidebar.recent_chats')), /*#__PURE__*/_react.default.createElement(_PrettyScrollbar.default, {
179
- className: "u-flex-auto u-ov-auto u-ph-half u-pb-half"
180
+ className: "u-flex-auto u-ov-auto u-pb-half"
180
181
  }, /*#__PURE__*/_react.default.createElement(_ConversationList.default, {
181
182
  conversations: conversations,
182
183
  currentConversationId: currentConversationId,
@@ -21,9 +21,12 @@
21
21
  z-index calc(var(--zIndex-modal) + 20)
22
22
 
23
23
  .menu-toggle-floating
24
- // When the sidebar is closed on mobile, the toggle button sits
25
- // absolutely over the scrolling conversation. Give it an opaque
26
- // paper background so any message text that scrolls behind it is
27
- // not visible through the icon.
28
- background-color var(--paperBackgroundColor)
29
- border-bottom-right-radius 12px
24
+ // When the sidebar is closed on mobile, the toggle button floats over the
25
+ // scrolling conversation. Wrap it in a circular chip with an elevation
26
+ // shadow (M3 elevation 2) and a 60%-opacity paper background (as in the
27
+ // design) so the circle is semi-transparent while the icon inside stays
28
+ // fully opaque. The transparency is on the background color (not the
29
+ // element's opacity) precisely so it does not fade the icon too.
30
+ // unquote() keeps Stylus from parsing `in` as an operator.
31
+ background-color unquote('color-mix(in srgb, var(--paperBackgroundColor) 60%, transparent)')
32
+ box-shadow 0 1px 2px 0 rgba(0, 0, 0, 0.3), 0 2px 6px 2px rgba(0, 0, 0, 0.15)
@@ -125,8 +125,8 @@
125
125
  }
126
126
  @media (max-width: 48rem) {
127
127
  .styles__conversationViewport___24jYX {
128
- padding-left: 56px;
129
- padding-right: 16px;
128
+ padding-left: 8px;
129
+ padding-right: 8px;
130
130
  }
131
131
  }
132
132
  .styles__conversationBar-input___2DfdZ {
@@ -202,6 +202,7 @@
202
202
  padding: 8px !important;
203
203
  border-radius: 8px !important;
204
204
  align-items: stretch !important;
205
+ gap: 0 !important;
205
206
  }
206
207
  .styles__conversation-list-item___rQapI:hover .styles__conversation-list-item-action___qiuKm,
207
208
  .styles__conversation-list-item___rQapI:focus-within .styles__conversation-list-item-action___qiuKm {
@@ -371,8 +372,8 @@
371
372
  z-index: calc(var(--zIndex-modal) + 20);
372
373
  }
373
374
  .styles__menu-toggle-floating___2GTmQ {
374
- background-color: var(--paperBackgroundColor);
375
- border-bottom-right-radius: 12px;
375
+ background-color: color-mix(in srgb, var(--paperBackgroundColor) 60%, transparent);
376
+ box-shadow: 0 1px 2px 0 rgba(0,0,0,0.3), 0 2px 6px 2px rgba(0,0,0,0.15);
376
377
  }
377
378
  /* imported from styles.styl */
378
379
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cozy-search",
3
3
  "description": "UI components about search bar and IA assistant",
4
- "version": "0.29.0",
4
+ "version": "0.29.2",
5
5
  "author": {
6
6
  "name": "Cozy Cloud",
7
7
  "url": "https://github.com/cozy"
@@ -33,7 +33,7 @@
33
33
  "cozy-logger": "^1.18.1",
34
34
  "cozy-minilog": "^3.10.1",
35
35
  "cozy-pouch-link": "^54.0.0",
36
- "cozy-realtime": "^5.9.1",
36
+ "cozy-realtime": "^5.9.2",
37
37
  "cozy-ui": "^138.4.0",
38
38
  "cozy-ui-plus": "^8.0.1",
39
39
  "cross-fetch": "^4.0.0",
@@ -92,5 +92,5 @@
92
92
  "lint": "cd .. && yarn eslint --ext js,jsx,ts packages/cozy-search"
93
93
  },
94
94
  "types": "dist/index.d.ts",
95
- "gitHead": "8a7bc36fc1aa0b267ed6b9a36585510997ee7da8"
95
+ "gitHead": "4e078ae8d70c8d348e35c77f3b9edcd1fa6cc972"
96
96
  }