Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a new locale-aware, dynamic employee profile route and migrates existing “Hendrik” profile navigation to the new URL structure while keeping legacy links working via redirect.
Changes:
- Added
[locale]/employees/[slug]dynamic employee profile page with static params and metadata generation. - Updated team data links (EN/DE) to point to
/employees/hendrikand switchedTeamCardto use the locale-awareLink. - Introduced a legacy route handler at
[locale]/about-hendrikthat redirects to the new employee profile URL.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/data/en/team.json | Updates Hendrik link to new /employees/hendrik path. |
| src/data/de/team.json | Updates Hendrik link to new /employees/hendrik path. |
| src/components/about/TeamCard.tsx | Switches to locale-aware Link to keep team profile links localized. |
| src/app/[locale]/employees/[slug]/page.tsx | Adds the new dynamic employee profile page, static params, and metadata. |
| src/app/[locale]/about-hendrik/page.tsx | Adds a legacy redirect from about-hendrik to the new employee route. |
Comments suppressed due to low confidence (5)
src/app/[locale]/employees/[slug]/page.tsx:92
- These two absolutely-positioned illustration images appear decorative, but they have non-empty alt text. For accessibility, decorative images should typically use
alt=""(and optionallyaria-hidden) so they aren’t announced by screen readers.
<Image
className="absolute hidden lg:block lg:right-[15%] lg:top-[25%]"
alt="Circles"
src="/illustrations/circles.svg"
width={100}
height={100}
/>
<Image
className="absolute hidden lg:block lg:right-[31%] lg:top-[25%]"
alt="Arrow"
src="/illustrations/arrow-dashed.svg"
width={100}
height={100}
/>
src/app/[locale]/employees/[slug]/page.tsx:115
- The profile image uses a generic alt text (
"employee"). For accessibility and better UX, use a meaningful alt (e.g., the employee’s name) or an empty alt if the name is already conveyed and the image is purely decorative.
<Image
className="xl:w-77.5 xl:h-77.5 lg:w-66.25 lg:h-66.25 sm:w-77.5 sm:h-77.5 w-48.75 h-48.75 border border-purple rounded-full object-cover absolute top-[17%] xl:right-[10%] lg:right-[10.5%] sm:right-[9%] right-[11%]"
alt="employee"
src={member.picture}
width={310}
src/app/[locale]/about-hendrik/page.tsx:10
- New routing behavior is introduced here (new dynamic employee page and legacy redirect), but there are no corresponding Playwright e2e assertions. Adding e2e coverage for
/employees/:slug(EN unprefixed + DE prefixed) and/about-hendrikredirect would help prevent regressions, especially withlocalePrefix: 'as-needed'behavior.
import { redirect } from 'next/navigation'
export default async function AboutHendrikPage({
params,
}: {
params: Promise<{ locale: string }>
}) {
const { locale } = await params
redirect(`/${locale}/employees/hendrik`)
}
src/app/[locale]/about-hendrik/page.tsx:9
- The redirect hard-codes the locale segment (e.g.
/en/...). WithlocalePrefix: 'as-needed'in the routing config, the default locale should generally not be prefixed. Consider using the i18n navigation helper (redirectfrom@/i18n/routing) or building the target URL so thatenredirects to/employees/hendrikwhilederedirects to/de/employees/hendrik.
import { redirect } from 'next/navigation'
export default async function AboutHendrikPage({
params,
}: {
params: Promise<{ locale: string }>
}) {
const { locale } = await params
redirect(`/${locale}/employees/hendrik`)
src/app/[locale]/employees/[slug]/page.tsx:30
generateStaticParamshard-codes the locale list as['en', 'de']. Since the app already centralizes supported locales inrouting.locales, using that source here avoids stale builds if locales are added/removed later and keeps behavior consistent withsrc/app/[locale]/layout.tsx.
export async function generateStaticParams() {
const slugs = Array.from(new Set([...teamDataEn, ...teamDataDe].map((member) => member.id)))
return ['en', 'de'].flatMap((locale) =>
slugs.map((slug) => ({
locale,
slug,
}))
)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Daniel Ntege <danientege785@gmail.com>
Signed-off-by: Daniel Ntege <danientege785@gmail.com>
Signed-off-by: Daniel Ntege <danientege785@gmail.com>
be718ef to
b63f4bc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new dynamic employee profile page and updates routing to improve the handling of team member profiles, specifically for Hendrik. The changes include implementing a locale-aware employee page, updating team data links, and redirecting the old "about-hendrik" route to the new structure.
Routing and Page Structure Updates:
[locale]/employees/[slug], which fetches team member data based on the locale and slug, generates metadata, and displays the member’s information, including social links. (src/app/[locale]/employees/[slug]/page.tsxR1-R144)Data and Linking Consistency:
team.jsonfiles to use the new/employees/hendriklink instead of/about-hendrik/. [1] [2]LinkinTeamCard.tsxto use the localized routing utility for better internationalization support.