Skip to content

Commit

Permalink
gs_index: paragraph metadata hiding
Browse files Browse the repository at this point in the history
  • Loading branch information
parkchamchi committed Oct 31, 2024
1 parent 0a69074 commit d4906b0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/backend/gs_index/src/components/Corpus.vue
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@
:key="cursor"
:p="corpus.paragraphs[cursor]"
:index="cursor"
:showMetadata="showMetadata"
@annotateP="onAnnotateP"
@reannotateP="onReannotateP" />
</div>
Expand Down
17 changes: 9 additions & 8 deletions src/backend/gs_index/src/components/Paragraph.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,19 @@
type: Number,
required: true,
},
showMetadata: {
type: Boolean,
required: false,
default: false,
}
},
components: {
Token,
},
computed: {
isAnnotateButtonVisible() {
return !this.p.is_delimiter && this.p.tokens && this.p.tokens.length
},
shouldShowManipulatorButtons() { //See Corpus.vue
return sharedState.openaiApiKey; //TODO: dup. w/ Corpus.vue
return this.showMetadata && this.p.tokens && this.p.tokens.length;
}
},
data() {
Expand Down Expand Up @@ -49,19 +52,17 @@

<template>
<div class='paragraph_wrapper'>
<span v-if="isAnnotateButtonVisible && shouldShowManipulatorButtons" class="paragraph_annotate_buttons_span">
<span v-if="shouldShowManipulatorButtons" class="paragraph_annotate_buttons_span">
<button class="corpus_button btn btn-light" @click="annotateP(index)">
Annotate
</button>
<button class="corpus_button btn btn-light" @click="reannotateP(index)">
Reannotate
</button>
<br>
<hr>
</span>

<pre v-if="showPre"
>{{ JSON.stringify(p) }}</pre>

<Token v-for="(t, index) in p.tokens"
:key="index"
:t="t"
Expand Down

0 comments on commit d4906b0

Please sign in to comment.