Adding categories to mod posts #116

Closed
opened 2024-11-02 11:14:24 +00:00 by freakoverse · 4 comments
Owner

There are normal tags for mod posts, however, a 'category' type tag should also be added in mod posts. The tag for it would be called 'categories'.

Category type tags should be differentiated as such from normal tags, and it would be great to have a sub-system for it (sub-categories. ie: electronics:pc:peripherals:gaming-monitors . this shows category:sub-category:sub-category:sub-category), and there can be multiple categories in one post, separated by comma of course).

in the mod submission page, a new field would be added to accommodate this (it can be left empty), and said field would show (upon the field being active) a list of all suggested categories (fetched from a file found in the project, one that would be updated by staff/admins).

In the mod post page, the categories would be visible and clickable (to lead to a search page with it as a filter, and potentially with the game as a filter along with it).

Considering the above, there'd be a page detected to showing a list of categories (fetched from that above mentioned project file).

(maybe) In the main /search page, there'd be a new drop-down category filter (fetched from that project file) with a search function inside its drop-down.

There are normal tags for mod posts, however, a 'category' type tag should also be added in mod posts. The tag for it would be called 'categories'. Category type tags should be differentiated as such from normal tags, and it would be great to have a sub-system for it (sub-categories. ie: electronics:pc:peripherals:gaming-monitors . this shows category:sub-category:sub-category:sub-category), and there can be multiple categories in one post, separated by comma of course). in the mod submission page, a new field would be added to accommodate this (it can be left empty), and said field would show (upon the field being active) a list of all suggested categories (fetched from a file found in the project, one that would be updated by staff/admins). In the mod post page, the categories would be visible and clickable (to lead to a search page with it as a filter, and potentially with the game as a filter along with it). Considering the above, there'd be a page detected to showing a list of categories (fetched from that above mentioned project file). (maybe) In the main /search page, there'd be a new drop-down category filter (fetched from that project file) with a search function inside its drop-down.
freakoverse added the
Kind/Feature
label 2024-11-02 11:14:24 +00:00
freakoverse added this to the Extra Features project 2024-11-17 11:21:55 +00:00
freakoverse added the
Priority
High
label 2024-11-17 16:04:17 +00:00
Collaborator

From reading the description, I think that using label tags for the category is the best option for now if we want to have search, if we opt-in the custom categories tag we can no longer search on relays and we'd have to fetch and filter on the client since relays only support search for single-letter tags.

e.g using l (with host prefixed to avoid confusion). We'd have to check the labels searching on some basic examples but I image it would look something like this (depending on the category structure)

tags: [
    ["l": "com.example:category-1"],
    ["l": "com.example:sub-category-1"],
    ["l": "com.example:category-2"],
    ["l": "com.example:sub-category-2"],
    ["l": "com.example:category-3"],
]

One downside of this is we won't be able to directly search "not category-1", or to hide certain category without fetching more beforehand and filtering on client.

Edit: possible new labels

tags: [
    ["l": "com.example:monitors"],
    ["l": "com.example:monitors:samsung"],
    ["l": "com.example:monitors:asus:"],
    ["l": "com.example:monitors:asus:series a"],
    ["l": "com.example:keyboard"],
]
From reading the description, I think that using label tags for the category is the best option for now if we want to have search, if we opt-in the custom `categories` tag we can no longer search on relays and we'd have to fetch and filter on the client since relays only support search for single-letter tags. e.g using `l` (with host prefixed to avoid confusion). We'd have to check the labels searching on some basic examples but I image it would look something like this (depending on the category structure) ``` tags: [ ["l": "com.example:category-1"], ["l": "com.example:sub-category-1"], ["l": "com.example:category-2"], ["l": "com.example:sub-category-2"], ["l": "com.example:category-3"], ] ``` One downside of this is we won't be able to directly search "not category-1", or to hide certain category without fetching more beforehand and filtering on client. Edit: possible new labels ``` tags: [ ["l": "com.example:monitors"], ["l": "com.example:monitors:samsung"], ["l": "com.example:monitors:asus:"], ["l": "com.example:monitors:asus:series a"], ["l": "com.example:keyboard"], ] ```
Author
Owner

Read through the nip. Sounds good / makes sense to use it.
I don't think it'd be that big of an issue not having optimized negative-search from relays, should be fine, since most won't use it / if they do they are already associating it with another category.

Hit me up on a call on how that tag structure work and confirm being on the same page for its use on the site.

Read through the nip. Sounds good / makes sense to use it. I don't think it'd be that big of an issue not having optimized negative-search from relays, should be fine, since most won't use it / if they do they are already associating it with another category. Hit me up on a call on how that tag structure work and confirm being on the same page for its use on the site.
Author
Owner

the html:

<div className='IBMSMSMBSSCategories'>
<div className='IBMSMSMBSSCategoriesBox'>
<a className='IBMSMSMBSSCategoriesBoxItem'>
<p>category 1</p></a>
<div className='IBMSMSMBSSCategoriesBoxSeparator'>
<p>&gt;</p></div>
<a className='IBMSMSMBSSCategoriesBoxItem'>
<p>category-1-sub-1</p></a>
<div className='IBMSMSMBSSCategoriesBoxSeparator'>
<p>&gt;</p></div>
<a className='IBMSMSMBSSCategoriesBoxItem'>
<p>category-1-sub-1-sub-2</p></a>
</div>
</div>

To be added under tags (not within it)

the html: ``` <div className='IBMSMSMBSSCategories'> <div className='IBMSMSMBSSCategoriesBox'> <a className='IBMSMSMBSSCategoriesBoxItem'> <p>category 1</p></a> <div className='IBMSMSMBSSCategoriesBoxSeparator'> <p>&gt;</p></div> <a className='IBMSMSMBSSCategoriesBoxItem'> <p>category-1-sub-1</p></a> <div className='IBMSMSMBSSCategoriesBoxSeparator'> <p>&gt;</p></div> <a className='IBMSMSMBSSCategoriesBoxItem'> <p>category-1-sub-1-sub-2</p></a> </div> </div> ``` To be added under tags (not within it)
enes self-assigned this 2024-12-03 14:19:55 +00:00
Collaborator

Progress:

  • add categories html to mod page (l and L nostr tags)
  • add categories selection to submit/edit
  • add custom (user defined) category with support for hierarchy (using > manually in the input field)
  • link categories to the games (l and h browser search params)
  • filter only on the game page /game/:name
  • filter opens a popup with search and categories
  • checkbox multiple (hierarchies only for now)
  • disable link if no game is selected on submit page
  • session based checkbox selection
  • local storage user defined categories
  • adding user defined category auto-selects it
  • show user defined categories as separate list in the popup (between input and list) with an x to delete
  • TBD: submit page custom categories (visiblity and delete)
Progress: - [x] add categories html to mod page (`l` and `L` nostr tags) - [x] add categories selection to submit/edit - [x] add custom (user defined) category with support for hierarchy (using `>` manually in the input field) - [x] link categories to the games (`l` and `h` browser search params) - [x] filter only on the game page `/game/:name` - [x] filter opens a popup with search and categories - [x] checkbox multiple (hierarchies only for now) - [x] disable link if no game is selected on submit page - [x] session based checkbox selection - [x] local storage user defined categories - [x] adding user defined category auto-selects it - [x] show user defined categories as separate list in the popup (between input and list) with an x to delete - [x] TBD: submit page custom categories (visiblity and delete)
enes closed this issue 2024-12-12 16:37:39 +00:00
enes moved this to Done (features) in Extra Features on 2025-01-16 12:08:38 +00:00
enes moved this to Done (features) in Extra Features on 2025-01-16 14:06:03 +00:00
enes moved this to Done (features) in Extra Features on 2025-01-16 17:18:24 +00:00
freakoverse moved this to Done (features) in Extra Features on 2025-01-21 10:59:54 +00:00
freakoverse moved this to Done (features) in Extra Features on 2025-01-21 17:38:58 +00:00
freakoverse moved this to Done (features) in Extra Features on 2025-01-22 17:42:43 +00:00
Sign in to join this conversation.
No description provided.