From 6a00995192058f2dbe44d6fbacdd2041cf843118 Mon Sep 17 00:00:00 2001 From: Baruch Espinoza Date: Sun, 17 May 2026 20:53:02 +0000 Subject: [PATCH 1/3] feat(projects): reorganize show page with Equipo/Actividad/Comentarios tabs Split project detail content into three tabs to improve scannability. Lazy-load comments on tab activation instead of on page load. --- lang/en/projects.php | 5 + lang/es/projects.php | 5 + resources/js/pages/proyectos/show.tsx | 159 ++++++++++++++++---------- 3 files changed, 108 insertions(+), 61 deletions(-) diff --git a/lang/en/projects.php b/lang/en/projects.php index 8d65c43..2303c1e 100644 --- a/lang/en/projects.php +++ b/lang/en/projects.php @@ -8,6 +8,11 @@ 'title' => '', 'activity' => '', 'comments' => '', + 'tabs' => [ + 'equipo' => 'Team', + 'actividad' => 'Activity', + 'comentarios' => 'Comments', + ], ], 'dashboard' => [ 'title' => '', diff --git a/lang/es/projects.php b/lang/es/projects.php index f998be2..952c5f0 100644 --- a/lang/es/projects.php +++ b/lang/es/projects.php @@ -8,6 +8,11 @@ 'title' => 'Proyecto', 'activity' => 'Actividad del proyecto', 'comments' => 'Comentarios', + 'tabs' => [ + 'equipo' => 'Equipo', + 'actividad' => 'Actividad', + 'comentarios' => 'Comentarios', + ], ], 'dashboard' => [ 'title' => 'Dashboard', diff --git a/resources/js/pages/proyectos/show.tsx b/resources/js/pages/proyectos/show.tsx index 4abe349..685780c 100644 --- a/resources/js/pages/proyectos/show.tsx +++ b/resources/js/pages/proyectos/show.tsx @@ -25,6 +25,7 @@ import ProjectTimeline from '@/components/ui/proyectos/ProjectTimeline'; import { type TimelineEntry } from '@/components/ui/proyectos/ProjectTimelineEntry'; import WelcomeSidebar from '@/components/ui/WelcomeSidebar'; import { t } from '@/lib/i18n'; +import { cn } from '@/lib/utils'; interface ProjectImage { id: number; @@ -80,6 +81,8 @@ interface ProyectoShowProps { timeline: TimelineData; } +type TabId = 'equipo' | 'actividad' | 'comentarios'; + export default function ProyectoShow({ project, post, @@ -91,6 +94,7 @@ export default function ProyectoShow({ const isAuthenticated = !!auth?.user; const [sidebarOpen, setSidebarOpen] = useState(false); + const [activeTab, setActiveTab] = useState('equipo'); const [commentsList, setCommentsList] = useState(null); const [commentsLoading, setCommentsLoading] = useState(false); @@ -113,11 +117,19 @@ export default function ProyectoShow({ }; useEffect(() => { - loadComments().catch(() => { - setCommentsLoading(false); - setCommentsList([]); - }); - }, []); + if (activeTab === 'comentarios') { + loadComments().catch(() => { + setCommentsLoading(false); + setCommentsList([]); + }); + } + }, [activeTab]); + + const tabs: { id: TabId; labelKey: string }[] = [ + { id: 'equipo', labelKey: 'projects.show.tabs.equipo' }, + { id: 'actividad', labelKey: 'projects.show.tabs.actividad' }, + { id: 'comentarios', labelKey: 'projects.show.tabs.comentarios' }, + ]; return (
@@ -171,71 +183,96 @@ export default function ProyectoShow({ isOwner={isOwner} projectId={project.id} /> +
- {/* Progress (with stage transition actions for owner) */} -
- - {isOwner && - project.allowedTransitions.length > 0 && ( - - )} - -
+ {/* Tab navigation */} +
+ +
- {/* Roles */} - +
+ {/* Tab: Equipo */} + {activeTab === 'equipo' && ( +
+ {/* Progress (with stage transition actions for owner) */} + + {isOwner && + project.allowedTransitions.length > 0 && ( + + )} + - {/* Team */} - - - {/* Timeline */} -
-

- {t('projects.show.activity')} -

- -
+ {/* Roles buscados */} + - {/* Comments */} -
-

- {t('projects.show.comments')} -

- {commentsLoading ? ( -
-
-
-
- ) : commentsList !== null ? ( -
+ {/* Equipo del proyecto */} + +
+ )} + + {/* Tab: Actividad */} + {activeTab === 'actividad' && ( +
+ +
+ )} + + {/* Tab: Comentarios */} + {activeTab === 'comentarios' && ( +
+ {commentsLoading ? ( +
+
+
+
+ ) : commentsList !== null ? ( -
- ) : null} -
+ ) : null} +
+ )}
From c272bc1e511e0ced3e3784ef2216986b1fdbdf5a Mon Sep 17 00:00:00 2001 From: Baruch Espinoza Date: Sun, 17 May 2026 20:56:48 +0000 Subject: [PATCH 2/3] fix(tests): click Actividad tab before timeline composer interaction --- tests/Browser/ProjectTimelineComposerTest.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/Browser/ProjectTimelineComposerTest.php b/tests/Browser/ProjectTimelineComposerTest.php index d6843a6..c446e49 100644 --- a/tests/Browser/ProjectTimelineComposerTest.php +++ b/tests/Browser/ProjectTimelineComposerTest.php @@ -22,6 +22,7 @@ ->press('Iniciar sesión'); visit("/projects/{$post->id}") + ->click('Actividad') ->click('Actualización') ->fill('body', 'shipping the timeline composer') ->press('Publicar') From 285fac7c65b96d60e7a02c03e91d1b1fad4bf363 Mon Sep 17 00:00:00 2001 From: Baruch Espinoza Date: Sun, 17 May 2026 21:21:18 +0000 Subject: [PATCH 3/3] feat(projects): merge team grid into Roles buscados card --- .../components/ui/proyectos/ProjectRoles.tsx | 35 +++++++++++++++++++ resources/js/pages/proyectos/show.tsx | 3 -- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/resources/js/components/ui/proyectos/ProjectRoles.tsx b/resources/js/components/ui/proyectos/ProjectRoles.tsx index cdf5d6a..45138c7 100644 --- a/resources/js/components/ui/proyectos/ProjectRoles.tsx +++ b/resources/js/components/ui/proyectos/ProjectRoles.tsx @@ -439,6 +439,41 @@ export default function ProjectRoles({ />
)} + + {/* Team members */} + {(() => { + const members = roles.flatMap((role) => + role.volunteers.map((v) => ({ ...v, roleTitle: role.title })), + ) + if (members.length === 0) return null + return ( +
+

{t('projects.team.title')}

+
    + {members.map((member) => ( +
  • + {member.avatarUrl ? ( + + ) : ( +
    + {member.name.charAt(0).toUpperCase()} +
    + )} +

    {member.name}

    +

    {member.roleTitle}

    +
  • + ))} +
+
+ ) + })()}
- {/* Equipo del proyecto */} - )}