[Suggestion] Gallery Sort

Dear Perchance Dev. Please add the ability to sort not only by Prompt and NegativePrompt, but also by SaveTitle and SaveDescription 🙏

4 points · 7 comments · view on lemmy.world

7 Comments

Tod_1ncignito@lemmy.world · 1 pts · 117d (2 replies)

If you mean a public gallery or public generators or such, you'd need to add the script details yourself but you could shlap something like this in.

<!-- sample search thingy -->

<!-- sort filter section -->
<div style="margin: auto; display: flex; justify-content: center; align-items: center; flex-wrap: wrap;">
  <span class="mainctls sortctl" style="margin-left: 8px; font-family: inherit; color: red;" >
    <select id="sortSelect" onchange="handleSort(this.value)">
      <option value="default" selected>Sort</option>
      <option value="a-z">A-Z</option>
      <option value="z-a">Z-A</option>
      <option value="dateCreated">Date Created</option>
      <option value="newest">Newest</option>
      <option value="oldest">Oldest</option>
      <option value="mostViews">Most Views</option>
    </select>
  </span>

  <!-- search filter thingy-->
  <span class="mainctls filterctl" style="margin-left: 8px; font-family: inherit; color: red;">
    <select id="filterSelect" onchange="handleFilter(this.value)">
      <option value="default" selected>Filter</option>
      <option value="all">All</option>
      <option value="Prompt">Prompt</option>
      <option value="NegativePrompt">NegativePrompt</option>
      <option value="SaveTitle">SaveTitle</option>
      <option value="SaveDescription">SaveDescription</option>
      <option value="Model">Model</option>
      <option value="Sampler">Sampler</option>
      <option value="CFGScale">CFGScale</option>
      <option value="Steps">Steps</option>
      <option value="ClipSkip">ClipSkip</option>
      <option value="Seed">Seed</option>
      <option value="FaceRestoration">FaceRestoration</option>
      <option value="Comments">Comments</option>
      <option value="Tags">Tags</option>
    </select>
  </span>
</div>

Nice simple generic search thingy, but then you kinda have to hope that they have tags or references to filter. This is just a scuffy sample but, its a simple start if you want to use it and work from. You need to populate the handleFilter(this.value) and handleSort(this.value) to work depending on how you want to use it, i left them empty so you can work away with it.

qinerous@lemmy.world · 2 pts · 116d (1 reply)

Are you sure these are built-in functions of plugin? I tried using handleFilter(this.value) and handleSort(this.value), but I got an error saying that there are no such functions. Without the actual code for these functions, it won't work

Tod_1ncignito@lemmy.world · 1 pts · 116d

Oh those are just place holders for setting up a search for yourself, i just gave you a rough wireframe start to work with. Like i said some people might not tag or add references or descriptions into their uploads so it might not find everything which isnt a bad thing, just shows nobody is adding tags or details or such.

ccufcc@lemmy.world · 1 pts · 117d (3 replies)

How do we sort that? From A-Z ?

qinerous@lemmy.world · 1 pts · 117d (2 replies)

I meant in words. For example, show only posts that include "Drawn Anime" in the SaveDescription or something like this

ccufcc@lemmy.world · 2 pts · 117d (1 reply)

This looks like gallery searching or tag/label filter rather than sorting 🐯

qinerous@lemmy.world · 2 pts · 116d

yep