Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Highlighted Categories (aka like button) #1173

Draft
wants to merge 6 commits into
base: dev
Choose a base branch
from

Conversation

psilabs-dev
Copy link
Contributor

Issue #1129

Completed:

  • backend
  • frontend, UI, assets

Ongoing implementation of the like button backend and frontend logic. To strive for a neutral term, "highlight" is tentatively used (English is hard...) but everything so far, naming and logic, can be changed.

A static category is "highlighted" if archives in the index and reader page can be added and removed from this category via a 1-click icon toggle. Only one category may be highlighted at any time. The assignment and un-assignment of a highlight may be done via the API or on the browser via the config/categories page. If a highlighted category is deleted, the highlight will point to an empty string.

Additionally, all new installs of LRR will create a highlighted category called "Favorites". In such cases where the category corresponds to liked archives, the toggle is equivalent to a like button.

As for the UI I am thinking of doing something like this (but move Highlight row below "Delete Category"):

Screen Shot 2025-01-24 at 17 47 39 PM

Expanding it shows a list of static categories + "No Category". Choosing a static category moves the highlight to that category. If a highlight is assigned, "No Category" will instead be replaced with the name of the highlighted category.


There is quite a bit left to do, but I think now is a good time to checkpoint. There is settling on a UI, and icons to replace the placeholder toggle icons. If this backend is approved, we can move forward with API documentation.

This is also a request for feedback/available help, as I haven't decided on the design of the frontend, and I am not familiar with *cough* basically any frontend. Now these are things I can eventually learn and come up with something, but I'm expecting this will take a while.

Copy link
Owner

@Difegue Difegue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks overall good, sweet and simple. I don't have much to complain about.

I'm a bit iffy on the "highlighted" term, but I don't really have a better one coming to mind at the moment.

lib/LANraragi.pm Outdated Show resolved Hide resolved
lib/LANraragi/Model/Category.pm Outdated Show resolved Hide resolved
lib/LANraragi.pm Outdated Show resolved Hide resolved
lib/LANraragi/Controller/Api/Category.pm Outdated Show resolved Hide resolved
lib/LANraragi/Utils/Routing.pm Outdated Show resolved Hide resolved
@Difegue
Copy link
Owner

Difegue commented Jan 27, 2025

Regarding UI, I'd just add a checkmark below "pin this category" that makes the selected cat the highlighted one. Ofc, you can only do this with static categories.

In the index, i think you can add the "like" button to the javascript-created thumbnails fairly easily, that's in a dedicated function.
For compact mode, I would add a button inline to the left of the title, like how we used to do for the download/edit metadata buttons before the context menu came around. (that was a while ago...)

You need however to know the "initial" state of the like button when the index loads (aka whether an ID is in the highlighted category or not).
We could either do this purely with API calls and JS, or do some search engine work to easily surface that a given archive belongs or not to the highlighted category. (Get the ID list of the highlighted category, then when iterating over the final search results, check whether or not your IDs are in there)

@psilabs-dev
Copy link
Contributor Author

Yeah I'm not too sure about the naming either, we can sit on that for a while, see if anyone has thoughts, or ask an AI for ideas. I wouldn't mind if we just gave it a Japanese phrase either.

I'm sure the front end work isn't difficult, I just need to spend some good time learning the basic principles and HTML/CSS/JS structure/DSL and speaking the frontend language. Right now I don't know what I don't know or what I should know, or if a term is used in a informal or technical setting.

@Difegue
Copy link
Owner

Difegue commented Jan 31, 2025

Fair enough - Maybe someone will come up with a better name by the time we wrap up the UI!
I don't know if there's an equivalent japanese term in Pixiv or such people would be familar with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants