Skip to content
This repository was archived by the owner on Jul 22, 2025. It is now read-only.

Commit e1731dc

Browse files
UX: Align styling with conventions (#1275)
1 parent 4470e8a commit e1731dc

File tree

2 files changed

+33
-84
lines changed

2 files changed

+33
-84
lines changed

assets/javascripts/discourse/templates/discourse-ai-bot-conversations.gjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default RouteTemplate(
1616
@value={{@controller.selectedPersona}}
1717
@valueProperty="username"
1818
@content={{@controller.personaOptions}}
19-
@options={{hash icon="robot" filterable=@controller.filterable}}
19+
@options={{hash icon="angle-down"}}
2020
@onChange={{@controller.selectedPersonaChanged}}
2121
/>
2222
</div>

assets/stylesheets/modules/ai-bot-conversations/common.scss

Lines changed: 32 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use "lib/viewport";
2+
13
// Hide the new question button from the hamburger menu's footer
24
.hamburger-panel .ai-new-question-button {
35
display: none;
@@ -9,10 +11,6 @@ body.has-ai-conversations-sidebar {
911
}
1012

1113
.sidebar-wrapper {
12-
.sidebar-container {
13-
border: none;
14-
}
15-
1614
.ai-conversations-panel {
1715
padding-top: 0;
1816
}
@@ -66,7 +64,6 @@ body.has-ai-conversations-sidebar {
6664
.topic-header-participants,
6765
.topic-above-footer-buttons-outlet,
6866
.topic-map,
69-
.timeline-ago,
7067
#topic-footer-buttons .topic-footer-main-buttons details {
7168
display: none;
7269
}
@@ -114,34 +111,26 @@ body.has-ai-conversations-sidebar {
114111
width: calc(100% - 6.5em);
115112
margin-top: 0;
116113

117-
@media screen and (max-width: 924px) {
114+
@include viewport.until(md) {
118115
max-width: unset;
119116
width: 100%;
120117
}
121118

122-
@media screen and (min-width: 1300px) {
119+
@include viewport.from(xl) {
123120
width: 100%;
124121
max-width: 51em;
125122
}
126123

127124
.topic-footer-main-buttons {
128125
justify-content: flex-end;
129-
130-
@media screen and (min-width: 1180px) {
131-
margin-right: 0.6em;
132-
}
133-
134-
@media screen and (max-width: 924px) {
135-
margin-right: 0.6em;
136-
}
137126
}
138127
}
139128

140129
#topic-progress-wrapper.docked {
141130
display: none;
142131
}
143132

144-
@media screen and (max-width: 924px) {
133+
@include viewport.until(lg) {
145134
.archetype-private_message .topic-post:last-child {
146135
margin-bottom: 0;
147136
}
@@ -164,16 +153,25 @@ body.has-ai-conversations-sidebar {
164153
.ai-bot-conversations {
165154
height: calc(100dvh - var(--header-offset) - 1.25em);
166155

167-
@media screen and (min-width: 675px) {
168-
border: 1px solid var(--primary-low);
169-
padding: 2em 2em 3em;
170-
border-radius: var(--border-radius);
171-
height: calc(100dvh - var(--header-offset) - 10em);
172-
}
173-
174156
&__persona-selector {
175157
display: flex;
176-
justify-content: flex-end;
158+
justify-content: flex-start;
159+
}
160+
161+
&__persona-selector .btn {
162+
background-color: transparent;
163+
font-weight: bold;
164+
}
165+
166+
&__persona-selector .btn:hover,
167+
&__persona-selector .btn:focus {
168+
background-color: transparent;
169+
color: var(--primary);
170+
}
171+
172+
&__persona-selector .btn:hover .d-icon,
173+
&__persona-selector .btn:focus .d-icon {
174+
color: var(--primary);
177175
}
178176

179177
&__content-wrapper {
@@ -182,18 +180,20 @@ body.has-ai-conversations-sidebar {
182180
box-sizing: border-box;
183181
align-items: center;
184182
justify-content: center;
185-
height: 100%;
183+
height: calc(90% - 1.25em - var(--header-offset));
184+
185+
@include viewport.until(sm) {
186+
height: calc(75% - 1.25em - var(--header-offset) - 2em);
187+
}
186188
}
187189

188190
&__input-wrapper {
189191
display: flex;
190192
align-items: stretch;
191193
gap: 0.5em;
192194
width: 100%;
193-
max-width: 90dvw;
194-
margin-top: 2em;
195195

196-
@media screen and (min-width: 600px) {
196+
@include viewport.from(sm) {
197197
width: 80%;
198198
max-width: 46em;
199199
}
@@ -217,32 +217,12 @@ body.has-ai-conversations-sidebar {
217217
}
218218
}
219219

220-
h1 {
221-
margin-bottom: 0.45em;
222-
max-width: 20em;
223-
text-align: center;
224-
font-size: var(--font-up-6);
225-
line-height: var(--line-height-medium);
226-
227-
@media screen and (min-height: 300px) {
228-
margin-top: -1em;
229-
}
230-
231-
@media screen and (min-height: 600px) {
232-
margin-top: -3em;
233-
}
234-
235-
@media screen and (min-height: 900px) {
236-
margin-top: -6em;
237-
}
238-
}
239-
240220
.ai-disclaimer {
241221
text-align: center;
242222
font-size: var(--font-down-1);
243223
color: var(--primary-700);
244224

245-
@media screen and (min-width: 600px) {
225+
@include viewport.from(sm) {
246226
width: 80%;
247227
max-width: 46em;
248228
}
@@ -259,30 +239,13 @@ body.has-ai-conversations-sidebar {
259239
display: none;
260240
}
261241
}
262-
}
263-
264-
// composer
265-
.reply-details .dropdown-select-box.composer-actions,
266-
.composer-fields {
267-
display: none;
268-
}
269242

270-
// hide user stuff
271-
.new-user-wrapper {
272-
.user-navigation {
273-
display: none;
243+
.topic-footer-main-buttons {
244+
justify-content: flex-end;
274245
}
275246
}
276247

277-
.user-main .about.collapsed-info .details {
278-
display: none;
279-
}
280-
281-
.user-content {
282-
margin-top: 0;
283-
}
284-
285-
@media screen and (max-width: 600px) {
248+
@include viewport.until(sm) {
286249
.share-ai-conversation-button {
287250
.d-icon {
288251
margin: 0;
@@ -294,20 +257,6 @@ body.has-ai-conversations-sidebar {
294257
}
295258
}
296259

297-
.mobile-view {
298-
nav.post-controls .actions button.reply .d-icon {
299-
margin: 0;
300-
}
301-
302-
.search-dropdown {
303-
display: none;
304-
}
305-
306-
.sidebar-custom-sections {
307-
display: none;
308-
}
309-
}
310-
311260
// custom user card link
312261
.user-card-meta__profile-link {
313262
display: block;

0 commit comments

Comments
 (0)