Skip to content

chore: performance improvements [wip]#1807

Draft
pedroafmonteiro wants to merge 6 commits intodevelopfrom
chore/performance-improvements
Draft

chore: performance improvements [wip]#1807
pedroafmonteiro wants to merge 6 commits intodevelopfrom
chore/performance-improvements

Conversation

@pedroafmonteiro
Copy link
Copy Markdown
Member

this description was generated by copilot because it writes better than me. it's still a work in progress and I'm waiting for some pull requests to be merged first before continuing the work on this one. feedback is greatly appreciated!

This introduces several improvements and refactorings to the academic path and course unit info features, focusing on data fetching, parsing, UI performance, and maintainability. The main changes include parallelizing network requests for course unit class information, refining HTML parsing logic for robustness, optimizing tabbed UI components to preserve state and improve navigation, and updating provider and model implementations for better consistency.

Data Fetching and Parsing Improvements

  • Refactored CourseUnitsInfoFetcher to fetch course unit class information in parallel using Future.wait, deduplicate classes by name, and handle network errors gracefully. This improves performance and reliability when loading course unit data.
  • Enhanced parseCourseUnitClasses to robustly parse class and student information from HTML, skip irrelevant or malformed sections, and only include valid student entries. This results in more accurate and resilient parsing of course unit data.

UI and State Management Enhancements

  • Updated tabbed views (CoursesPage, SchedulePage, ExamsPage) to use AutomaticKeepAliveClientMixin, preserving state when switching tabs for a smoother user experience. Also refactored tab initialization to use a single list for consistency.
  • Refactored timeline components (SchedulePageView, ExamsPageView) to use contentBuilder instead of static lists, and to enable tabs only when relevant data is present. This optimizes rendering and navigation in schedule and exams views.

Provider and Model Updates

  • Added an explicit build method to CourseUnitsInfoNotifier to ensure state is initialized correctly.
  • Implemented equality and hashCode overrides for CourseUnit to support reliable comparisons and usage in collections.

Review checklist

  • Terms and conditions reflect the changes

View Changes

  • Description has screenshots of the UI changes.
  • Tested both in light and dark mode.
  • New text is both in portuguese (PT) and english (EN).
  • Works in different text zoom levels.
  • Works in different screen sizes.

Performance

  • No helper functions to return widgets are added. New widgets are created instead.
  • Used ListView.builder for Long Lists.
  • Controllers (TextEditingController, ...) are beeing disposed of in dispose() method.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 7%. Comparing base (d531853) to head (3879379).
⚠️ Report is 179 commits behind head on develop.

❌ Your project check has failed because the head coverage (7%) is below the target coverage (70%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@           Coverage Diff           @@
##           develop   #1807   +/-   ##
=======================================
  Coverage        7%      7%           
=======================================
  Files           38      38           
  Lines         1831    1831           
=======================================
  Hits           121     121           
  Misses        1710    1710           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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