Skip to content

feat: enhance user profile handling with Perfil enum and feature flags#39

Merged
Im-Fran merged 9 commits intodevfrom
im-fran/patch/profesor
Mar 16, 2026
Merged

feat: enhance user profile handling with Perfil enum and feature flags#39
Im-Fran merged 9 commits intodevfrom
im-fran/patch/profesor

Conversation

@Im-Fran
Copy link
Member

@Im-Fran Im-Fran commented Mar 16, 2026

  • Modifica los feature flags para filtrar widgets usando perfiles
  • Limitar vista de datos a los profesores, ya que no poseen asignaturas o clases asignadas (como los estudiantes)
  • Limita BottomNavBar (Asignaturas) a estudiantes nada más.
  • Guarda estudiante en cache en AuthService
  • Evita cargar cosas si el perfil no es de estudiante

Copilot AI review requested due to automatic review settings March 16, 2026 00:19
@Im-Fran Im-Fran enabled auto-merge (squash) March 16, 2026 00:20
Copy link
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

Este PR introduce control por perfil de usuario (Perfil) para habilitar/ocultar funcionalidades (UI y cargas de datos) y agrega una caché en memoria del usuario autenticado para permitir evaluaciones síncronas (p. ej. en feature flags y navegación).

Changes:

  • Extiende FeatureFlag para soportar restricciones por Perfil (incluye constructor FeatureFlag.profiles y fallback opcional).
  • Restringe secciones y accesos rápidos (Horario/Clases de hoy/Asignaturas en curso) solo a Perfil.estudiante, y limita “Asignaturas” en el BottomNavBar a estudiantes.
  • Agrega caché en memoria del Estudiante en AuthService para decisiones de UI basadas en perfil sin await.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
lib/widgets/feature_flag.dart Añade restricción por perfiles y evaluación síncrona basada en AuthService.cachedEstudiante.
lib/styles/navigation/bottom_navbar.dart Filtra items de navegación por feature flag y perfil (Asignaturas solo estudiantes).
lib/core/models/navigation/navigation_item.dart Agrega perfiles a los items de navegación.
lib/core/models/user/perfil.dart Mejora enum Perfil y añade displayName.
lib/core/services/auth_service.dart Implementa caché en memoria del usuario logueado.
lib/screens/home/home_screen.dart Oculta “Clases de hoy” a no-estudiantes y evita cargar horario según perfil.
lib/screens/home/widgets/acceso_rapido.dart Restringe acceso rápido “Horario” a estudiantes.
lib/screens/asignaturas/lista_asignaturas_screen.dart Evita cargar asignaturas si el usuario no es estudiante y limita sección “en curso”.
lib/screens/asignaturas/widgets/acceso_rapido.dart Restringe accesos rápidos (Horario/Malla Histórica) a estudiantes.
lib/screens/notas/notas_screen.dart Evita cargar asignaturas con notas si el perfil no es estudiante.
lib/screens/profile/widgets/profile_header.dart Ajusta lógica de carrera a estudiantes y oculta el bloque de carrera según perfil.
lib/screens/profile/profile_screen.dart Ajusta llamada a ProfileHeader tras renombrar parámetro.
lib/screens/credencial/credencial_screen.dart Restringe el bloque principal de credencial a estudiantes/profesores.

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

You can also share your feedback on Copilot code review. Take the survey.

Im-Fran and others added 6 commits March 15, 2026 21:27
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@Im-Fran Im-Fran disabled auto-merge March 16, 2026 00:46
@Im-Fran Im-Fran merged commit e039a0d into dev Mar 16, 2026
2 checks passed
@Im-Fran Im-Fran deleted the im-fran/patch/profesor branch March 16, 2026 00:53
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.

2 participants