Skip to content

Commit 0502d4b

Browse files
authored
AP-25499: Use the SkeletonItem component for K-AI
The bespoke skeleton animation used in loading messages for K-AI had a bit of a short animation cycle, leading to visual jumpiness. In this PR, we use the `SkeletonItem` component instead. + Very small styling adjustments in related areas to improve spacing a little bit.
1 parent 9c9a4d3 commit 0502d4b

File tree

3 files changed

+13
-29
lines changed

3 files changed

+13
-29
lines changed

org.knime.ui.js/src/components/kai/chat/message/KaiStatus.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ const props = defineProps<Props>();
3333
flex-direction: row;
3434
align-items: center;
3535
gap: 5px;
36+
padding-top: var(--space-12);
3637
3738
& svg.loading-icon {
3839
animation: rotate-animation 2s linear infinite;

org.knime.ui.js/src/components/kai/chat/message/Message.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ const displayContent = computed(() => {
158158
& .body {
159159
border-radius: 0 5px 5px;
160160
background-color: var(--knime-white);
161-
padding: 10px 8px;
161+
padding: var(--space-12);
162162
163163
&.user {
164164
border-radius: 5px 0 5px 5px;
Lines changed: 11 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,18 @@
1+
<script setup lang="ts">
2+
import { SkeletonItem } from "@knime/components";
3+
</script>
4+
15
<template>
2-
<div>
3-
<div class="animation" />
4-
<div class="animation" />
6+
<div class="skeleton-container">
7+
<SkeletonItem width="80%" height="16px" />
8+
<SkeletonItem width="100%" height="16px" />
59
</div>
610
</template>
711

812
<style lang="postcss" scoped>
9-
@import url("@/assets/mixins.css");
10-
11-
@keyframes rotate-animation {
12-
0% {
13-
transform: rotate(360deg);
14-
}
15-
16-
100% {
17-
transform: rotate(0deg);
18-
}
19-
}
20-
21-
& .animation {
22-
display: inline-block;
23-
width: 100%;
24-
height: 18px;
25-
background: linear-gradient(
26-
to right,
27-
var(--knime-porcelain) 0%,
28-
var(--knime-silver-sand-semi) 25%,
29-
var(--knime-porcelain) 50%
30-
);
31-
background-size: 200px 20px;
32-
background-position: -50px 0;
33-
animation: knight-rider 2s linear infinite;
13+
.skeleton-container {
14+
display: flex;
15+
flex-direction: column;
16+
gap: var(--space-8);
3417
}
3518
</style>

0 commit comments

Comments
 (0)