DEV: Update linting (#1191)

This commit is contained in:
Jarek Radosz 2025-03-13 14:25:38 +01:00 committed by GitHub
parent 6aaf8a0619
commit ec8018333e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
24 changed files with 1083 additions and 414 deletions

View File

@ -1,79 +1,93 @@
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
activesupport (7.1.3.4) activesupport (8.0.2)
base64 base64
benchmark (>= 0.3)
bigdecimal bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2) concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5) connection_pool (>= 2.2.5)
drb drb
i18n (>= 1.6, < 2) i18n (>= 1.6, < 2)
logger (>= 1.4.2)
minitest (>= 5.1) minitest (>= 5.1)
mutex_m securerandom (>= 0.3)
tzinfo (~> 2.0) tzinfo (~> 2.0, >= 2.0.5)
uri (>= 0.13.1)
ast (2.4.2) ast (2.4.2)
base64 (0.2.0) base64 (0.2.0)
bigdecimal (3.1.8) benchmark (0.4.0)
concurrent-ruby (1.3.3) bigdecimal (3.1.9)
connection_pool (2.4.1) concurrent-ruby (1.3.5)
connection_pool (2.5.0)
drb (2.2.1) drb (2.2.1)
i18n (1.14.5) i18n (1.14.7)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
json (2.7.2) json (2.10.2)
language_server-protocol (3.17.0.3) language_server-protocol (3.17.0.4)
minitest (5.24.1) lint_roller (1.1.0)
mutex_m (0.2.0) logger (1.6.6)
parallel (1.25.1) minitest (5.25.5)
parser (3.3.3.0) parallel (1.26.3)
parser (3.3.7.1)
ast (~> 2.4.1) ast (~> 2.4.1)
racc racc
prettier_print (1.2.1) prettier_print (1.2.1)
racc (1.8.0) racc (1.8.1)
rack (3.1.12) rack (3.1.12)
rainbow (3.1.1) rainbow (3.1.1)
regexp_parser (2.9.2) regexp_parser (2.10.0)
rexml (3.3.9) rubocop (1.74.0)
rubocop (1.64.1)
json (~> 2.3) json (~> 2.3)
language_server-protocol (>= 3.17.0) language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
parallel (~> 1.10) parallel (~> 1.10)
parser (>= 3.3.0.2) parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0) rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0) regexp_parser (>= 2.9.3, < 3.0)
rexml (>= 3.2.5, < 4.0) rubocop-ast (>= 1.38.0, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (~> 1.7) ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0) unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.31.3) rubocop-ast (1.38.1)
parser (>= 3.3.1.0) parser (>= 3.3.1.0)
rubocop-capybara (2.21.0) rubocop-capybara (2.22.1)
rubocop (~> 1.41) lint_roller (~> 1.1)
rubocop-discourse (3.8.1) rubocop (~> 1.72, >= 1.72.1)
rubocop-discourse (3.12.1)
activesupport (>= 6.1) activesupport (>= 6.1)
rubocop (>= 1.59.0) lint_roller (>= 1.1.0)
rubocop-capybara (>= 2.0.0) rubocop (>= 1.73.2)
rubocop-factory_bot (>= 2.0.0) rubocop-capybara (>= 2.22.0)
rubocop-rails (>= 2.25.0) rubocop-factory_bot (>= 2.27.0)
rubocop-rails (>= 2.30.3)
rubocop-rspec (>= 3.0.1) rubocop-rspec (>= 3.0.1)
rubocop-rspec_rails (>= 2.30.0) rubocop-rspec_rails (>= 2.31.0)
rubocop-factory_bot (2.26.1) rubocop-factory_bot (2.27.1)
rubocop (~> 1.61) lint_roller (~> 1.1)
rubocop-rails (2.25.1) rubocop (~> 1.72, >= 1.72.1)
rubocop-rails (2.30.3)
activesupport (>= 4.2.0) activesupport (>= 4.2.0)
lint_roller (~> 1.1)
rack (>= 1.1) rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0) rubocop (>= 1.72.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0) rubocop-ast (>= 1.38.0, < 2.0)
rubocop-rspec (3.0.2) rubocop-rspec (3.5.0)
rubocop (~> 1.61) lint_roller (~> 1.1)
rubocop-rspec_rails (2.30.0) rubocop (~> 1.72, >= 1.72.1)
rubocop (~> 1.61) rubocop-rspec_rails (2.31.0)
rubocop-rspec (~> 3, >= 3.0.1) lint_roller (~> 1.1)
rubocop (~> 1.72, >= 1.72.1)
rubocop-rspec (~> 3.5)
ruby-progressbar (1.13.0) ruby-progressbar (1.13.0)
securerandom (0.4.1)
syntax_tree (6.2.0) syntax_tree (6.2.0)
prettier_print (>= 1.2.0) prettier_print (>= 1.2.0)
tzinfo (2.0.6) tzinfo (2.0.6)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
unicode-display_width (2.5.0) unicode-display_width (3.1.4)
unicode-emoji (~> 4.0, >= 4.0.4)
unicode-emoji (4.0.4)
uri (1.0.3)
PLATFORMS PLATFORMS
ruby ruby
@ -83,4 +97,4 @@ DEPENDENCIES
syntax_tree syntax_tree
BUNDLED WITH BUNDLED WITH
2.5.10 2.6.5

View File

@ -13,6 +13,7 @@
height: 1em; height: 1em;
opacity: 0; opacity: 0;
display: block; display: block;
&:nth-child(1) { &:nth-child(1) {
width: 10%; width: 10%;
} }
@ -92,15 +93,19 @@
&:nth-child(20) { &:nth-child(20) {
width: 25%; width: 25%;
} }
&.is-shown { &.is-shown {
opacity: 1; opacity: 1;
} }
&.show { &.show {
animation: appear 0.5s cubic-bezier(0.445, 0.05, 0.55, 0.95) 0s forwards; animation: appear 0.5s cubic-bezier(0.445, 0.05, 0.55, 0.95) 0s forwards;
@media (prefers-reduced-motion) { @media (prefers-reduced-motion) {
animation-duration: 0s; animation-duration: 0s;
} }
} }
@media (prefers-reduced-motion: no-preference) { @media (prefers-reduced-motion: no-preference) {
&.blink { &.blink {
animation: blink 0.5s cubic-bezier(0.55, 0.085, 0.68, 0.53) both; animation: blink 0.5s cubic-bezier(0.55, 0.085, 0.68, 0.53) both;
@ -112,6 +117,7 @@
0% { 0% {
opacity: 0; opacity: 0;
} }
100% { 100% {
opacity: 1; opacity: 1;
} }
@ -121,9 +127,11 @@
0% { 0% {
opacity: 1; opacity: 1;
} }
50% { 50% {
opacity: 0.5; opacity: 0.5;
} }
100% { 100% {
opacity: 1; opacity: 1;
} }

View File

@ -3,6 +3,7 @@
100% { 100% {
opacity: 0; opacity: 0;
} }
50% { 50% {
opacity: 1; opacity: 1;
} }
@ -10,8 +11,8 @@
@mixin progress-dot { @mixin progress-dot {
content: "\25CF"; content: "\25CF";
font-family: Söhne Circle, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, font-family: "Söhne Circle", system-ui, -apple-system, "Segoe UI", Roboto,
Cantarell, Noto Sans, sans-serif; Ubuntu, Cantarell, "Noto Sans", sans-serif;
line-height: normal; line-height: normal;
margin-left: 0.25rem; margin-left: 0.25rem;
vertical-align: baseline; vertical-align: baseline;
@ -44,6 +45,7 @@ article.streaming .cooked {
100% { 100% {
transform: initial; transform: initial;
} }
30% { 30% {
transform: translateY(-0.2em); transform: translateY(-0.2em);
} }
@ -55,12 +57,15 @@ article.streaming .cooked {
&__dot { &__dot {
display: inline-block; display: inline-block;
@media (prefers-reduced-motion: no-preference) { @media (prefers-reduced-motion: no-preference) {
animation: ai-indicator-wave 1.8s linear infinite; animation: ai-indicator-wave 1.8s linear infinite;
} }
&:nth-child(2) { &:nth-child(2) {
animation-delay: -1.6s; animation-delay: -1.6s;
} }
&:nth-child(3) { &:nth-child(3) {
animation-delay: -1.4s; animation-delay: -1.4s;
} }

View File

@ -38,6 +38,7 @@ html.ai-artifact-expanded {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
.ai-artifact__expand-button { .ai-artifact__expand-button {
margin-left: auto; margin-left: auto;
} }
@ -70,14 +71,17 @@ html.ai-artifact-expanded {
background-color: var(--secondary-low); background-color: var(--secondary-low);
opacity: 0.9; opacity: 0.9;
transform: translateY(0); transform: translateY(0);
button { button {
width: 100%; width: 100%;
text-align: left; text-align: left;
box-sizing: border-box; box-sizing: border-box;
justify-content: flex-start; justify-content: flex-start;
color: var(--secondary-very-high); color: var(--secondary-very-high);
&:hover { &:hover {
color: var(--secondary-very-high); color: var(--secondary-very-high);
.d-icon { .d-icon {
color: var(--secondary-high); color: var(--secondary-high);
} }
@ -95,7 +99,6 @@ html.ai-artifact-expanded {
bottom: 0; bottom: 0;
z-index: z("fullscreen"); z-index: z("fullscreen");
} }
position: fixed; position: fixed;
top: 0; top: 0;
left: 0; left: 0;

View File

@ -2,6 +2,7 @@
from { from {
opacity: 0; opacity: 0;
} }
to { to {
opacity: 1; opacity: 1;
} }

View File

@ -46,21 +46,26 @@
padding-left: 0.25em; padding-left: 0.25em;
color: var(--primary-medium); color: var(--primary-medium);
} }
label { label {
display: block; display: block;
} }
&__tool-options { &__tool-options {
padding: 5px 10px 5px; padding: 5px 10px 5px;
border: 1px solid var(--primary-low-mid); border: 1px solid var(--primary-low-mid);
width: 480px; width: 480px;
} }
&__tool-options-name { &__tool-options-name {
margin-bottom: 10px; margin-bottom: 10px;
font-size: var(--font-down-1); font-size: var(--font-down-1);
} }
&__description { &__description {
width: 500px; width: 500px;
} }
&__system_prompt { &__system_prompt {
width: 500px; width: 500px;
height: 400px; height: 400px;
@ -101,7 +106,7 @@
&:focus, &:focus,
&:focus-within { &:focus-within {
@include default-focus(); @include default-focus;
} }
&-container { &-container {

View File

@ -40,6 +40,7 @@
.ai-tool-editor { .ai-tool-editor {
max-width: 80%; max-width: 80%;
position: relative; position: relative;
.ace-wrapper { .ace-wrapper {
border: 1px solid var(--primary-low); border: 1px solid var(--primary-low);
max-width: 100%; max-width: 100%;
@ -47,6 +48,7 @@
width: 100%; width: 100%;
height: 100%; height: 100%;
min-height: 500px; min-height: 500px;
.ace_editor { .ace_editor {
position: absolute; position: absolute;
left: 0; left: 0;

View File

@ -10,6 +10,7 @@ nav.post-controls .actions button.cancel-streaming {
display: none; display: none;
} }
} }
.persona-llm-selector { .persona-llm-selector {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
@ -26,6 +27,7 @@ nav.post-controls .actions button.cancel-streaming {
.gpt-persona { .gpt-persona {
margin-bottom: 5px; margin-bottom: 5px;
} }
#reply-control .composer-fields { #reply-control .composer-fields {
.mini-tag-chooser, .mini-tag-chooser,
.add-warning { .add-warning {
@ -39,6 +41,7 @@ nav.post-controls .actions button.cancel-streaming {
background-color: var(--tertiary-low); background-color: var(--tertiary-low);
border-top: 1px solid var(--tertiary-medium); border-top: 1px solid var(--tertiary-medium);
opacity: 0.75; opacity: 0.75;
.d-icon { .d-icon {
color: var(--tertiary); color: var(--tertiary);
} }
@ -60,10 +63,12 @@ article.streaming nav.post-controls .actions button.cancel-streaming {
width: 100%; width: 100%;
min-width: 320px; min-width: 320px;
padding: 0.5em; padding: 0.5em;
.d-button-label { .d-button-label {
flex: 1; flex: 1;
text-align: left; text-align: left;
} }
&:hover { &:hover {
background: var(--primary-low); background: var(--primary-low);
} }
@ -81,9 +86,11 @@ details.ai-quote {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
span:first-child { span:first-child {
margin-right: auto; margin-right: auto;
} }
span:nth-child(2) { span:nth-child(2) {
font-size: var(--font-down-2); font-size: var(--font-down-2);
background: var(--primary-medium); background: var(--primary-medium);
@ -97,10 +104,12 @@ details.ai-quote {
.d-modal__footer { .d-modal__footer {
position: relative; position: relative;
padding: 10px 20px 25px; padding: 10px 20px 25px;
.btn-primary { .btn-primary {
margin-left: auto; margin-left: auto;
} }
} }
&__just-copied { &__just-copied {
position: absolute; position: absolute;
font-size: var(--font-down-1); font-size: var(--font-down-1);
@ -116,6 +125,7 @@ span.onebox-ai-llm-title {
.d-modal.ai-debug-modal { .d-modal.ai-debug-modal {
--modal-max-width: 99%; --modal-max-width: 99%;
ul { ul {
padding-left: 1em; padding-left: 1em;
} }

View File

@ -5,6 +5,7 @@
background-color: var(--success-low); background-color: var(--success-low);
text-decoration: underline; text-decoration: underline;
} }
del { del {
background-color: var(--danger-low); background-color: var(--danger-low);
text-decoration: line-through; text-decoration: line-through;
@ -14,10 +15,12 @@
height: 200px; height: 200px;
} }
} }
@keyframes fadeOpacity { @keyframes fadeOpacity {
0% { 0% {
opacity: 1; opacity: 1;
} }
100% { 100% {
opacity: 0.5; opacity: 0.5;
} }
@ -96,9 +99,11 @@
0% { 0% {
color: var(--primary); color: var(--primary);
} }
50% { 50% {
color: var(--tertiary); color: var(--tertiary);
} }
100% { 100% {
color: var(--primary); color: var(--primary);
} }
@ -121,6 +126,7 @@
animation: dot-falling 1s infinite linear; animation: dot-falling 1s infinite linear;
animation-delay: 0.1s; animation-delay: 0.1s;
} }
.dot-falling::before, .dot-falling::before,
.dot-falling::after { .dot-falling::after {
content: ""; content: "";
@ -128,6 +134,7 @@
position: absolute; position: absolute;
top: 0; top: 0;
} }
.dot-falling::before { .dot-falling::before {
width: 10px; width: 10px;
height: 10px; height: 10px;
@ -137,6 +144,7 @@
animation: dot-falling-before 1s infinite linear; animation: dot-falling-before 1s infinite linear;
animation-delay: 0s; animation-delay: 0s;
} }
.dot-falling::after { .dot-falling::after {
width: 10px; width: 10px;
height: 10px; height: 10px;
@ -151,44 +159,51 @@
0% { 0% {
box-shadow: 9999px -15px 0 0 rgba(152, 128, 255, 0); box-shadow: 9999px -15px 0 0 rgba(152, 128, 255, 0);
} }
25%, 25%,
50%, 50%,
75% { 75% {
box-shadow: 9999px 0 0 0 var(--tertiary); box-shadow: 9999px 0 0 0 var(--tertiary);
} }
100% { 100% {
box-shadow: 9999px 15px 0 0 rgba(152, 128, 255, 0); box-shadow: 9999px 15px 0 0 rgba(152, 128, 255, 0);
} }
} }
@keyframes dot-falling-before { @keyframes dot-falling-before {
0% { 0% {
box-shadow: 9984px -15px 0 0 rgba(152, 128, 255, 0); box-shadow: 9984px -15px 0 0 rgba(152, 128, 255, 0);
} }
25%, 25%,
50%, 50%,
75% { 75% {
box-shadow: 9984px 0 0 0 var(--tertiary); box-shadow: 9984px 0 0 0 var(--tertiary);
} }
100% { 100% {
box-shadow: 9984px 15px 0 0 rgba(152, 128, 255, 0); box-shadow: 9984px 15px 0 0 rgba(152, 128, 255, 0);
} }
} }
@keyframes dot-falling-after { @keyframes dot-falling-after {
0% { 0% {
box-shadow: 10014px -15px 0 0 rgba(152, 128, 255, 0); box-shadow: 10014px -15px 0 0 rgba(152, 128, 255, 0);
} }
25%, 25%,
50%, 50%,
75% { 75% {
box-shadow: 10014px 0 0 0 var(--tertiary); box-shadow: 10014px 0 0 0 var(--tertiary);
} }
100% { 100% {
box-shadow: 10014px 15px 0 0 rgba(152, 128, 255, 0); box-shadow: 10014px 15px 0 0 rgba(152, 128, 255, 0);
} }
} }
// Suggest Titles Related // Suggest Titles Related
.showing-ai-suggestions { .showing-ai-suggestions {
.title-input { .title-input {
// border on focus should be on top of suggestion button // border on focus should be on top of suggestion button
@ -229,6 +244,7 @@
.select-kit.is-expanded { .select-kit.is-expanded {
// need to raise the z-index so the sibling input buttons don't cover the dropdown // need to raise the z-index so the sibling input buttons don't cover the dropdown
z-index: z("dropdown") + 1; z-index: z("dropdown") + 1;
+ button { + button {
z-index: z("dropdown") + 1; z-index: z("dropdown") + 1;
} }
@ -267,6 +283,40 @@
// while also keeping them below the composer tips // while also keeping them below the composer tips
z-index: z("composer", "dropdown") + 2; z-index: z("composer", "dropdown") + 2;
} }
.with-category .showing-ai-suggestions .category-input {
flex-wrap: nowrap;
max-width: calc(50% - 0.2em);
.category-chooser {
min-width: 0;
flex: 1 1 auto;
}
}
.with-category:not(.with-tags) {
// when tagging is disabled
.showing-ai-suggestions .category-input {
max-width: 40%;
}
}
.with-tags {
.showing-ai-suggestions .tags-input {
display: flex;
max-width: calc(50% - 0.2em);
.mini-tag-chooser {
min-width: 0;
}
}
}
.showing-ai-suggestions {
#reply-title {
padding-right: 2em;
}
}
} }
.ai-category-suggester-content, .ai-category-suggester-content,
@ -333,41 +383,6 @@
} }
} }
// Prevent suggestion button from wrapping
#reply-control {
.with-category .showing-ai-suggestions .category-input {
flex-wrap: nowrap;
max-width: calc(50% - 0.2em);
.category-chooser {
min-width: 0;
flex: 1 1 auto;
}
}
.with-category:not(.with-tags) {
// when tagging is disabled
.showing-ai-suggestions .category-input {
max-width: 40%;
}
}
.with-tags {
.showing-ai-suggestions .tags-input {
display: flex;
max-width: calc(50% - 0.2em);
.mini-tag-chooser {
min-width: 0;
}
}
}
.showing-ai-suggestions {
#reply-title {
padding-right: 2em;
}
}
}
.suggest-tags-button + .ai-suggestions-menu { .suggest-tags-button + .ai-suggestions-menu {
top: 4.25rem; top: 4.25rem;
} }
@ -376,6 +391,7 @@
0% { 0% {
transform: rotate(0deg); transform: rotate(0deg);
} }
100% { 100% {
transform: rotate(359deg); transform: rotate(359deg);
} }
@ -410,6 +426,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
gap: 0.5rem; gap: 0.5rem;
.btn { .btn {
flex-grow: 1; flex-grow: 1;
padding-inline: 0; padding-inline: 0;
@ -453,7 +470,6 @@
.ai-split-topic-suggestion__results { .ai-split-topic-suggestion__results {
list-style: none; list-style: none;
margin-left: 0;
margin: 0; margin: 0;
.btn { .btn {
@ -542,6 +558,7 @@
left: 0.35rem; left: 0.35rem;
padding: 0.33em 0.75em; padding: 0.33em 0.75em;
transition: all 0.25s ease; transition: all 0.25s ease;
.discourse-no-touch & { .discourse-no-touch & {
display: none; display: none;
} }
@ -568,6 +585,7 @@
} }
} }
} }
.discourse-no-touch & { .discourse-no-touch & {
&:hover { &:hover {
.button-wrapper .generate-caption { .button-wrapper .generate-caption {
@ -597,6 +615,7 @@
min-height: 3em; min-height: 3em;
height: 7em; height: 7em;
min-width: var(--ai-caption-popup-min-width); min-width: var(--ai-caption-popup-min-width);
@include breakpoint(tablet) { @include breakpoint(tablet) {
width: 100%; width: 100%;
max-width: unset; max-width: unset;
@ -613,6 +632,7 @@
font-size: var(--font-down-1); font-size: var(--font-down-1);
margin-left: auto; margin-left: auto;
color: var(--tertiary); color: var(--tertiary);
.desktop-view & { .desktop-view & {
// a little extra space for extra narrow desktop view // a little extra space for extra narrow desktop view
@media screen and (max-width: 675px) { @media screen and (max-width: 675px) {

View File

@ -47,9 +47,11 @@
.category-chooser { .category-chooser {
flex: 1 1 90%; flex: 1 1 90%;
} }
.ai-category-suggester-trigger { .ai-category-suggester-trigger {
padding: 0.425em; padding: 0.425em;
} }
.ai-tag-suggester-trigger { .ai-tag-suggester-trigger {
padding: 0.45em; padding: 0.45em;
} }
@ -60,10 +62,12 @@
padding-top: 0.4em; padding-top: 0.4em;
padding-bottom: 0.4em; padding-bottom: 0.4em;
} }
&.ai-category-suggester-trigger { &.ai-category-suggester-trigger {
padding-top: 0.4em; padding-top: 0.4em;
padding-bottom: 0.25em; padding-bottom: 0.25em;
} }
&.ai-tag-suggester-trigger { &.ai-tag-suggester-trigger {
padding-top: 0.4em; padding-top: 0.4em;
padding-bottom: 0.3em; padding-bottom: 0.3em;

View File

@ -15,6 +15,7 @@
&__searching { &__searching {
display: flex; display: flex;
align-items: center; align-items: center;
margin-left: 5px;
&.in-progress, &.in-progress,
&.unavailable { &.unavailable {
@ -33,14 +34,10 @@
margin-left: 4px; margin-left: 4px;
font-size: var(--font-down-1); font-size: var(--font-down-1);
} }
}
.semantic-search__entries { &__entries {
margin-top: 10px; margin-top: 10px;
} }
.semantic-search__searching {
margin-left: 5px;
} }
} }
} }

View File

@ -9,6 +9,10 @@
&__configured, &__configured,
&__templates { &__templates {
margin-top: 2em; margin-top: 2em;
h2 {
font-size: var(--font-up-1);
}
} }
} }
@ -34,13 +38,6 @@
} }
} }
.ai-llms-list-editor__configured,
.ai-llms-list-editor__templates {
h2 {
font-size: var(--font-up-1);
}
}
.ai-llms-list-editor__configured { .ai-llms-list-editor__configured {
.d-toggle-switch { .d-toggle-switch {
justify-content: center; justify-content: center;
@ -54,15 +51,14 @@
tr:hover { tr:hover {
background: inherit; background: inherit;
} }
@include breakpoint("tablet", min-width) { @include breakpoint("tablet", min-width) {
th, th,
td { td {
&:first-child { &:first-child {
padding-left: 0; padding-left: 0;
} }
}
th,
td {
&:last-child { &:last-child {
padding-right: 0; padding-right: 0;
} }
@ -80,12 +76,14 @@
padding-top: 1em; padding-top: 1em;
border-top: 3px solid var(--primary-low); border-top: 3px solid var(--primary-low);
} }
&-list-item { &-list-item {
display: grid; display: grid;
grid-template-rows: subgrid; grid-template-rows: subgrid;
grid-row: span 4; grid-row: span 4;
gap: 0; gap: 0;
margin-bottom: 2em; margin-bottom: 2em;
@include breakpoint("mobile-extra-large", min-width) { @include breakpoint("mobile-extra-large", min-width) {
margin-bottom: 3em; margin-bottom: 3em;
} }
@ -96,6 +94,7 @@
margin: 0.25em 0 0.5em; margin: 0.25em 0 0.5em;
line-height: var(--line-height-large); line-height: var(--line-height-large);
align-self: start; align-self: start;
@include breakpoint("mobile-extra-large", min-width) { @include breakpoint("mobile-extra-large", min-width) {
max-width: 17em; max-width: 17em;
} }
@ -118,6 +117,7 @@
list-style: none; list-style: none;
margin: 0.5em 0 0 0; margin: 0.5em 0 0 0;
display: flex; display: flex;
li { li {
font-size: var(--font-down-2); font-size: var(--font-down-2);
border-radius: 0.25em; border-radius: 0.25em;

View File

@ -2,7 +2,6 @@
--chart-response-color: rgba(75, 192, 192, 0.8); --chart-response-color: rgba(75, 192, 192, 0.8);
--chart-request-color: rgba(153, 102, 255, 0.8); --chart-request-color: rgba(153, 102, 255, 0.8);
--chart-cached-color: rgba(153, 102, 255, 0.4); --chart-cached-color: rgba(153, 102, 255, 0.4);
padding: 1em; padding: 1em;
&__filters-dates { &__filters-dates {

View File

@ -4,6 +4,7 @@
grid-template-columns: repeat(12, 1fr); grid-template-columns: repeat(12, 1fr);
grid-column-gap: 1em; grid-column-gap: 1em;
grid-row-gap: 1em; grid-row-gap: 1em;
.admin-report { .admin-report {
grid-column: span 12; grid-column: span 12;
} }
@ -22,7 +23,7 @@
gap: 1rem; gap: 1rem;
.filters { .filters {
@include report-container-box(); @include report-container-box;
order: 1; order: 1;
width: 100%; width: 100%;
margin-left: 0; margin-left: 0;
@ -46,9 +47,6 @@
.control:last-child { .control:last-child {
align-self: flex-end; align-self: flex-end;
input {
}
} }
.control:has(.export-csv-btn) { .control:has(.export-csv-btn) {
@ -67,7 +65,7 @@
} }
.admin-report-sentiment-analysis { .admin-report-sentiment-analysis {
@include report-container-box(); @include report-container-box;
flex: 2; flex: 2;
display: flex; display: flex;
gap: 2rem 1rem; gap: 2rem 1rem;
@ -138,7 +136,7 @@
} }
.admin-report-sentiment-analysis-details { .admin-report-sentiment-analysis-details {
@include report-container-box(); @include report-container-box;
flex: 1 1 300px; flex: 1 1 300px;
min-width: 300px; min-width: 300px;
margin-left: 1rem; margin-left: 1rem;
@ -191,6 +189,7 @@
padding: 0.25rem; padding: 0.25rem;
font-size: var(--font-down-1); font-size: var(--font-down-1);
display: inline-block; display: inline-block;
&[data-sentiment-score="positive"] { &[data-sentiment-score="positive"] {
color: rgb(var(--d-sentiment-report-positive-rgb)); color: rgb(var(--d-sentiment-report-positive-rgb));
background: rgba(var(--d-sentiment-report-positive-rgb), 0.1); background: rgba(var(--d-sentiment-report-positive-rgb), 0.1);
@ -209,6 +208,7 @@
&__post-list { &__post-list {
margin-top: 1rem; margin-top: 1rem;
.avatar-wrapper, .avatar-wrapper,
.avatar-link { .avatar-link {
width: calc(48px * 0.75); width: calc(48px * 0.75);
@ -241,6 +241,7 @@
.control:first-of-type { .control:first-of-type {
flex: unset; flex: unset;
} }
.control:nth-of-type(n + 2):nth-of-type(-n + 6) { .control:nth-of-type(n + 2):nth-of-type(-n + 6) {
display: none; display: none;
} }

View File

@ -4,6 +4,7 @@
grid-template-areas: "icon title" "icon description"; grid-template-areas: "icon title" "icon description";
grid-template-columns: auto 1fr; grid-template-columns: auto 1fr;
text-align: left; text-align: left;
.btn__description { .btn__description {
grid-area: description; grid-area: description;
width: 100%; width: 100%;
@ -34,22 +35,26 @@
margin-top: 0.25em; margin-top: 0.25em;
line-height: var(--line-height-medium); line-height: var(--line-height-medium);
} }
.excerpt { .excerpt {
width: 100%; width: 100%;
line-height: var(--line-height-large); line-height: var(--line-height-large);
margin-top: 0.15em; margin-top: 0.15em;
margin-bottom: 0.15em; margin-bottom: 0.15em;
&__contents { &__contents {
max-width: 70ch; max-width: 70ch;
overflow-wrap: break-word; overflow-wrap: break-word;
} }
} }
&:not(.visited) { &:not(.visited) {
.excerpt { .excerpt {
color: var(--primary-high); color: var(--primary-high);
} }
} }
} }
.topic-excerpt { .topic-excerpt {
display: none; display: none;
} }

View File

@ -6,6 +6,7 @@
margin: 0; margin: 0;
height: 1.2em; height: 1.2em;
} }
.d-button-label { .d-button-label {
display: none; display: none;
} }
@ -19,6 +20,7 @@
margin: 0; margin: 0;
height: 1.2em; height: 1.2em;
} }
.d-button-label { .d-button-label {
display: none; display: none;
} }
@ -53,9 +55,11 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: flex-end; align-items: flex-end;
button { button {
margin-top: 0.5em; margin-top: 0.5em;
} }
p { p {
color: var(--primary-medium); color: var(--primary-medium);
} }
@ -66,6 +70,7 @@
gap: 0; gap: 0;
grid-template-areas: "summarized regenerate" " outdated regenerate"; grid-template-areas: "summarized regenerate" " outdated regenerate";
grid-template-columns: 1fr auto; grid-template-columns: 1fr auto;
@include breakpoint(mobile-large) { @include breakpoint(mobile-large) {
gap: 0.25em 0.5em; gap: 0.25em 0.5em;
grid-template-areas: "summarized summarized" "regenerate outdated"; grid-template-areas: "summarized summarized" "regenerate outdated";

View File

@ -13,7 +13,6 @@ html.scrollable-modal {
max-height: calc( max-height: calc(
100vh - var(--header-offset) - 3rem - var(--composer-height, 0px) 100vh - var(--header-offset) - 3rem - var(--composer-height, 0px)
); );
box-shadow: var(--shadow-menu-panel); box-shadow: var(--shadow-menu-panel);
} }

View File

@ -147,9 +147,13 @@ class MoveEmbeddingsToSingleTablePerType < ActiveRecord::Migration[7.0]
SQL SQL
begin begin
vector_rep = DiscourseAi::Embeddings::VectorRepresentations::Base.current_representation DiscourseAi::Embeddings::VectorRepresentations::Base.current_representation
rescue StandardError => e rescue StandardError => e
Rails.logger.error("Failed to index embeddings: #{e}") Rails.logger.error("Failed to index embeddings: #{e}")
end end
end end
def down
raise ActiveRecord::IrreversibleMigration
end
end end

View File

@ -27,4 +27,8 @@ class DropOldEmbeddingsTables < ActiveRecord::Migration[7.0]
drop_table :ai_document_fragment_embeddings_7_1 drop_table :ai_document_fragment_embeddings_7_1
drop_table :ai_document_fragment_embeddings_8_1 drop_table :ai_document_fragment_embeddings_8_1
end end
def down
raise ActiveRecord::IrreversibleMigration
end
end end

View File

@ -7,7 +7,7 @@ class MigrateSentimentClassificationResultFormat < ActiveRecord::Migration[7.1]
model_used = 'cardiffnlp/twitter-roberta-base-sentiment-latest', model_used = 'cardiffnlp/twitter-roberta-base-sentiment-latest',
classification = jsonb_build_object( classification = jsonb_build_object(
'neutral', (classification->>'neutral')::float / 100, 'neutral', (classification->>'neutral')::float / 100,
'negative', (classification->>'negative')::float / 100, 'negative', (classification->>'negative')::float / 100,
'positive', (classification->>'positive')::float / 100 'positive', (classification->>'positive')::float / 100
) )
WHERE model_used = 'sentiment'; WHERE model_used = 'sentiment';
@ -17,7 +17,7 @@ class MigrateSentimentClassificationResultFormat < ActiveRecord::Migration[7.1]
model_used = 'j-hartmann/emotion-english-distilroberta-base', model_used = 'j-hartmann/emotion-english-distilroberta-base',
classification = jsonb_build_object( classification = jsonb_build_object(
'sadness', (classification->>'sadness')::float / 100, 'sadness', (classification->>'sadness')::float / 100,
'surprise', (classification->>'surprise')::float / 100, 'surprise', (classification->>'surprise')::float / 100,
'fear', (classification->>'fear')::float / 100, 'fear', (classification->>'fear')::float / 100,
'anger', (classification->>'anger')::float / 100, 'anger', (classification->>'anger')::float / 100,
'joy', (classification->>'joy')::float / 100, 'joy', (classification->>'joy')::float / 100,
@ -27,4 +27,8 @@ class MigrateSentimentClassificationResultFormat < ActiveRecord::Migration[7.1]
WHERE model_used = 'emotion'; WHERE model_used = 'emotion';
SQL SQL
end end
def down
raise ActiveRecord::IrreversibleMigration
end
end end

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
class DropAiSummariesContentRange < ActiveRecord::Migration[7.2] class DropAiSummariesContentRange < ActiveRecord::Migration[7.2]
DROPPED_COLUMNS ||= { ai_summaries: %i[content_range] } DROPPED_COLUMNS = { ai_summaries: %i[content_range] }
def up def up
DROPPED_COLUMNS.each { |table, columns| Migration::ColumnDropper.execute_drop(table, columns) } DROPPED_COLUMNS.each { |table, columns| Migration::ColumnDropper.execute_drop(table, columns) }

View File

@ -1,10 +1,11 @@
{ {
"private": true, "private": true,
"devDependencies": { "devDependencies": {
"@discourse/lint-configs": "2.4.0", "@discourse/lint-configs": "2.7.0",
"ember-template-lint": "6.1.0", "ember-template-lint": "6.1.0",
"eslint": "9.19.0", "eslint": "9.20.1",
"prettier": "2.8.8" "prettier": "2.8.8",
"stylelint": "16.14.1"
}, },
"engines": { "engines": {
"node": ">= 22", "node": ">= 22",

1169
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

3
stylelint.config.mjs Normal file
View File

@ -0,0 +1,3 @@
export default {
extends: ["@discourse/lint-configs/stylelint"],
};