From 8d543ab94d3678728466d3627e0d419ec00f3010 Mon Sep 17 00:00:00 2001
From: Zero~Informatique
Date: Wed, 29 Jan 2020 04:53:35 +0100
Subject: viewer: finalized the thumbnails view layouts. implemented thumbnails
 lazy-loading

---
 viewer/src/views/GallerySearch.vue | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

(limited to 'viewer/src/views/GallerySearch.vue')

diff --git a/viewer/src/views/GallerySearch.vue b/viewer/src/views/GallerySearch.vue
index 7e61f89..870d3e2 100644
--- a/viewer/src/views/GallerySearch.vue
+++ b/viewer/src/views/GallerySearch.vue
@@ -18,13 +18,16 @@
 -->
 
 <template>
-  <div class="flex">
+  <div class="thumbnail-tiles">
     <div v-for="(item) in items" :key="item.path">
       <router-link :to="item.path" @click.native="$uiStore.setModeNavigation()">
         <gallery-thumbnail :item="item" />
       </router-link>
     </div>
     <div v-if="items.length===0">{{$t('search.no-results')}}</div>
+    <div>
+      <!-- Empty item for better flex layout -->
+    </div>
   </div>
 </template>
 
-- 
cgit v1.2.3


From 170da2d55fec0359cbac780786383710b734eda7 Mon Sep 17 00:00:00 2001
From: Zero~Informatique
Date: Fri, 31 Jan 2020 09:17:57 +0100
Subject: viewer: code cleaning, moved some views to components

---
 viewer/src/views/GallerySearch.vue | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

(limited to 'viewer/src/views/GallerySearch.vue')

diff --git a/viewer/src/views/GallerySearch.vue b/viewer/src/views/GallerySearch.vue
index 870d3e2..4e843b9 100644
--- a/viewer/src/views/GallerySearch.vue
+++ b/viewer/src/views/GallerySearch.vue
@@ -21,7 +21,7 @@
   <div class="thumbnail-tiles">
     <div v-for="(item) in items" :key="item.path">
       <router-link :to="item.path" @click.native="$uiStore.setModeNavigation()">
-        <gallery-thumbnail :item="item" />
+        <ld-thumbnail :item="item" />
       </router-link>
     </div>
     <div v-if="items.length===0">{{$t('search.no-results')}}</div>
@@ -33,11 +33,8 @@
 
 <script lang="ts">
 import { Component, Vue, Prop } from "vue-property-decorator";
-import GalleryThumbnail from "./GalleryThumbnail.vue";
 
-@Component({
-  components: { GalleryThumbnail },
-})
+@Component
 export default class GalleryPicture extends Vue {
   @Prop({ required: true }) readonly items!: Gallery.Item[];
 }
-- 
cgit v1.2.3


From cfc2f65479bca39e77cfc6b3e2437f6e8022496f Mon Sep 17 00:00:00 2001
From: pacien
Date: Mon, 10 Feb 2020 20:15:45 +0100
Subject: viewer: remove last row forced offset

It was only making things worse in the end.
---
 viewer/src/views/GallerySearch.vue | 3 ---
 1 file changed, 3 deletions(-)

(limited to 'viewer/src/views/GallerySearch.vue')

diff --git a/viewer/src/views/GallerySearch.vue b/viewer/src/views/GallerySearch.vue
index 4e843b9..278bbe3 100644
--- a/viewer/src/views/GallerySearch.vue
+++ b/viewer/src/views/GallerySearch.vue
@@ -25,9 +25,6 @@
       </router-link>
     </div>
     <div v-if="items.length===0">{{$t('search.no-results')}}</div>
-    <div>
-      <!-- Empty item for better flex layout -->
-    </div>
   </div>
 </template>
 
-- 
cgit v1.2.3


From 8e91297ec0b090e3439efe2137a59192f5bb857b Mon Sep 17 00:00:00 2001
From: Zero~Informatique
Date: Tue, 11 Feb 2020 01:50:16 +0100
Subject: viewer: browsing pictures disables fullscreen. Resolves #115

---
 viewer/src/views/GallerySearch.vue | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'viewer/src/views/GallerySearch.vue')

diff --git a/viewer/src/views/GallerySearch.vue b/viewer/src/views/GallerySearch.vue
index 278bbe3..97c5c66 100644
--- a/viewer/src/views/GallerySearch.vue
+++ b/viewer/src/views/GallerySearch.vue
@@ -34,6 +34,10 @@ import { Component, Vue, Prop } from "vue-property-decorator";
 @Component
 export default class GalleryPicture extends Vue {
   @Prop({ required: true }) readonly items!: Gallery.Item[];
+
+  mounted() {
+    this.$uiStore.fullscreen = false;
+  }
 }
 </script>
 
-- 
cgit v1.2.3


From 370e3db3455f548699ff5e046e0f8dcc304991ac Mon Sep 17 00:00:00 2001
From: Zero~Informatique
Date: Fri, 14 Feb 2020 09:19:53 +0100
Subject: viewer: major code and search mode overhaul

Updated libraries to the lastest version
SCSS Formatter as suggested VSC extensions
Renamed toolbar-color by scrollbar-color
LD components use Props in favor of touching the stores directly (when possible)
Moved most common algorithms to a "services" folder
Complete search overhaul (lots of code change)
---
 viewer/src/views/GallerySearch.vue | 36 ++++++++++++++++++++++++++----------
 1 file changed, 26 insertions(+), 10 deletions(-)

(limited to 'viewer/src/views/GallerySearch.vue')

diff --git a/viewer/src/views/GallerySearch.vue b/viewer/src/views/GallerySearch.vue
index 97c5c66..eacbcdd 100644
--- a/viewer/src/views/GallerySearch.vue
+++ b/viewer/src/views/GallerySearch.vue
@@ -18,25 +18,41 @@
 -->
 
 <template>
-  <div class="thumbnail-tiles">
-    <div v-for="(item) in items" :key="item.path">
-      <router-link :to="item.path" @click.native="$uiStore.setModeNavigation()">
-        <ld-thumbnail :item="item" />
-      </router-link>
-    </div>
-    <div v-if="items.length===0">{{$t('search.no-results')}}</div>
-  </div>
+  <ld-gallery :items="items()" :noresult="$t('search.no-results')" />
 </template>
 
 <script lang="ts">
-import { Component, Vue, Prop } from "vue-property-decorator";
+import { Component, Vue, Prop, Watch } from "vue-property-decorator";
+import { Operation } from "@/@types/Operation";
+import IndexSearch from "@/services/indexsearch";
+import IndexFactory from "../services/indexfactory";
 
 @Component
 export default class GalleryPicture extends Vue {
-  @Prop({ required: true }) readonly items!: Gallery.Item[];
+  @Prop(String) readonly path!: string;
+  @Prop(Array) readonly query!: string[];
+
+  currentSearch: Tag.Search[] = [];
 
   mounted() {
     this.$uiStore.fullscreen = false;
+    this.$uiStore.searchMode = true;
+    this.restoreSearchFilters();
+  }
+
+  destroyed() {
+    this.$uiStore.searchMode = false;
+  }
+
+  items() {
+    return IndexSearch.search(this.currentSearch, this.path);
+  }
+
+  @Watch("query")
+  restoreSearchFilters() {
+    const tagsIndex = this.$galleryStore.tagsIndex;
+    this.currentSearch = this.query.flatMap(filter => IndexFactory.searchTags(tagsIndex, filter));
+    this.$uiStore.searchFilters = [...this.currentSearch];
   }
 }
 </script>
-- 
cgit v1.2.3


From eb00c2a7874608f70ec7768eae8d006a22bc0a54 Mon Sep 17 00:00:00 2001
From: Zero~Informatique
Date: Sun, 23 Feb 2020 21:33:20 +0100
Subject: viewer: absolute path fix

---
 viewer/src/views/GallerySearch.vue | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'viewer/src/views/GallerySearch.vue')

diff --git a/viewer/src/views/GallerySearch.vue b/viewer/src/views/GallerySearch.vue
index eacbcdd..f4c28b0 100644
--- a/viewer/src/views/GallerySearch.vue
+++ b/viewer/src/views/GallerySearch.vue
@@ -25,7 +25,7 @@
 import { Component, Vue, Prop, Watch } from "vue-property-decorator";
 import { Operation } from "@/@types/Operation";
 import IndexSearch from "@/services/indexsearch";
-import IndexFactory from "../services/indexfactory";
+import IndexFactory from "@/services/indexfactory";
 
 @Component
 export default class GalleryPicture extends Vue {
-- 
cgit v1.2.3


From 7c2a2ff46469d5e8f44fb3ec7feae5f798e0baf8 Mon Sep 17 00:00:00 2001
From: Zero~Informatique
Date: Thu, 27 Feb 2020 17:23:32 +0100
Subject: viewer: architectural fixes and improvements

Make use of VueX's strict mode (which is different from vuex-class-component strict mode)
Fixed issues and bad-practices with search filter tags mutations
Correctly implement the new index.json format
---
 viewer/src/views/GallerySearch.vue | 16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)

(limited to 'viewer/src/views/GallerySearch.vue')

diff --git a/viewer/src/views/GallerySearch.vue b/viewer/src/views/GallerySearch.vue
index f4c28b0..4b6dd7f 100644
--- a/viewer/src/views/GallerySearch.vue
+++ b/viewer/src/views/GallerySearch.vue
@@ -22,22 +22,17 @@
 </template>
 
 <script lang="ts">
-import { Component, Vue, Prop, Watch } from "vue-property-decorator";
+import { Component, Vue, Prop } from "vue-property-decorator";
 import { Operation } from "@/@types/Operation";
 import IndexSearch from "@/services/indexsearch";
-import IndexFactory from "@/services/indexfactory";
 
 @Component
 export default class GalleryPicture extends Vue {
   @Prop(String) readonly path!: string;
-  @Prop(Array) readonly query!: string[];
-
-  currentSearch: Tag.Search[] = [];
 
   mounted() {
     this.$uiStore.fullscreen = false;
     this.$uiStore.searchMode = true;
-    this.restoreSearchFilters();
   }
 
   destroyed() {
@@ -45,14 +40,7 @@ export default class GalleryPicture extends Vue {
   }
 
   items() {
-    return IndexSearch.search(this.currentSearch, this.path);
-  }
-
-  @Watch("query")
-  restoreSearchFilters() {
-    const tagsIndex = this.$galleryStore.tagsIndex;
-    this.currentSearch = this.query.flatMap(filter => IndexFactory.searchTags(tagsIndex, filter));
-    this.$uiStore.searchFilters = [...this.currentSearch];
+    return IndexSearch.search(this.$galleryStore.currentSearch, this.path);
   }
 }
 </script>
-- 
cgit v1.2.3


From 4641f35baebd618ec51fa549adf64670c31c647f Mon Sep 17 00:00:00 2001
From: Zero~Informatique
Date: Thu, 27 Feb 2020 17:42:24 +0100
Subject: viewer: added a count of results found in other folders when
 no-results are found

---
 viewer/src/views/GallerySearch.vue | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

(limited to 'viewer/src/views/GallerySearch.vue')

diff --git a/viewer/src/views/GallerySearch.vue b/viewer/src/views/GallerySearch.vue
index 4b6dd7f..9f2ac17 100644
--- a/viewer/src/views/GallerySearch.vue
+++ b/viewer/src/views/GallerySearch.vue
@@ -18,7 +18,7 @@
 -->
 
 <template>
-  <ld-gallery :items="items()" :noresult="$t('search.no-results')" />
+  <ld-gallery :items="items()" :noresult="noResult()" />
 </template>
 
 <script lang="ts">
@@ -30,6 +30,8 @@ import IndexSearch from "@/services/indexsearch";
 export default class GalleryPicture extends Vue {
   @Prop(String) readonly path!: string;
 
+  otherCount: Number = 0;
+
   mounted() {
     this.$uiStore.fullscreen = false;
     this.$uiStore.searchMode = true;
@@ -40,7 +42,14 @@ export default class GalleryPicture extends Vue {
   }
 
   items() {
-    return IndexSearch.search(this.$galleryStore.currentSearch, this.path);
+    const searchResult = IndexSearch.search(this.$galleryStore.currentSearch);
+    const filteredByPath = searchResult.filter(item => item.path.startsWith(this.path));
+    this.otherCount = searchResult.length - filteredByPath.length;
+    return filteredByPath;
+  }
+
+  noResult() {
+    return `${this.$t("search.no-results")} • ${this.otherCount} ${this.$t("search.no-results.otherfolders")}`;
   }
 }
 </script>
-- 
cgit v1.2.3


From 27a7bebc32a527cc86857008b491b9571e807183 Mon Sep 17 00:00:00 2001
From: Zero~Informatique
Date: Thu, 27 Feb 2020 19:20:51 +0100
Subject: viewer: added a count of results found in other folders when
 no-results are found

Using list formatting for the no-result translation, instead of string concatenation
---
 viewer/src/views/GallerySearch.vue | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'viewer/src/views/GallerySearch.vue')

diff --git a/viewer/src/views/GallerySearch.vue b/viewer/src/views/GallerySearch.vue
index 9f2ac17..d638df2 100644
--- a/viewer/src/views/GallerySearch.vue
+++ b/viewer/src/views/GallerySearch.vue
@@ -49,7 +49,8 @@ export default class GalleryPicture extends Vue {
   }
 
   noResult() {
-    return `${this.$t("search.no-results")} • ${this.otherCount} ${this.$t("search.no-results.otherfolders")}`;
+    const params = [this.otherCount, this.otherCount > 1 ? "s" : ""];
+    return this.$t("search.no-results.otherfolders", params);
   }
 }
 </script>
-- 
cgit v1.2.3


From 8d889762872501eebd5edb5d7cacddfd4cd55ad4 Mon Sep 17 00:00:00 2001
From: Zero~Informatique
Date: Fri, 28 Feb 2020 04:09:40 +0100
Subject: viewer: more minor architectural improvement

---
 viewer/src/views/GallerySearch.vue | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'viewer/src/views/GallerySearch.vue')

diff --git a/viewer/src/views/GallerySearch.vue b/viewer/src/views/GallerySearch.vue
index d638df2..e3369b3 100644
--- a/viewer/src/views/GallerySearch.vue
+++ b/viewer/src/views/GallerySearch.vue
@@ -33,12 +33,12 @@ export default class GalleryPicture extends Vue {
   otherCount: Number = 0;
 
   mounted() {
-    this.$uiStore.fullscreen = false;
-    this.$uiStore.searchMode = true;
+    this.$uiStore.toggleFullscreen(false);
+    this.$uiStore.toggleSearchMode(true);
   }
 
   destroyed() {
-    this.$uiStore.searchMode = false;
+    this.$uiStore.toggleSearchMode(false);
   }
 
   items() {
-- 
cgit v1.2.3


From 7f0b8367a2092c5ffd69e9e46d055cbd605c0e3a Mon Sep 17 00:00:00 2001
From: Zero~Informatique
Date: Fri, 28 Feb 2020 18:50:12 +0100
Subject: viewer: more minor architectural and performance improvement

---
 viewer/src/views/GallerySearch.vue | 1 +
 1 file changed, 1 insertion(+)

(limited to 'viewer/src/views/GallerySearch.vue')

diff --git a/viewer/src/views/GallerySearch.vue b/viewer/src/views/GallerySearch.vue
index e3369b3..e75a37e 100644
--- a/viewer/src/views/GallerySearch.vue
+++ b/viewer/src/views/GallerySearch.vue
@@ -39,6 +39,7 @@ export default class GalleryPicture extends Vue {
 
   destroyed() {
     this.$uiStore.toggleSearchMode(false);
+    this.$galleryStore.setCurrentSearch([]);
   }
 
   items() {
-- 
cgit v1.2.3

