fix(overview): show recent transactions for selected year#77
Merged
Conversation
8 tasks
The overview table re-filtered server-fetched recent transactions to only those within the last 30 days of today's wall-clock date. When the user viewed a non-current year — or when the current year had no transactions in the last 30 days — the table showed "暂无交易记录,请导入数据" even though the stat cards and chart above rendered non-zero data for the same year. The server already returns the 10 most recent transactions for the selected year, sorted by date desc. Drop the client-side date filter and just render what the server returns.
42638df to
0940a59
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.
Summary
The overview page's "最近交易记录" table showed
暂无交易记录,请导入数据even when the stat cards and trend chart above were rendering non-zero data for the same year. Root cause:src/app/overview-client.tsxre-filtered the server-fetched recent transactions to only those within the last 30 days of today's wall-clock date — so any non-current year (or a current year with no activity in the last 30 days) was wiped out client-side.The server already returns the 10 most recent transactions for
selectedYear, sorteddate DESC, created_at DESC. Drop the client-side date filter and render what the server returns. Regression came from commit 3d26006feat(overview): show last month's transactions instead of top 10.Linked issue: STU-523 — 财务概览页面不加载交易数据问题.
Test plan
bun run lintbun run typecheckbun run test— 945 / 945 passed/for a year with prior-year-only data and confirm the table renders recent transactions instead of the empty-state message.