Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions e2e/selectBookmark.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ test.describe('select bookmark', () => {
await page.goto('/search');

await page.fill('textarea', 'this is a longer text for testing');

await page.getByLabel('Recherche', { exact: true }).click();

await expect(page.getByText('Document one test')).toBeVisible();
Expand Down
2 changes: 1 addition & 1 deletion src/components/AppHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
max-height: clamp(24px, 5vw, 3.5em);
}

@media (max-width: 1600px) {
@media (max-width: 1330px) {
.app-header-link {
display: none;
& > * {
Expand Down
2 changes: 1 addition & 1 deletion src/components/ChatArea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ const handleOnWheel = () => {
@media screen and (min-width: 768px) {
.bottom-wrapper {
width: 100%;
padding-bottom: 5rem;
padding-bottom: 1rem;
}
.scroll-arrow {
all: unset;
Expand Down
6 changes: 6 additions & 0 deletions src/components/ChatBuble.vue
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ const copyMessage = (msg: string) => {
}
}

@media screen and (max-width: 1450px) {
.chat-bubble.last-message {
padding-bottom: 1rem;
}
}

@media screen and (max-width: 576px) {
.chat-bubble-content {
display: flex;
Expand Down
2 changes: 1 addition & 1 deletion src/components/ChatComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const computedStatus = computed(() => store.chatStatus);
:action="(content: string) => store.onSendMessage(content)"
class="queues-wrapper"
>
<p v-if="CHAT_STATUS.DONE === computedStatus" class="subtitle is-6 ml-4">
<p v-if="CHAT_STATUS.DONE === computedStatus" class="subtitle is-6 ml-4 mb-2">
{{ $t('hintForNewQuestions') }}
</p>

Expand Down
12 changes: 11 additions & 1 deletion src/components/ChatEmptyContent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ defineProps<{
<template>
<div class="chat-default">
<div>{{ $t('emptyChatPresentation') }}</div>
<div class="mt-6">{{ $t('emptyChatAction') }}</div>
<div class="mt-3">{{ $t('emptyChatAction') }}</div>
</div>
</template>
<style scoped>
Expand All @@ -26,6 +26,16 @@ defineProps<{
text-align: left;
}

@media screen and (min-width: 1300) {
.chat-default {
text-align: center;
& > * {
text-align: center;
font-size: 0.5rem;
}
}
}

@media screen and (min-width: 576px) {
.chat-default {
text-align: center;
Expand Down
2 changes: 1 addition & 1 deletion src/components/ChatQueuesPills.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ defineProps<{
background: var(--neutral-50);
}

@media screen and (max-width: 767px) {
@media screen and (max-width: 1450px) {
.card-content {
padding: 0.5rem;
}
Expand Down
16 changes: 16 additions & 0 deletions src/components/SearchWrapper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,22 @@
margin-bottom: 1rem;
}

.text-area {
transition: all 0.5s ease;
}

.search-container:hover {
& > .text-area {
height: 19em;
}
}

.search-container:not(:hover) {
& > .text-area:has(.textarea:not([value=''])) {
height: 5em;
}
}

.filters {
position: relative;
display: flex;
Expand Down
3 changes: 1 addition & 2 deletions src/components/SourcesListComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const store = useBookmarksStore();

const props = defineProps<{
hideSteps?: boolean;
sourcesList: Document[] | null;
sourcesList: Document[] | [];
isSourcesError: boolean;
isFetchingSources: boolean;
fetchingAnswer?: boolean;
Expand Down Expand Up @@ -49,7 +49,6 @@ const ChosenCard = Cards[props.cardType || 'default'];
}}
</h2>
<h2 v-else-if="fetchingAnswer">{{ $t('sourcesList.formulatingAnswer') }}</h2>
<h2 v-else>...</h2>
</div>
<!-- results -->

Expand Down
1 change: 1 addition & 0 deletions src/components/TextAreaComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ defineEmits(['update:modelValue']);
<style scoped>
.textarea {
border: none;
height: 100%;
padding: 2rem;
}

Expand Down
20 changes: 18 additions & 2 deletions src/components/__tests__/__snapshots__/QandA.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ exports[`QandA > renders properly 1`] = `
emptyChatPresentation
</div>
<div
class="mt-6"
class="mt-3"
data-v-c98dfe8d=""
>
emptyChatAction
Expand Down Expand Up @@ -1001,7 +1001,23 @@ exports[`QandA > renders properly 1`] = `
</div>

<!--v-if-->
<!--v-if-->
<div
class="sources-list"
data-v-dbbc9003=""
data-v-eedbfc9b=""
>
<!-- fetching -->
<div
data-v-eedbfc9b=""
>
<!--v-if-->
<!--v-if-->
</div>
<!-- results -->
<!--v-if-->
<!-- error -->
<!--v-if-->
</div>
<!--v-if-->

</div>
Expand Down
17 changes: 14 additions & 3 deletions src/components/nav/BaseNavItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,27 @@ defineProps<{
}

@media screen and (max-width: 1450px) {
.link-wrapper {
padding-inline: 0.25rem;
}
router-link {
padding: 0.25rem 0.5rem;
display: flex;
font-size: 0.5rem;

gap: 0rem;
margin: 0 0.05rem;
}
}

@media screen and (max-width: 1100px) {
.item-name {
display: none;
visibility: hidden;
opacity: 0;
width: 0rem;
white-space: nowrap;
}
.router-link {
gap: 0;
}
}

@media screen and (max-width: 750px) {
Expand Down
2 changes: 1 addition & 1 deletion src/stores/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const useChatStore = defineStore('chat', () => {
const chatInput: Ref<string> = ref('');
const chatMessagesList: Ref<ChatMessage[]> = ref(getFromStorage('chat') || []);
const questionQueues: Ref<string[] | null> = ref(getFromStorage('questionQueues'));
const sourcesList: Ref<Document[]> = ref(getFromStorage('chatSources') || []);
const sourcesList: Ref<Document[] | []> = ref(getFromStorage('chatSources') || []);
const reformulatedQuery: Ref<string | null> = ref(getFromStorage('reformulatedQuery'));
const storedThreadId: Ref<string | null> = ref(localStorage.getItem('chatThreadId'));
const storedMessageId: Ref<string | null> = ref(localStorage.getItem('chatMessageId'));
Expand Down
1 change: 1 addition & 0 deletions src/utils/navigation.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export const scrollToAnchor = (id: string) => {
if (!document.getElementById(id)) return;
document.getElementById(id).scrollIntoView({ behavior: 'smooth' });
};
7 changes: 5 additions & 2 deletions src/views/QandA.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,14 @@ onBeforeMount(() => {
<FiltersComponent :shouldClose="computedStatus === CHAT_STATUS.FORMULATING_ANSWER" />
<ReformulatedQuery v-if="chatstore.reformulatedQuery" :query="chatstore.reformulatedQuery" />
<SourcesListComponentVue
v-if="chatstore.sourcesList.length"
cardType="simple"
:shouldDisplayScore="!!chatstore.shouldDisplayScore"
:sourcesList="
[CHAT_STATUS.DONE, CHAT_STATUS.FORMULATING_ANSWER].includes(computedStatus)
[
CHAT_STATUS.DONE,
CHAT_STATUS.FORMULATING_ANSWER,
CHAT_STATUS.FORMULATED_ANSWER
].includes(computedStatus)
? chatstore.sourcesList.slice(0, 7)
: []
"
Expand Down
3 changes: 2 additions & 1 deletion src/views/SearchSDG.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const store = useSearchStore();
store.displayNoResult
"
hideRefIndicator
:sourcesList="store.searchResults"
:sourcesList="store.searchResults || []"
:isSourcesError="store.hasSourcesError"
:isFetchingSources="store.isFetchingSources"
:shouldDisplayScore="store.shouldDisplayScore"
Expand All @@ -89,6 +89,7 @@ const store = useSearchStore();
overflow-y: auto;
padding: 1rem 3rem 0rem 3rem;
}

.delete-button-wrapper {
position: absolute;
top: 0;
Expand Down
7 changes: 6 additions & 1 deletion src/views/TutorPage.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { computed } from 'vue';
import { computed, onMounted } from 'vue';
import CursusInfo from '@/components/tutor/CursusInfo.vue';
import SummariesStep from '@/components/tutor/SummariesStep.vue';
import SourcesList from '@/components/tutor/SecondStep.vue';
Expand All @@ -8,6 +8,7 @@ import StepsIndicator from '@/components/tutor/StepsIndicator.vue';
import ErrorComponent from '@/components/ErrorComponent.vue';
import { useTutorStore } from '@/stores/tutor';
import StatusModal from '@/components/tutor/StatusModal.vue';
import { scrollToAnchor } from '@/utils/navigation';

const store = useTutorStore();

Expand Down Expand Up @@ -43,6 +44,10 @@ const stepToAction: Record<1 | 2 | 3 | 4, (arg?: any) => Promise<void>> = {
3: store.handleCreateSyllabus,
4: store.handleDownloadSyllabus
};

onMounted(() => {
scrollToAnchor(`target-${store.step}`);
});
</script>
<template>
<div class="content-centered-wrapper">
Expand Down
Loading