Skip to content

Comments

feat: add nested team routes with dynamic tab navigation#109

Merged
yesyash merged 5 commits intoRealDevSquad:developfrom
Hariom01010:feature/team-tabs-navigation
Jul 16, 2025
Merged

feat: add nested team routes with dynamic tab navigation#109
yesyash merged 5 commits intoRealDevSquad:developfrom
Hariom01010:feature/team-tabs-navigation

Conversation

@Hariom01010
Copy link
Contributor

@Hariom01010 Hariom01010 commented Jul 14, 2025

Date: 14 Jul 2024

Developer Name: @Hariom01010


Issue Ticket Number

Closes #108

Description

This PR aims at adding routes for team members, tasks and activities under teamId which is dynamic and passed as path parameter.

  • Created specific pages for [teamId]/tasks, [teamId]/members and [teamId]/activities
  • Defined a Layout.tsx for [teamId] root page
  • Moved the logic from page.tsx to layout.tsx and added redirect to [teamId].

Documentation Updated?

  • Yes
  • No

Under Feature Flag

  • Yes
  • No

Database Changes

  • Yes
  • No

Breaking Changes

  • Yes
  • No

Development Tested?

  • Yes
  • No

Screenshots

Screenshot 1
teamid.views.mp4

Test Coverage

Screenshot 1 image

Additional Notes

Description by Korbit AI

What change is being made?

Introduce nested team routes with dynamic tab navigation for the "teams" pages.

Why are these changes being made?

These changes enable a structured and dynamic user interface for accessing different sections (tasks, activities, members) of a team, enhancing navigation and user experience. This approach leverages component-based architecture with dynamic routing to organize team-specific data effectively.

Is this description stale? Ask me to generate a new description by commenting /korbit-generate-pr-description

- Added layout support under [teamId] to wrap child routes
- Implemented TeamTabsNavigation to render and highlight active tabs (tasks, members, activities)
- Passed teamId as param and handled routing with usePathname
@Hariom01010 Hariom01010 requested a review from yesyash July 14, 2025 12:27
@Hariom01010 Hariom01010 self-assigned this Jul 14, 2025
@coderabbitai
Copy link

coderabbitai bot commented Jul 14, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Summary by CodeRabbit

  • New Features

    • Introduced team-specific pages for activities, members, and tasks, accessible via dedicated tabs.
    • Added a navigation bar for seamless switching between tasks, activities, and members within a team.
    • Implemented a structured layout with a team header and quick access to team creation.
  • Improvements

    • The main team page now automatically redirects users to the tasks tab for a streamlined experience.

Walkthrough

This change introduces dynamic nested routes under /teams/[teamId]/ for tasks, activities, and members. It adds new page components for each view, a shared layout with navigation and header, and a navigation component to switch between tabs. The root team page now redirects to the tasks view.

Changes

Files Change Summary
app/(internal-routes)/teams/[teamId]/activities/page.tsx,
app/(internal-routes)/teams/[teamId]/members/page.tsx,
app/(internal-routes)/teams/[teamId]/tasks/page.tsx
Added new page components to render TeamActivity, TeamMembers, and a placeholder for Tasks.
app/(internal-routes)/teams/[teamId]/layout.tsx Added a layout component with header, team navigation, and children rendering.
app/(internal-routes)/teams/[teamId]/page.tsx Changed implementation to immediately redirect to /teams/[teamId]/tasks.
components/teams/TeamsNavigation.tsx Added TeamTabsNavigation component for tabbed navigation and dashboard header rendering.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Router
    participant Layout
    participant TeamTabsNavigation
    participant PageComponent

    User->>Router: Navigate to /teams/[teamId]/(tasks|activities|members)
    Router->>Layout: Render with teamId param
    Layout->>TeamTabsNavigation: Render navigation with teamId
    Layout->>PageComponent: Render nested page (Tasks, Activities, or Members)
Loading

Assessment against linked issues

Objective Addressed Explanation
Create nested routes under /teams/[teamId]/ for /tasks, /activities, /members (#108)
Render Task, Activity, and Team Members components in their respective routes (#108)
Integrate new pages with a shared layout and navigation (#108)

Possibly related PRs

Poem

In the warren of code, new tunnels appear,
Teams now have rooms for tasks, friends, and cheer.
With tabs to hop and layouts to share,
Every team’s journey is easy to compare.
🐇✨ Nested routes bloom, navigation in style—
This rabbit approves with a big, happy smile!


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@korbit-ai korbit-ai bot left a comment

Choose a reason for hiding this comment

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

Review by Korbit AI

Korbit automatically attempts to detect when you fix issues in new commits.
Category Issue Status
Documentation Remove redundant file path comment ▹ view ✅ Fix detected
Readability Nested Await in Template Literal ▹ view ✅ Fix detected
Design Hardcoded Navigation Routes ▹ view ✅ Fix detected
Design Non-standard Component Naming ▹ view ✅ Fix detected
Performance Unnecessary Runtime String Manipulation ▹ view ✅ Fix detected
Functionality Imprecise Tab Route Matching ▹ view ✅ Fix detected
Functionality Missing Tasks Implementation ▹ view
Functionality Misplaced team creation button ▹ view
Functionality Incorrect params typing in layout component ▹ view
Files scanned
File Path Reviewed
app/(internal-routes)/teams/[teamId]/tasks/page.tsx
app/(internal-routes)/teams/[teamId]/members/page.tsx
app/(internal-routes)/teams/[teamId]/activities/page.tsx
app/(internal-routes)/teams/[teamId]/page.tsx
app/(internal-routes)/teams/[teamId]/layout.tsx
components/teams/TeamsNavigation.tsx

Explore our documentation to understand the languages and file types we support and the files we ignore.

Check out our docs on how you can make Korbit work best for you and your team.

Loving Korbit!? Share us on LinkedIn Reddit and X

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 7

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2955562 and 2513ea2.

📒 Files selected for processing (6)
  • app/(internal-routes)/teams/[teamId]/activities/page.tsx (1 hunks)
  • app/(internal-routes)/teams/[teamId]/layout.tsx (1 hunks)
  • app/(internal-routes)/teams/[teamId]/members/page.tsx (1 hunks)
  • app/(internal-routes)/teams/[teamId]/page.tsx (1 hunks)
  • app/(internal-routes)/teams/[teamId]/tasks/page.tsx (1 hunks)
  • components/teams/TeamsNavigation.tsx (1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (3)
app/(internal-routes)/teams/[teamId]/activities/page.tsx (1)
components/teams/TeamActivity.tsx (1)
  • TeamActivity (51-58)
app/(internal-routes)/teams/[teamId]/members/page.tsx (1)
components/teams/TeamMember.tsx (1)
  • TeamMembers (53-101)
components/teams/TeamsNavigation.tsx (2)
components/teams/TeamDashboardHeader.tsx (2)
  • TeamTab (5-5)
  • TeamDashboardHeader (10-35)
lib/utils.ts (1)
  • cn (4-6)
🔇 Additional comments (8)
app/(internal-routes)/teams/[teamId]/members/page.tsx (1)

4-8: Clean and focused page component structure.

The component correctly imports and renders the TeamMembers component with minimal wrapper structure, which is appropriate for a page component.

app/(internal-routes)/teams/[teamId]/tasks/page.tsx (1)

2-2: Replace placeholder text with actual component.

Unlike the members and activities pages which render actual components (TeamMembers, TeamActivity), this page only displays placeholder text. This seems incomplete compared to the other tabs.

Consider implementing a proper TasksComponent or similar to maintain consistency with other tabs:

-  return <div>Tasks Render Here</div>
+  return (
+    <div>
+      <TasksComponent />
+    </div>
+  )

Should this page render a proper component instead of placeholder text?

app/(internal-routes)/teams/[teamId]/activities/page.tsx (1)

4-8: Consistent and correct page component structure.

The component follows the same pattern as the members page, correctly importing and rendering the TeamActivity component. This maintains consistency across the tab pages.

components/teams/TeamsNavigation.tsx (1)

14-35: Well-structured navigation component.

The component correctly implements tab navigation with proper styling, active state detection, and integration with the TeamDashboardHeader. The Link components and conditional styling work well together.

app/(internal-routes)/teams/[teamId]/page.tsx (1)

1-5: Clean redirect implementation.

The redirect logic is correctly implemented, properly awaiting the params and redirecting to the tasks tab as the default view. This aligns well with the new layout structure where the UI is handled by the layout component.

app/(internal-routes)/teams/[teamId]/layout.tsx (3)

1-6: LGTM: Clean import structure

The imports are well-organized and all necessary for the component functionality.


28-30: LGTM: Clean layout structure

The navigation and children rendering is well-structured. The TeamTabsNavigation component integration and children spacing look good.


19-20: Fix potential XSS vulnerability and improve UX

The direct rendering of teamId in the JSX poses a potential XSS risk and poor UX:

  1. Security: The teamId parameter should be sanitized before rendering
  2. UX: Consider fetching and displaying the actual team name instead of the raw ID
-        <h1 className="text-xl font-bold">Team: {teamId}</h1>
+        <h1 className="text-xl font-bold">Team: {encodeURIComponent(teamId)}</h1>

For better UX, consider fetching team data to display the actual team name.

Likely an incorrect or invalid review comment.

@Hariom01010 Hariom01010 requested a review from AnujChhikara July 16, 2025 11:08
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.

(feat): Add dynamic nested routes for team views (tasks, members, activities)

3 participants