Skip to content

feat(projects): tab navigation on project show page - #4

Merged
Baruch4413 merged 3 commits into
mainfrom
ui/project-show-tabs
May 17, 2026
Merged

feat(projects): tab navigation on project show page#4
Baruch4413 merged 3 commits into
mainfrom
ui/project-show-tabs

Conversation

@Baruch4413

@Baruch4413 Baruch4413 commented May 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • Splits project detail page into three tabs: Equipo, Actividad, Comentarios
  • Project header and image gallery remain above the tab bar (always visible)
  • Comments are now lazy-loaded only when the Comentarios tab is activated
  • Adds projects.show.tabs.* i18n keys to both es and en lang files

Test plan

  • Visit /projects/:id — header, gallery visible; tab bar shows Equipo / Actividad / Comentarios
  • Equipo tab: progress bar, roles, team visible
  • Actividad tab: timeline visible
  • Comentarios tab: comments load on first activation, form works
  • Dark mode renders correctly
  • Mobile layout (< xl) renders correctly

Summary by CodeRabbit

  • New Features

    • Tabbed navigation on project pages: Team, Activity, and Comments views
    • Added a visible "Team members" section showing member avatars, names, and roles
  • Behavior Changes

    • Comments now load when opening the Comments tab (not on page load)
  • Localization

    • Added Spanish and English labels for the new tabs
  • Tests

    • Updated browser test to navigate via the Activity tab before posting updates

Review Change Stack

…s tabs

Split project detail content into three tabs to improve scannability.
Lazy-load comments on tab activation instead of on page load.
@coderabbitai

coderabbitai Bot commented May 17, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 7e5c0457-5574-4de6-a12b-088f8b47cae9

📥 Commits

Reviewing files that changed from the base of the PR and between c272bc1 and 285fac7.

📒 Files selected for processing (2)
  • resources/js/components/ui/proyectos/ProjectRoles.tsx
  • resources/js/pages/proyectos/show.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • resources/js/pages/proyectos/show.tsx

📝 Walkthrough

Walkthrough

The PR converts the project show page from a static layout into a tabbed interface with three tabs: team (equipo), activity (actividad), and comments (comentarios). Tab labels are translated in both English and Spanish, tab state drives conditional rendering of page sections, and comment loading is deferred until the comments tab is selected.

Changes

Tabbed Project Show Page

Layer / File(s) Summary
Tab label translations
lang/en/projects.php, lang/es/projects.php
English and Spanish translation files add show.tabs entries for the three tab labels used in tab navigation.
Tabbed state, types, imports, and tab bar
resources/js/pages/proyectos/show.tsx
Adds TabId type, activeTab state, imports cn utility, defines tabs array, moves comments loading into a useEffect that triggers on the comentarios tab, and renders the tab navigation UI with active/inactive styling.
Tab content rendering and team members grid
resources/js/pages/proyectos/show.tsx, resources/js/components/ui/proyectos/ProjectRoles.tsx
Implements equipo tab (CrowdfundingProgress, ProjectStageActions for owners, ProjectRoles) including a new flattened "Team members" grid, actividad tab renders ProjectTimeline, and comentarios tab conditionally shows loading skeleton or PostComments based on lazy-loaded state.
Browser test navigation update
tests/Browser/ProjectTimelineComposerTest.php
Test adds an initial click to the "Actividad" tab before continuing with the timeline composer interaction.

Sequence Diagram

sequenceDiagram
  participant User
  participant TabNav as Tab Navigation
  participant ShowPage as ProyectoShow Component
  participant Comments as Comments Loader
  User->>TabNav: Click "comentarios" tab
  TabNav->>ShowPage: setActiveTab("comentarios")
  ShowPage->>Comments: useEffect triggers loadComments()
  Comments->>Comments: fetch comments
  Comments-->>ShowPage: update commentsList & commentsLoading
  ShowPage-->>User: render PostComments or skeleton
Loading

🎯 3 (Moderate) | ⏱️ ~20 minutes

🐰 Three tabs to hop between,
Team, activity, comments seen,
Comments wait until they're called,
Team members listed in a clean green scene! 🥕✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(projects): tab navigation on project show page' is concise and clearly summarizes the main change—adding tab navigation to the project detail page.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ui/project-show-tabs

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
resources/js/pages/proyectos/show.tsx (1)

119-126: ⚡ Quick win

Add missing dependency to useEffect or refactor to silence exhaustive-deps.

The effect calls loadComments() but doesn't include it in the dependency array. While the code works due to the internal guard in loadComments, this violates the React exhaustive-deps rule and may trigger lint warnings.

♻️ Refactor to move logic inline
 useEffect(() => {
     if (activeTab === 'comentarios') {
-        loadComments().catch(() => {
-            setCommentsLoading(false);
-            setCommentsList([]);
-        });
+        (async () => {
+            if (commentsList !== null) return;
+            setCommentsLoading(true);
+            try {
+                const response = await fetch(fetchComments.url(project.id));
+                const data: Comment[] = await response.json();
+                setCommentsList(data);
+            } catch {
+                setCommentsList([]);
+            } finally {
+                setCommentsLoading(false);
+            }
+        })();
     }
-}, [activeTab]);
+}, [activeTab, commentsList, project.id]);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@resources/js/pages/proyectos/show.tsx` around lines 119 - 126, The useEffect
references loadComments but doesn't include it in the dependency array causing
exhaustive-deps warnings; fix by either adding loadComments to the dependency
array or refactoring the effect to declare the async logic inline (e.g., create
an async function inside the effect that calls loadComments() logic and uses
setCommentsLoading/setCommentsList) or wrap loadComments in useCallback so it
can be safely added to deps; update the effect to depend on [activeTab,
loadComments] if you choose to add it, or replace the call with the inline async
handler to silence the lint rule.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@resources/js/pages/proyectos/show.tsx`:
- Around line 119-126: The useEffect references loadComments but doesn't include
it in the dependency array causing exhaustive-deps warnings; fix by either
adding loadComments to the dependency array or refactoring the effect to declare
the async logic inline (e.g., create an async function inside the effect that
calls loadComments() logic and uses setCommentsLoading/setCommentsList) or wrap
loadComments in useCallback so it can be safely added to deps; update the effect
to depend on [activeTab, loadComments] if you choose to add it, or replace the
call with the inline async handler to silence the lint rule.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: de0ef590-c456-44db-b5ce-b6da616679ad

📥 Commits

Reviewing files that changed from the base of the PR and between 403d680 and c272bc1.

📒 Files selected for processing (4)
  • lang/en/projects.php
  • lang/es/projects.php
  • resources/js/pages/proyectos/show.tsx
  • tests/Browser/ProjectTimelineComposerTest.php

@Baruch4413
Baruch4413 merged commit 87111c7 into main May 17, 2026
3 checks passed
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