Skip to content

Commit 73bdf4d

Browse files
committed
feat: update layout styles and button margins for WebsiteAssistant
1 parent 9ac38e8 commit 73bdf4d

File tree

3 files changed

+38
-8
lines changed

3 files changed

+38
-8
lines changed

src/components/Header/Header.css

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
}
2727

2828
.memori-header--button + .memori-header--button {
29-
margin-left: 0.25rem;
29+
margin-left: 0;
3030
}
3131

3232
.memori-header--button[disabled]:not(.memori-header--button--knownfacts) {
@@ -79,18 +79,18 @@
7979
}
8080

8181
.memori-header--position .memori-header--button {
82-
margin-right: 0.5rem;
83-
margin-left: 0.5rem;
82+
margin-right: 0;
83+
margin-left: 0;
8484
}
8585

8686
.memori-header .memori-header--button--position,
8787
.memori-header .memori-share-button,
8888
.memori-header .memori-header--button-login {
89-
margin-left: 0.25rem;
89+
margin-left: 0;
9090
}
9191

9292
.memori-header .memori-header--button--position {
93-
margin-right: 0.25rem;
93+
margin-right: 0;
9494
}
9595

9696

src/components/layouts/website-assistant.css

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@
119119
z-index: 1001;
120120
top: 0.75rem;
121121
left: 0.75rem;
122+
flex-shrink: 0;
122123
transition: transform 0.2s ease;
123124
}
124125

@@ -127,8 +128,10 @@
127128
}
128129

129130
.memori-website_assistant--close-button-wrapper button.memori-website_assistant--close-button {
130-
width: 44px;
131-
height: 44px;
131+
width: 44px !important;
132+
min-width: 44px !important;
133+
height: 44px !important;
134+
min-height: 44px !important;
132135
padding: 0.75rem;
133136
border: 2px solid rgba(130, 70, 175, 0.1);
134137
border-radius: 50%;
@@ -303,9 +306,30 @@
303306
gap: 0.5rem;
304307
}
305308

306-
.memori-website_assistant-layout .memori-header .memori-share-button,
309+
/* Less specific first (no-descending-specificity): single .memori-header--button */
310+
.memori-website_assistant-layout .memori-header .memori-header--button,
311+
.memori-website_assistant-layout .memori-header .memori-share-button {
312+
margin-top: 0;
313+
margin-right: 0;
314+
margin-left: 0;
315+
}
316+
317+
/* Constrain circle buttons so they don't grow with font-size or flex (fixes "exploding" in layout) */
318+
.memori-website_assistant-layout .memori-header .memori-header--button,
319+
.memori-website_assistant-layout .memori-header .memori-header--button button,
320+
.memori-website_assistant-layout .memori-header .memori-share-button button {
321+
width: 44px;
322+
min-width: 44px;
323+
height: 44px;
324+
min-height: 44px;
325+
flex-shrink: 0;
326+
padding: 0;
327+
}
328+
329+
/* More specific: adjacent sibling (must come after general .memori-header--button rules) */
307330
.memori-website_assistant-layout .memori-header .memori-header--button + .memori-header--button {
308331
margin-top: 0;
332+
margin-right: 0;
309333
margin-left: 0;
310334
}
311335

@@ -328,6 +352,8 @@
328352
min-height: 0;
329353
max-height: 35%;
330354
flex: 1;
355+
/* Prevent avatar/blob from growing unbounded and overlapping header/controls */
356+
contain: layout style;
331357
}
332358

333359
.memori-website_assistant-layout--avatar .memori--avatar-wrapper {

src/index.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ export interface Props {
5252
showLogin?: boolean;
5353
showUpload?: boolean;
5454
showReasoning?: boolean;
55+
/** When true and layout is WEBSITE_ASSISTANT, hide the 3D avatar in the expanded panel. */
56+
avatar3dHidden?: boolean;
5557
height?: number | string;
5658
baseURL?: string;
5759
apiURL?: string;
@@ -132,6 +134,7 @@ const Memori: React.FC<Props> = ({
132134
showUpload,
133135
showLogin,
134136
showReasoning,
137+
avatar3dHidden,
135138
height = '100%',
136139
baseURL,
137140
apiURL = 'https://backend.memori.ai',
@@ -478,6 +481,7 @@ const Memori: React.FC<Props> = ({
478481
maxTotalMessagePayload={maxTotalMessagePayload}
479482
maxTextareaCharacters={maxTextareaCharacters}
480483
disableTextEnteredEvents={disableTextEnteredEvents}
484+
avatar3dHidden={avatar3dHidden}
481485
// From layout, from client if allowed
482486
{...clientAttributes}
483487
// Client only

0 commit comments

Comments
 (0)