Skip to content

feat: add more info to teacher's modal#1812

Open
PedroLunet wants to merge 35 commits intodevelopfrom
addmoreInfoToTeachersModal
Open

feat: add more info to teacher's modal#1812
PedroLunet wants to merge 35 commits intodevelopfrom
addmoreInfoToTeachersModal

Conversation

@PedroLunet
Copy link
Copy Markdown
Contributor

Closes #1794

image image

What changed

Professor model (sheet.dart, parser_course_unit_info.dart)

  • Added institutionalEmail and rooms fields to Professor
  • Professor.fromJson now extracts email and room data directly from the API response
  • When a professor appears in multiple classes, their email and rooms are merged into the existing record

Professor info modal (modal_professor_info.dart)

  • Email is fetched from the professor's SIGARRA profile page, with support for SIGARRA's anti-spam @ obfuscation (assembled via JavaScript onclick handlers)
  • Room info is extracted from SIGARRA profile page links and table rows
  • Email and room rows are always visible — shimmer while loading, if unavailable after fetch
  • Schedule row now navigates in-app instead of opening an external browser link

In-app professor schedule (schedule_page.dart, navigation_items.dart, main.dart)

  • Added professorLecturesProvider (autoDispose family) to fetch a professor's schedule
  • SchedulePage now accepts an optional professorCode to display a professor's schedule using the same layout as the student schedule (shimmer, empty state, week view)
  • Added ProfessorSchedulePageView as a secondary page with a back button and professor name as title
  • Registered the horario_docente route in NavigationItem and main.dart

How to test

  1. Navigate to a course unit and open the Classes tab
  2. Tap a professor to open the info modal
  3. Verify email and room show a shimmer while loading, then display the value or
  4. Tap the Schedule row — it should open the professor's schedule in-app, with shimmer while fetching and the correct lectures displayed

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). (no new strings — reuses existing email, room, schedule keys)
  • 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. (note: _buildProfessorSchedule / _buildStudentSchedule in schedule_page.dart are private helper methods returning widgets — consider extracting to dedicated widget classes)
  • Used ListView.builder for Long Lists. (N/A)
  • Controllers (TextEditingController, ...) are being disposed of in dispose() method. (N/A)

@PedroLunet PedroLunet requested a review from a team March 9, 2026 18:44
@pedroafmonteiro pedroafmonteiro changed the title Addmore info to teachers modal feat: add more info to teacher's modal Mar 9, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 7%. Comparing base (d2e3b63) to head (e26680f).
⚠️ Report is 1 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   #1812   +/-   ##
=======================================
- Coverage        7%      7%   -0%     
=======================================
  Files           38      38           
  Lines         1886    1888    +2     
=======================================
  Hits           125     125           
- Misses        1761    1763    +2     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Member

@pedroafmonteiro pedroafmonteiro left a comment

Choose a reason for hiding this comment

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

Thanks for this! Consider some important changes:

Comment thread packages/uni_app/lib/model/entities/course_units/sheet.dart Outdated
Comment thread packages/uni_app/lib/view/academic_path/schedule_page.dart
Comment thread packages/uni_app/lib/view/course_unit_info/widgets/modal_professor_info.dart Outdated
Copilot AI review requested due to automatic review settings March 23, 2026 13:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR expands the professor info modal to show additional details (email, rooms) and adds an in-app professor schedule page, improving parity with student info/schedule flows.

Changes:

  • Added ProfessorExtraInfo fetching/scraping to display professor email and rooms in the modal (with shimmer/placeholder states).
  • Introduced a dedicated professor schedule page + route (horario_docente) and navigation from the modal.
  • Extended the Professor model with institutionalEmail and rooms and attempted merging across occurrences.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/uni_app/lib/view/professor/professor_schedule_page.dart Adds professor schedule page + provider to fetch lectures for a professor.
packages/uni_app/lib/view/course_unit_info/widgets/shimmer_info_row.dart New shimmer row widget used while professor extra info loads.
packages/uni_app/lib/view/course_unit_info/widgets/modal_professor_info.dart Displays email/room rows and navigates to in-app professor schedule route.
packages/uni_app/lib/utils/navigation_items.dart Registers horario_docente navigation route constant.
packages/uni_app/lib/model/providers/riverpod/professor_info_provider.dart Adds Riverpod provider to fetch/scrape professor extra info.
packages/uni_app/lib/model/entities/course_units/sheet.dart Extends Professor entity with email/rooms fields and adjusts fromJson.
packages/uni_app/lib/main.dart Registers the professor schedule route and argument casting.
packages/uni_app/lib/controller/parsers/parser_course_unit_info.dart Uses new Professor.fromJson signature and merges class occurrences.
packages/uni_app/lib/controller/fetchers/professor_info_fetcher.dart Implements SIGARRA profile scraping for email and rooms.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/uni_app/lib/model/providers/riverpod/professor_info_provider.dart Outdated
Comment thread packages/uni_app/lib/model/entities/course_units/sheet.dart
Copy link
Copy Markdown
Member

@pedroafmonteiro pedroafmonteiro left a comment

Choose a reason for hiding this comment

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

Thanks for the changes. Consider this suggestions:

Comment thread packages/uni_app/lib/controller/fetchers/professor_info_fetcher.dart Outdated
Comment thread packages/uni_app/lib/view/professor/professor_schedule_page.dart Outdated
Comment thread packages/uni_app/lib/view/professor/professor_schedule_page.dart
@pedroafmonteiro pedroafmonteiro marked this pull request as draft April 2, 2026 12:55
auto-merge was automatically disabled April 2, 2026 12:55

Pull request was converted to draft

@PedroLunet PedroLunet marked this pull request as ready for review April 2, 2026 17:01
Copy link
Copy Markdown
Member

@pedroafmonteiro pedroafmonteiro left a comment

Choose a reason for hiding this comment

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

Just a few more changes! Thanks :)

Comment thread packages/uni_app/lib/model/providers/riverpod/professor_lectures_provider.dart Outdated
PedroLunet and others added 6 commits April 22, 2026 11:19
Simplifies the code by using Dart 3.10+ record syntax (professor, lectiveYear?)
instead of a custom params class. Records automatically handle equality and hashing.
Use the same .toSet().toList() deduplication approach as lectureProvider
to reduce code duplication. This relies on Lecture's equality implementation.
Replace hardcoded Colors.grey[300]/[100] with Theme.of(context).disabledColor
to properly support both light and dark themes. Aligns with other shimmer
widgets in the codebase.
- Use onSecondary color instead of primary for better contrast against
  secondary background in both light and dark modes
- Apply consistently to email, schedule, and shimmer icons
- Fixes low visibility of trailing caret icons in dark mode
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.

Add more teacher's information

3 participants