DEV: Decorate boosted and AI results

This commit is contained in:
Keegan George 2023-11-27 11:01:14 -08:00
parent 775610b1c2
commit e7a3a50d86
No known key found for this signature in database
GPG Key ID: 91B40E38537AC000
3 changed files with 23 additions and 7 deletions

View File

@ -5,6 +5,11 @@ export default class SearchResultDecoration extends Component {
<template>
<div class="ai-result__icon">
{{icon "discourse-sparkles"}}
<span>AI</span>
</div>
<div class="boosted-result__icon">
{{icon "rocket"}}
<span>Boosted</span>
</div>
</template>
}

View File

@ -4,6 +4,6 @@ export default apiInitializer("1.15.0", (api) => {
api.modifyClass("component:search-result-entry", {
pluginId: "discourse-ai",
classNameBindings: ["bulkSelectEnabled", "post.generatedByAI:ai-result"],
classNameBindings: ["bulkSelectEnabled", "post.generatedByAI:ai-result", "post.boosted:boosted-result"],
});
});

View File

@ -55,8 +55,13 @@
.fps-result {
padding: 0.5rem;
.ai-result__icon {
.ai-result__icon, .boosted-result__icon {
display: none;
position: absolute;
right: 0;
top: 0;
padding: 0.5em;
font-size: var(--font-down-1);
}
}
@ -64,11 +69,17 @@
border-radius: var(--d-border-radius);
.ai-result__icon {
display: inline;
margin-right: 0.5rem;
margin-left: auto;
font-size: var(--font-up-2);
display: block;
background: var(--tertiary-low);
color: var(--tertiary);
}
}
}
.boosted-result {
.boosted-result__icon {
display: block;
color: var(--success);
background: var(--success-low);
}
}
}