UX: minor adjustments to search bot (#1146)

This commit is contained in:
Kris 2025-02-21 19:40:53 -05:00 committed by GitHub
parent 09f4895302
commit 55dde0a9e6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 41 additions and 16 deletions

View File

@ -182,7 +182,7 @@ export default class AiSearchDiscoveries extends Component {
<CookText @rawText={{this.discobotDiscoveries.discovery}} />
</div>
{{else}}
<div class="ai-search-discoveries___discovery-preview cooked">
<div class="ai-search-discoveries__discovery-preview cooked">
<CookText
@rawText={{this.discobotDiscoveries.discoveryPreview}}
/>

View File

@ -25,7 +25,7 @@ export default class AiFullPageDiscobotDiscoveries extends Component {
class="ai-search-discoveries__discoveries-title full-page-discoveries"
>
<span>
{{icon "ai-bot"}}
{{icon "discobot"}}
{{i18n "discourse_ai.discobot_discoveries.main_title"}}
</span>

View File

@ -20,7 +20,7 @@ export default class AiDiscobotDiscoveries extends Component {
<div class="ai-discobot-discoveries">
<h3 class="ai-search-discoveries__discoveries-title">
<span>
{{icon "ai-bot"}}
{{icon "discobot"}}
{{i18n "discourse_ai.discobot_discoveries.main_title"}}
</span>
@ -51,7 +51,7 @@ export default class AiDiscobotDiscoveries extends Component {
<AiSearchDiscoveries />
<h3 class="ai-discobot-discoveries__regular-results-title">
<h3 class="ai-search-discoveries__regular-results-title">
{{icon "bars-staggered"}}
{{i18n "discourse_ai.discobot_discoveries.regular_results"}}
</h3>

View File

@ -4,18 +4,34 @@
}
&__completion {
margin: 1em 0;
margin: 0;
}
&__discovery-preview {
@include ellipsis;
max-height: 300px;
height: 3.5em; // roughly the loading skeleton height
overflow: hidden;
position: relative;
&::after {
content: "";
position: absolute;
display: block;
background: linear-gradient(rgba(255, 255, 255, 0), var(--secondary));
height: 50%;
width: 100%;
bottom: 0;
}
}
&__discoveries-title,
&__regular-results-title {
padding-bottom: 0.5em;
border-bottom: 1px solid var(--primary-low);
font-size: var(--font-0);
.d-icon {
color: var(--primary-high);
}
}
&__discoveries-title {
@ -27,6 +43,10 @@
padding-left: 0;
margin-bottom: 0.5em;
}
.cooked p:first-child {
margin-top: 0;
}
}
.ai-search-discoveries-tooltip {
@ -38,6 +58,10 @@
.fk-d-tooltip__trigger {
vertical-align: middle;
}
.d-icon {
color: var(--primary-medium);
}
}
.ai-discobot-discoveries {
@ -47,3 +71,9 @@
.full-page-discoveries {
padding: 1em 10%;
}
.d-icon-discobot {
// appears a little undersized next to other icons
height: 1.15em;
width: 1.15em;
}

View File

@ -134,7 +134,6 @@ after_initialize do
face-smile
face-meh
face-angry
ai-bot
]
plugin_icons.each { |icon| register_svg_icon(icon) }
end

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
<symbol id="ai-bot" viewBox="0 0 365 267">
<path d="M124.91 266.6H18.51c-4.8 0-9.5-1.9-13.1-5.4-3.6-3.6-5.6-8.4-5.4-13.4V131.1c.2-34.6 13.8-67.4 38.7-92.1 25.2-25.2 58.8-39 94.4-39h.4c35.4 0 68.5 13.9 93.3 39.2 17.1 17.5 29 39.3 34.5 63 3.6 15.5-4.4 31.4-19 37.8-10.4 4.6-49.2 19.7-121.4 27 3.2 8 11.5 16.6 33.2 21.1 21.2 4.4 45.9 3 62.3 2.1 7-.4 12-.7 15.5-.4 4.5.3 8.4 3 10.4 7.1 1.9 4 1.6 8.8-1 12.5-4.4 6.4-9.4 12.5-14.9 18-24.1 24.5-56.4 38.4-90.9 39.1h-10.5c0 .1-.1.1-.2.1h.1Zm-99.9-25h110c24.8-.5 48.3-9.5 67-25.5-15.7.5-35.2.3-53-3.4-41.6-8.7-52.8-32.3-54.9-50.7-.5-4.6.8-9.1 3.7-12.7s7.2-5.8 11.8-6.2c58.9-5.2 101.9-16.8 122.5-25.8 3.6-1.6 5.6-5.5 4.7-9.3-4.5-19.3-14.1-36.9-28-51.1-20-20.4-46.8-31.7-75.5-31.7h-.4c-29.1 0-56.3 11.3-76.8 31.7-20.1 20-31.2 46.5-31.2 74.4v110.3c-.1 0 0 0 0 0h.1Zm-7.2 0Zm-5.1-110.4Z" style="fill:#333"/>
<circle cx="121.71" cy="79.3" r="22.8" style="fill:#333"/>
<path d="M364.01 133.2c-.5-3.7-2.5-7-5.5-9.2s-6.7-3.2-10.4-2.6l-37.2 5.5c-3.7.5-7 2.5-9.2 5.5-2.2 3-3.2 6.7-2.6 10.4.7 4.7 3.7 8.7 8.1 10.7 1.8.8 3.8 1.2 5.7 1.2s1.4 0 2.1-.2l37.2-5.5c3.7-.5 7-2.5 9.2-5.5s3.2-6.7 2.6-10.4v.1ZM349.01 200.4l-51.2-25.9c-6.6-3.8-15.2-1.6-19 5-1.9 3.2-2.4 7-1.5 10.6s3.2 6.7 6.5 8.5l51.2 25.9c.9.5 1.8.9 2.8 1.2 1.4.4 2.8.6 4.2.6 4.9 0 9.5-2.5 12-6.9 3.9-6.7 1.7-15.3-5-19.2v.2Z" style="fill:#333"/>
</symbol>
</svg>

Before

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -23,4 +23,8 @@
<symbol id="discourse-negative-inner-product" viewBox="0 0 448 512">
<path d="M132.3 195.8c2.7 5.5.5 12.2-5 14.9L36 256.4l91.3 45.7c5.5 2.7 7.7 9.4 5 14.9s-9.4 7.7-14.9 5L6.2 266.4c-3.8-1.9-6.2-5.7-6.2-9.9s2.4-8.1 6.2-9.9L117.5 191c5.5-2.7 12.2-.5 14.9 5ZM315.7 317c-2.7-5.5-.5-12.2 5-14.9l91.3-45.7-91.3-45.7c-5.5-2.7-7.7-9.4-5-14.9s9.4-7.7 14.9-5l111.3 55.6c3.8 1.9 6.2 5.7 6.2 9.9s-2.4 8.1-6.2 9.9l-111.3 55.6c-5.5 2.7-12.2.5-14.9-5ZM211.9 187.6c5.2.9 8.8 5.8 7.9 11.1l-3 17.7h28.6l3.5-20.9c.9-5.2 5.8-8.8 11.1-7.9 5.2.9 8.8 5.8 7.9 11.1l-2.9 17.7h17.5c5.3 0 9.6 4.3 9.6 9.6s-4.3 9.6-9.6 9.6h-20.7l-6.4 38.5h17.5c5.3 0 9.6 4.3 9.6 9.6s-4.3 9.6-9.6 9.6h-20.7l-3.5 20.9c-.9 5.2-5.8 8.8-11.1 7.9s-8.8-5.8-7.9-11.1l3-17.7h-28.6l-3.5 20.9c-.9 5.2-5.8 8.8-11.1 7.9-5.2-.9-8.8-5.8-7.9-11.1l2.9-17.7H167c-5.3 0-9.6-4.3-9.6-9.6s4.3-9.6 9.6-9.6h20.7l6.4-38.5h-17.5c-5.3 0-9.6-4.3-9.6-9.6s4.3-9.6 9.6-9.6h20.7l3.5-20.9c.9-5.2 5.8-8.8 11.1-7.9Zm1.7 48-6.4 38.5h28.6l6.4-38.5h-28.6Z"/>
</symbol>
<symbol id="discobot" viewBox="0 0 512 512">
<path d="M175.61 481.26H26.03c-6.75 0-13.36-2.67-18.42-7.59-5.06-5.06-7.87-11.81-7.59-18.84V290.76C.3 242.12 19.42 196 54.43 161.28c35.43-35.43 82.67-54.83 132.71-54.83h.56c49.77 0 96.3 19.54 131.17 55.11a187.257 187.257 0 0 1 48.5 88.57c5.06 21.79-6.19 44.14-26.71 53.14-14.62 6.47-69.17 27.7-170.67 37.96 4.5 11.25 16.17 23.34 46.68 29.66 29.8 6.19 64.53 4.22 87.59 2.95 9.84-.56 16.87-.98 21.79-.56 6.33.42 11.81 4.22 14.62 9.98 2.67 5.62 2.25 12.37-1.41 17.57-6.19 9-13.22 17.57-20.95 25.31-33.88 34.44-79.29 53.99-127.79 54.97h-14.76c0 .14-.14.14-.28.14h.14ZM35.17 446.11h154.65c34.87-.7 67.9-13.36 94.19-35.85-22.07.7-49.49.42-74.51-4.78-58.48-12.23-74.23-45.41-77.18-71.28-.7-6.47 1.12-12.79 5.2-17.85s10.12-8.15 16.59-8.72c82.81-7.31 143.26-23.62 172.22-36.27 5.06-2.25 7.87-7.73 6.61-13.07-6.33-27.13-19.82-51.88-39.36-71.84-28.12-28.68-65.8-44.57-106.14-44.57h-.56c-40.91 0-79.15 15.89-107.97 44.57-28.26 28.12-43.86 65.37-43.86 104.6v155.07c-.14 0 0 0 0 0h.14Zm-10.13 0ZM17.87 290.9Z"/><circle cx="171.11" cy="217.94" r="32.05"/><path d="M511.76 293.71c-.7-5.2-3.51-9.84-7.73-12.93s-9.42-4.5-14.62-3.66l-52.3 7.73c-5.2.7-9.84 3.51-12.93 7.73-3.09 4.22-4.5 9.42-3.66 14.62.98 6.61 5.2 12.23 11.39 15.04 2.53 1.12 5.34 1.69 8.01 1.69s1.97 0 2.95-.28l52.3-7.73c5.2-.7 9.84-3.51 12.93-7.73s4.5-9.42 3.66-14.62v.14ZM490.67 388.19l-71.98-36.41c-9.28-5.34-21.37-2.25-26.71 7.03-2.67 4.5-3.37 9.84-2.11 14.9 1.27 5.06 4.5 9.42 9.14 11.95l71.98 36.41c1.27.7 2.53 1.27 3.94 1.69 1.97.56 3.94.84 5.9.84 6.89 0 13.36-3.51 16.87-9.7 5.48-9.42 2.39-21.51-7.03-26.99v.28Z"/>
</symbol>
</svg>

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB