Skip to content

Commit

Permalink
feat: add also semantics check, add all check in mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
annacv committed Dec 11, 2024
1 parent 0e18a0c commit 879926c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 6 deletions.
14 changes: 11 additions & 3 deletions src/components/desktop/desktop.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,13 @@
</template>

<script lang="ts">
import { animateTranslate, BaseIdModal, LocationProvider, useState } from '@empathyco/x-components'
import {
animateTranslate,
BaseIdModal,
LocationProvider,
use$x,
useState,
} from '@empathyco/x-components'
import { MainScroll, Scroll } from '@empathyco/x-components/scroll'
import { computed, defineAsyncComponent, defineComponent } from 'vue'
import { useHasSearched } from '../../composables/use-has-searched.composable'
Expand Down Expand Up @@ -91,11 +97,13 @@ export default defineComponent({
),
},
setup() {
const x = use$x()
const rightAsideAnimation = animateTranslate('right')
const { hasSearched } = useHasSearched()
const { relatedPrompts } = useState('relatedPrompts', ['relatedPrompts'])
const showNoResultsMessage = computed(() => !relatedPrompts.value?.length)
const showNoResultsMessage = computed(
() => !relatedPrompts.value?.length && !x.semanticQueries.length,
)
return {
hasSearched,
Expand Down
17 changes: 14 additions & 3 deletions src/components/mobile/mobile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@
<LocationProvider location="results">
<SpellcheckMessage class="x-mb-16" data-test="spellcheck-message" />
</LocationProvider>
<NoResultsMessage class="x-mb-16" data-test="no-results-message" />
<NoResultsMessage
v-if="showNoResultsMessage"
class="x-mb-16"
data-test="no-results-message"
/>
<FallbackDisclaimerMessage class="x-mb-16" data-test="fallback-message" />
</div>

Expand Down Expand Up @@ -84,9 +88,10 @@ import {
CloseMainModal,
LocationProvider,
use$x,
useState,
} from '@empathyco/x-components'
import { MainScroll, Scroll } from '@empathyco/x-components/scroll'
import { defineAsyncComponent, defineComponent } from 'vue'
import { computed, defineAsyncComponent, defineComponent } from 'vue'
import { useHasSearched } from '../../composables/use-has-searched.composable'
import MainComponent from '../main.vue'
import MyHistoryAside from '../my-history/my-history-aside.vue'
Expand Down Expand Up @@ -125,15 +130,21 @@ export default defineComponent({
),
},
setup() {
const x = use$x()
const filtersAsideAnimation = animateTranslate('bottom')
const rightAsideAnimation = animateTranslate('right')
const { hasSearched } = useHasSearched()
const { relatedPrompts } = useState('relatedPrompts', ['relatedPrompts'])
const showNoResultsMessage = computed(
() => !relatedPrompts.value?.length && !x.semanticQueries.length,
)
return {
showNoResultsMessage,
filtersAsideAnimation,
rightAsideAnimation,
hasSearched,
x: use$x(),
x,
}
},
})
Expand Down

0 comments on commit 879926c

Please sign in to comment.