Skip to content

[16.0][IMP] budget_report: improve performance and code quality#494

Open
n3n wants to merge 1 commit into16.0from
16.0-imp-budget_report
Open

[16.0][IMP] budget_report: improve performance and code quality#494
n3n wants to merge 1 commit into16.0from
16.0-imp-budget_report

Conversation

@n3n
Copy link
Copy Markdown
Member

@n3n n3n commented Feb 10, 2026

Summary

  • Remove redundant children/lines from BudgetNode serialization to reduce JSON payload
  • Batch N+1 department queries using read_group (2 queries instead of N per page load)
  • Cache filter options on initial load instead of fetching on every data refresh
  • Optimize visibleRows visibility check from O(n²) to O(n) with Map-based lookup
  • Parallelize department RPC calls with Promise.all for improved responsiveness
  • Clean up debug console.log statements
  • Add loading spinner and empty state UX

Test plan

  • Open "สรุปการใช้งบประมาณภาพรวม" report
  • Verify loading spinner appears during data fetch
  • Verify all expand/collapse functionality works
  • Verify drill-down links open correct views
  • Test department filter selection
  • Check that no debug logs appear in browser console
  • Test with empty data to verify empty state message

…and code quality

- Remove redundant children/lines from BudgetNode.to_dict() to reduce JSON payload
- Remove dead has_descendant() method from BudgetNode
- Batch N+1 department queries using read_group (2 queries instead of N)
- Cache filter options on initial load instead of every refresh
- Optimize visibleRows visibility check from O(n²) to O(n) using Map
- Parallelize department RPC calls with Promise.all
- Remove debug console.log statements
- Add loading spinner and empty state UX
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