Skip to content

Commit 47f8474

Browse files
authored
🔥 Fix highlight on bulk (#5698)
1 parent 004225d commit 47f8474

File tree

7 files changed

+21
-26
lines changed

7 files changed

+21
-26
lines changed

argilla-frontend/components/features/annotation/container/fields/RecordFields.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
>
1818
<SpanAnnotationTextField
1919
v-if="hasSpanQuestion(name)"
20-
:id="`${id}-${record.id}-span-field`"
20+
:id="`${id}-${record.id}`"
2121
:name="name"
2222
:title="title"
2323
:fieldText="content"
@@ -26,7 +26,7 @@
2626
/>
2727
<TextField
2828
v-else-if="isTextType"
29-
:name="name"
29+
:id="`${id}-${record.id}`"
3030
:title="title"
3131
:fieldText="content"
3232
:useMarkdown="settings.use_markdown"
@@ -35,7 +35,7 @@
3535
/>
3636
<ChatField
3737
v-else-if="isChatType"
38-
:name="name"
38+
:id="`${id}-${record.id}`"
3939
:title="title"
4040
:useMarkdown="settings.use_markdown"
4141
:content="content"

argilla-frontend/components/features/annotation/container/fields/chat-field/ChatField.vue

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div class="chat" :key="title">
33
<span class="chat__title" v-text="title" />
44
<div
5-
:id="`fields-content-${name}`"
5+
:id="`fields-content-${id}`"
66
class="chat__wrapper"
77
:class="checkIfAreLessThanTwoRoles ? '--simple' : '--multiple'"
88
>
@@ -32,8 +32,8 @@
3232
>
3333
<MarkdownRenderer v-if="useMarkdown" :markdown="text" />
3434
<span v-else v-html="text" /><template>
35-
<style :key="name" scoped>
36-
::highlight(search-text-highlight-{{name}}) {
35+
<style :key="id" scoped>
36+
::highlight(search-text-highlight-{{id}}) {
3737
color: #ff675f;
3838
}
3939
</style>
@@ -47,9 +47,10 @@
4747

4848
<script>
4949
import { useChatFieldViewModel } from "./useChatFieldViewModel";
50+
5051
export default {
5152
props: {
52-
name: {
53+
id: {
5354
type: String,
5455
required: true,
5556
},

argilla-frontend/components/features/annotation/container/fields/chat-field/useChatFieldViewModel.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import { onMounted, watch } from "vue-demi";
22
import { useSearchTextHighlight } from "../useSearchTextHighlight";
33

44
export const useChatFieldViewModel = (props: {
5-
name: string;
5+
id: string;
66
searchText: string;
77
}) => {
8-
const { highlightText } = useSearchTextHighlight(props.name);
8+
const { highlightText } = useSearchTextHighlight(props.id);
99

1010
watch(
1111
() => props.searchText,

argilla-frontend/components/features/annotation/container/fields/span-annotation/SpanAnnotationTextField.vue

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div
33
class="text_field_component"
4-
:key="name"
4+
:key="id"
55
@mouseenter.stop="mouseEnter = true"
66
@mouseleave.stop="mouseEnter = false"
77
aria-label="Data Record Field"
@@ -35,7 +35,7 @@
3535
</BaseActionTooltip>
3636
</div>
3737
<div
38-
:id="`fields-content-${name}`"
38+
:id="`fields-content-${id}`"
3939
class="text_field_component__area --body1"
4040
:aria-label="'Data entry for Field: ' + title"
4141
>
@@ -97,7 +97,7 @@
9797
[data-theme="dark"] .span-annotation__field--overlapped::highlight(hl-{{id}}-hover) {
9898
background: {{color.palette.veryDark}};
9999
}
100-
::highlight(search-text-highlight-{{name}}) {
100+
::highlight(search-text-highlight-{{id}}) {
101101
color: #ff675f;
102102
}
103103
</style>
@@ -110,16 +110,11 @@
110110
<script>
111111
import { useSpanAnnotationTextFieldViewModel } from "./useSpanAnnotationTextFieldViewModel";
112112
export default {
113-
name: "SpanAnnotationTextField",
114113
props: {
115114
id: {
116115
type: String,
117116
required: true,
118117
},
119-
name: {
120-
type: String,
121-
required: true,
122-
},
123118
title: {
124119
type: String,
125120
required: true,

argilla-frontend/components/features/annotation/container/fields/span-annotation/useSpanAnnotationTextFieldViewModel.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,12 @@ import { SpanQuestionAnswer } from "~/v1/domain/entities/question/QuestionAnswer
99
import { SpanAnswer } from "~/v1/domain/entities/IAnswer";
1010

1111
export const useSpanAnnotationTextFieldViewModel = (props: {
12-
name: string;
1312
spanQuestion: Question;
1413
id: string;
1514
searchText: string;
1615
}) => {
17-
const { name, spanQuestion, id } = props;
18-
const searchTextHighlight = useSearchTextHighlight(name);
16+
const { spanQuestion, id } = props;
17+
const searchTextHighlight = useSearchTextHighlight(id);
1918
const spanAnnotationSupported = ref(true);
2019
const answer = spanQuestion.answer as SpanQuestionAnswer;
2120
const initialConfiguration = {

argilla-frontend/components/features/annotation/container/fields/text-field/TextField.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
</BaseButton>
1717
</BaseActionTooltip>
1818
</div>
19-
<div :id="`fields-content-${name}`" class="content-area --body1">
19+
<div :id="`fields-content-${id}`" class="content-area --body1">
2020
<MarkdownRenderer v-if="useMarkdown" :markdown="fieldText" />
2121
<Sandbox v-else-if="isHTML" :content="fieldText" />
2222
<div v-else :class="classes" v-html="fieldText" />
2323
<template>
24-
<style :key="name" scoped>
25-
::highlight(search-text-highlight-{{name}}) {
24+
<style :key="id" scoped>
25+
::highlight(search-text-highlight-{{id}}) {
2626
color: #ff675f;
2727
}
2828
</style>
@@ -36,7 +36,7 @@ import { useTextFieldViewModel } from "./useTextFieldViewModel";
3636
3737
export default {
3838
props: {
39-
name: {
39+
id: {
4040
type: String,
4141
required: true,
4242
},

argilla-frontend/components/features/annotation/container/fields/text-field/useTextFieldViewModel.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import { onMounted, watch } from "vue-demi";
22
import { useSearchTextHighlight } from "../useSearchTextHighlight";
33

44
export const useTextFieldViewModel = (props: {
5-
name: string;
5+
id: string;
66
searchText: string;
77
}) => {
8-
const { highlightText } = useSearchTextHighlight(props.name);
8+
const { highlightText } = useSearchTextHighlight(props.id);
99

1010
watch(
1111
() => props.searchText,

0 commit comments

Comments
 (0)