Skip to content

chore: improve some functionalities#132

Merged
npv12 merged 2 commits intomainfrom
npv12/txn
Jan 4, 2026
Merged

chore: improve some functionalities#132
npv12 merged 2 commits intomainfrom
npv12/txn

Conversation

@npv12
Copy link
Member

@npv12 npv12 commented Jan 4, 2026

Important

Enhance account and category analytics with transaction details and improve file handling in import statement modal.

  • AccountAnalytics.tsx:
    • Add AccountTransactions component to display latest 5 transactions per account.
    • Implement account filtering with DropdownMenu for account selection.
    • Enhance account expansion to show transaction details.
  • CategoryAnalytics.tsx:
    • Add CategoryTransactions component to display latest 5 transactions per category.
    • Implement category filtering with DropdownMenu for category selection.
    • Enhance category expansion to show transaction details.
  • ImportStatementModal.tsx:
    • Refactor validateFile to remove forBank parameter.
    • Add handleCancel to reset modal state and close modal.
    • Improve file selection and validation logic.
  • utils.ts:
    • Add getTransactionColor function to determine transaction color based on amount and theme.

This description was created by Ellipsis for e000796. You can customize this summary. It will automatically update as commits are pushed.

npv12 added 2 commits January 4, 2026 16:13
Signed-off-by: Pranav <pranav10121@gmail.com>
Signed-off-by: Pranav <pranav10121@gmail.com>
Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Caution

Changes requested ❌

Reviewed everything up to 62928f0 in 2 minutes and 12 seconds. Click for details.
  • Reviewed 774 lines of code in 4 files
  • Skipped 0 files when reviewing.
  • Skipped posting 6 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. frontend/components/custom/AccountAnalytics/AccountAnalytics.tsx:241
  • Draft comment:
    Consider memoizing derived data (e.g. filteredData, accountsWithBalances, accountsWithPercentages) using useMemo to avoid unnecessary recomputations on re-renders with large datasets.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 30% vs. threshold = 50% This is a code quality/performance suggestion. The rules state that "Comments that suggest code quality refactors are good! But only if they are actionable and clear." This comment is actionable and clear. However, it's also somewhat speculative - it says "with large datasets" which suggests this might not be a current issue. The rules also say "Do NOT make speculative comments, such as 'If X, then Y is an issue', Only comment if it is definitely an issue." This comment is conditional on having large datasets. Without evidence that this is actually causing performance problems, this could be considered premature optimization. The comment is about code that was changed (the filtering logic was added in this PR), so it does relate to the diff. While this is a reasonable performance suggestion, it's speculative about "large datasets" being a problem. Without evidence of actual performance issues, this could be premature optimization. The comment doesn't demonstrate that there's a definite problem, just a potential one under certain conditions. However, the comment is actionable and clear about what to do. It's a legitimate code quality suggestion that could prevent future issues. The filtering and mapping operations are indeed being recalculated on every render, and memoization is a standard React optimization pattern. This isn't asking for verification or explanation, it's suggesting a concrete improvement. This comment is speculative ("with large datasets") and suggests an optimization without evidence of an actual performance problem. According to the rules, speculative comments should be removed. This appears to be premature optimization advice rather than addressing a definite issue.
2. frontend/components/custom/CategoryAnalytics/CategoryAnalytics.tsx:167
  • Draft comment:
    Consider memoizing computed values (e.g. allCategoryIds, hasAllSelectedApplied, hasAllSelectedDraft) with useMemo to improve performance on large category lists.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
3. frontend/components/custom/CategoryAnalytics/CategoryAnalytics.tsx:293
  • Draft comment:
    Ensure consistent property names for category objects (using either 'name' or 'category_name') to avoid potential mismatches in dropdown vs. legend displays.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
4. frontend/components/custom/Modal/Statement/ImportStatementModal.tsx:309
  • Draft comment:
    The new handleCancel function resets many state variables. Consider abstracting this reset logic into a helper or custom hook if it’s reused, to keep the component simpler.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% The comment is suggesting a refactoring to make the code cleaner by extracting reset logic. However, looking at the diff, the handleCancel function was only moved (relocated in the file) and added to a dependency array - it wasn't actually modified. The comment appears to be about the existing code structure rather than about changes made in this PR. According to the rules, comments should be about code changes, not general refactoring suggestions for unchanged code. While the suggestion might have merit, it's not directly related to what was changed in this diff. The function was moved in the file, which could be considered a "change" that makes it more visible. Perhaps the reviewer noticed this function during the review and thought it was a good opportunity to suggest improvements. The suggestion is also actionable and clear, which is a positive quality for review comments. While the function was moved, the move was necessary for the dependency fix (adding handleCancel to submitUpload's dependency array). The comment is not about the move itself or the dependency fix - it's about the internal structure of the function, which wasn't changed. The rules clearly state to only comment on changes, and this is commenting on the existing implementation rather than the actual change made. This comment should be deleted. It's a refactoring suggestion about the internal implementation of handleCancel, but the function itself wasn't modified in this PR - it was only moved to fix a dependency issue. The comment is not about the actual changes made in the diff.
5. frontend/components/custom/Modal/Statement/ImportStatementModal.tsx:379
  • Draft comment:
    In submitUpload, the sequential file upload stops on first error. If acceptable, consider parallelizing uploads or handling partial failures based on your UX requirements.
  • Reason this comment was not posted:
    Comment was not on a location in the diff, so it can't be submitted as a review comment.
6. frontend/lib/utils.ts:25
  • Draft comment:
    Consider replacing the 'theme: string | undefined' parameter with a typed union (e.g. '"dark" | "light"') to enhance type safety in getTransactionColor.
  • Reason this comment was not posted:
    Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 30% vs. threshold = 50% This is a code quality refactor suggestion about type safety. The comment is actionable and clear - it suggests using a union type instead of string | undefined. However, I need to consider: 1) Is this obvious or unimportant? It's a reasonable type safety improvement. 2) Does it require a code change? Yes, it's suggesting a specific improvement. 3) Is it speculative? No, it's a concrete suggestion. The function only checks for "dark" so a union type would be more type-safe. This seems like a legitimate code quality suggestion that is actionable and clear. The comment doesn't know what the actual theme values are in the broader codebase - maybe there are other theme values beyond "dark" and "light", and the function intentionally handles them with the fallback. Without seeing how this function is called or what the theme system looks like, we can't be sure this suggestion is correct. That's a valid concern - we don't have visibility into the theme system or how this function is called. The suggestion assumes "light" is the only other theme value, but there could be others. Without seeing the broader context, we can't be certain this is the right type signature. Following the rule that we need STRONG EVIDENCE the comment is correct, and that we should delete if understanding requires more context, this should be deleted. Delete this comment. While it's a reasonable type safety suggestion in principle, we lack the context to know if the suggested union type ("dark" | "light") is correct. The function might need to handle other theme values, and without seeing the theme system or call sites, we can't verify this suggestion is appropriate.

Workflow ID: wflow_JK9sXHPjdx8rAHWf

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

if (draftSelectedIds.includes(accountId)) {
return;
}
setDraftSelectedIds([...draftSelectedIds, accountId]);
Copy link

Choose a reason for hiding this comment

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

In toggleAccountSelection, consider using a functional state update to avoid potential stale closures.

@npv12 npv12 merged commit 1b072b6 into main Jan 4, 2026
6 checks passed
@npv12 npv12 deleted the npv12/txn branch January 4, 2026 10:46
Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed e000796 in 27 seconds. Click for details.
  • Reviewed 28 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 2 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. frontend/components/custom/Modal/Statement/ImportStatementModal.tsx:306
  • Draft comment:
    Review the re-indentation of handleCancel. It now uses 2 spaces rather than the previous 4. Ensure this aligns with your project's coding style.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 1% None
2. frontend/components/custom/Modal/Statement/ImportStatementModal.tsx:414
  • Draft comment:
    Dependency array formatting has been improved for readability. Verify that all necessary dependencies are still included.
  • Reason this comment was not posted:
    Confidence changes required: 0% <= threshold 1% None

Workflow ID: wflow_pn3ncMdo8Qs7XjAn

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

npv12 added a commit that referenced this pull request Jan 4, 2026
…alytics

* 'main' of github.com:trainjumpers/expenses:
  chore: improve some functionalities (#132)
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.

1 participant