Repository navigation
Conversation
#91) A CategoriesProvider in the app layout serves GET /api/categories through useCategories(). Names, groups, kinds, icons and colors come from the DB; only a curated Lucide icon registry stays in code. Transactions, rules, import and analytics send and read category ids; legacy rule condition names are converted to ids when a rule is saved.
…aDev/KeepItSimple into feature/91-frontend-categories
…aDev/KeepItSimple into feature/91-frontend-categories
…aDev/KeepItSimple into feature/91-frontend-categories # Conflicts: # frontend/stores/transactionImport/TransactionImportContext.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 3 of 5 for #91, stacked on #229.
What
CategoriesProvider/useCategories()(frontend/stores/categories): the server layout fetchesGET /api/categoriesonce and passes it in.categories,byId(an unknown id falls back to Other),byKey,otherand the groups per tab.TransactionCategoryenum, the expense/income/movement lists,CategoryColorMap, the selector group definitions andformatCategoryLabel.createCategoryColors(hex)derives the badge colors.components/common/category/iconRegistry.ts: a curated Lucide map (seed icons plus extras for the PR 4 picker). It is the only category list left in code, because Lucide icons must be imported statically.?categoryId=), rules, import and analytics send and read ids.lib/models/Category.tsalso has the create/update/delete/usage calls used by PR 4.Why
groupcolumn, in seed order; custom categories go last in a "Custom" group.kind: Expense, Saving and Transfer in the expense tab; Income, Saving and Transfer in the income tab. This matches the old lists.analytics/utils.ts, which mirror the backend split.Screenshots
Transactions page with the category selector open (desktop 800 px, mobile 375 px).
Tested
bun run lintandbun run buildpass. The project has no frontend unit tests.categoryIdworks, as does changing a transaction to the custom category in the drawer;"Coffe"condition shows its name, and saving it stores"1"; a new rule targeting Pets savestargetCategoryId1000;Notes
?category=lose the filter (the param is nowcategoryId).Out of scope
🤖 Generated with Claude Code