feat(category): subcategory grid supports drag-to-reorder#294
Open
Syz87 wants to merge 2 commits into
Open
Conversation
added 2 commits
May 28, 2026 15:59
Prevents expense categories from being silently mapped to income categories with the same name during CSV import. Root cause: upsertCategory() WHERE clause only filtered by name, ignoring the kind parameter. When a category name existed in both expense and income (e.g. 'transfer'/'转账'), the function returned the first match regardless of kind. Fix: add c.kind.equals(kind) to the WHERE clause, ensuring upsert matches both name and kind before reusing an existing category.
Replace GridView.builder with ReorderableGridView.builder in the subcategory dialog, allowing users to long-press and drag subcategory cards to reorder them. - onReorder applies optimistic local update then persists to DB via existing updateCategorySortOrders() - Add/edit action buttons at end of grid excluded from drag - ValueKey added to DialogSubCategoryCard for stable identity
Owner
|
@Syz87 icon不要这么写死进去,而且这个有点丑,可以打包为图片集,但要注意版权问题。这里如果是支持二级分类拖拽就不要包含其他内容,其他内容单开。 |
15c27b2 to
13529ec
Compare
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.
功能
子分类弹窗中的网格支持长按拖拽排序。
改动
GridView.builder替换为ReorderableGridView.builder,新增onReorder回调。实现细节
sort_order到数据库updateCategorySortOrders()API,后端零改动