feat: dynamic categories system, and correct category display in all templates #22
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/dynamic-categories"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
-Dynamic categories
-Add/delete on settings page
Thanks!, will review for the next release
Pull Request Overview
This PR implements a dynamic categories system that replaces hardcoded category strings with a relational database model. The changes enable users to manage custom categories through a new settings interface while updating all templates to display category names correctly.
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 5 comments.
Show a summary per file
@ -7,22 +7,24 @@ import ()Remove the commented-out code. Dead code should be deleted rather than commented out to improve maintainability.
The foreign key constraint 'OnDelete:SET NULL' could cause data integrity issues. When a category is deleted, subscriptions will have null category references. Consider using 'OnDelete:RESTRICT' to prevent category deletion when subscriptions exist, or create a default 'Uncategorized' category.
@ -0,0 +1,21 @@{{if .}}The inline JavaScript in the onclick handler is complex and hard to maintain. Consider extracting this logic into a separate JavaScript function for better readability and reusability.
Similar to the Cancel button, this inline JavaScript should be extracted into a separate function for better maintainability and consistency with the settings.html implementation.
@ -591,0 +645,4 @@}).then(r => r.json()).then(loadCategories);};}});The CSS classes 'hidden inline' are contradictory. 'hidden' hides the element while 'inline' sets display to inline. Consider using just 'hidden' since the visibility toggle is handled by JavaScript.
@Klick3R-1 Any thoughts on the automated reviews, working on including this in this week's release.
@bscott Yes, I was planning to go through the suggestions — already accepted a few while on my phone earlier. I also realized I forgot to populate the default categories, so I’ll make sure to add that too. It should improve usability and help avoid confusion for some users.
Now its resolved, added creation of categories if there are none. also resolved suggestions made by copilot.
Thanks @Klick3R-1 , I'll review and test, planning on getting the next release out this weekend.