Repository navigation
Translation support - #18
Conversation
…ng and localized dictionaries
… and add OpenGraph images for documentation pages
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds Bengali-first i18n infra (constants, i18n, typed dictionaries, middleware), converts layouts/pages/components to language-aware routes, makes metadata/sitemap/robots and OG tooling locale-aware, adds English MDX content, and provides translation documentation and scripts. ChangesBengali-default internationalization rollout
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
|
There was a problem hiding this comment.
Actionable comments posted: 9
🧹 Nitpick comments (2)
src/components/language-flag-dropdown.tsx (1)
11-11: ⚡ Quick winUse the project
cnutility import path.Import
cnfrom@/lib/cnhere to match the project’s class-merging contract.As per coding guidelines,
src/**/*.tsx: use custom component utilities fromsrc/lib/cn.tsfor class merging.🤖 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 `@src/components/language-flag-dropdown.tsx` at line 11, The import for the class-merge utility in language-flag-dropdown.tsx currently pulls `cn` from "`@/lib/utils`"; change it to import `cn` from the project's canonical module "`@/lib/cn`" so the component uses the standard class-merging implementation (update the import statement that references `cn` in this file).src/components/language-toggle.tsx (1)
10-13: ⚡ Quick winUse
@/lib/cnfor class merging in this TSX component.This import bypasses the project’s class-merging utility contract and can diverge merge behavior from the rest of the UI.
Suggested diff
-import { cn } from "`@/lib/utils`"; +import { cn } from "`@/lib/cn`";As per coding guidelines, "
src/**/*.tsx: Configure Tailwind via@tailwindcss/postcssplugin and use custom component utilities fromsrc/lib/cn.tsfor class merging".🤖 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 `@src/components/language-toggle.tsx` around lines 10 - 13, The component imports the class-merge helper from "`@/lib/utils`" instead of the project standard "`@/lib/cn`"; update the import in language-toggle.tsx to import the cn function from "`@/lib/cn`" (keeping the existing symbol name `cn`), verify any usages of `cn(...)` in the LanguageToggle component remain unchanged and type-check, and ensure no other helper methods from "`@/lib/utils`" are relied on in this file.
🤖 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.
Inline comments:
In `@CLAUDE.md`:
- Line 96: Update the CLAUDE.md OG images line to reflect actual behavior of
scripts/generate-og-images.ts and generate-index-og.ts: state that for the
default locale (Bengali) files are written to public/og/sd/... (unprefixed),
while for all other entries in LOCALES output is written under
public/og/<lang>/sd/...; mention that the scripts read *.<lang>.mdx (falling
back to the Bengali title) and produce the two distinct paths accordingly.
- Around line 73-82: Update the intra-file routing guidance so every page route
is shown under the `[lang]` segment: change the docs paths that currently
reference `src/app/sd/[[...slug]]/page.tsx` and `src/app/sd/layout.tsx` to the
localized equivalents under `src/app/[lang]/sd/` (e.g.,
`src/app/[lang]/sd/[[...slug]]/page.tsx` and `src/app/[lang]/sd/layout.tsx`),
and clarify that the root layout is `src/app/[lang]/layout.tsx` (there is no
`src/app/layout.tsx`); keep the locale-independent API/robots/sitemap entries
as-is.
In `@content/sd/introduction.en.mdx`:
- Around line 4-11: The frontmatter tags in content/sd/introduction.en.mdx are
too generic; update the tags array (the existing "tags:" block) to include
page-specific English SEO phrases such as "system design introduction", "system
design basics", "bangla system design", and "software architecture fundamentals"
alongside the current tags so the MDX follows the content/sd/**/*.mdx guideline
to bridge English search queries with Bengali content; keep the existing generic
tags and append these new, query-aligned terms.
In `@scripts/generate-og-images.ts`:
- Around line 198-206: The OG cleanup step in scripts/generate-og-images.ts (the
block using LOCALES, ogDirForLocale and filterArg) removes public/og/.../sd
recursively including sd/index/image.png even though generate-index-og.ts later
recreates those; fix by either adjusting the generate-og npm script in
package.json to run generate-index-og.ts after scripts/generate-og-images.ts, or
change the cleanup in scripts/generate-og-images.ts to skip removing any
sd/index directory (e.g., detect and preserve path segments matching "sd/index"
instead of removing the entire sd tree) so that slug === "index" outputs from
generate-index-og.ts are not deleted.
In `@src/app/`[lang]/layout.tsx:
- Around line 6-17: The layout currently imports and instantiates
Bricolage_Grotesque into the variable bricolage and sets CSS variable
--font-bricolage; replace that with the required Outfit font and the correct CSS
variable names: import Outfit from next/font/google (use the exported name used
in repo), create an outfit const (e.g., const outfit = Outfit({...})) with the
same options (latin subset, appropriate weights, display: "swap", preload: true)
and set variable: "--font-outfit"; also ensure Noto_Sans_Bengali is instantiated
with variable: "--font-bengali" (not --font-bricolage) so global styles expect
--font-outfit and --font-bengali; update any usage of bricolage or
--font-bricolage elsewhere in this file (and the other referenced block at lines
~77-90) to use outfit and the new CSS variable names.
In `@src/components/language-flag-dropdown.tsx`:
- Line 25: The aria-label on the language switcher is hardcoded ("Change
language"); replace it with a localized string from the app dictionaries by
importing and using getDictionary(lang) and the appropriate key (e.g.,
languageSwitcherLabel) from the JSON dictionaries
(src/dictionaries/{bn,en}.json) inside the LanguageFlagDropdown component so the
aria-label is populated from the returned dictionary for the current lang;
update dictionaries to include the new key if missing and ensure the component
reads the current lang and passes dict.languageSwitcherLabel into the aria-label
prop.
In `@src/components/language-toggle.tsx`:
- Line 30: Replace the hardcoded aria-label in the LanguageToggle component with
a localized string: add a key like "changeLanguage" to both
src/dictionaries/en.json and src/dictionaries/bn.json, load the dictionary via
getDictionary(lang) (or accept the passed-in dict/lang prop per the component
pattern) and use that dictionary key for the aria-label on the trigger element
instead of the literal "Change language"; update the LanguageToggle component to
reference the dictionary key (e.g., dict.changeLanguage) so the aria-label is
localized for both EN and BN.
In `@src/lib/layout.shared.tsx`:
- Around line 32-38: In baseOptions, normalize the incoming lang once and use
that normalized value for both metadata lookup and nav.url to avoid mismatched
meta and URL; e.g., compute a normalizedLocale (using LOCALE_META[lang as
Locale] ?? LOCALE_META.bn to decide locale key or derive 'bn' fallback) and then
use that normalizedLocale to get meta and to build nav.url (so nav.url uses "/"
for 'bn' and `/${normalizedLocale}` for others) ensuring consistency between
meta and URL.
In `@TRANSLATING.md`:
- Line 21: The in-page anchor `[Add a new language](`#add-a-new-language`)`
doesn't match the actual heading `## C. Add a new language`, so update either
the link or the heading for consistency: either change the link to `[Add a new
language](`#c-add-a-new-language`)` to match the rendered anchor for `## C. Add a
new language`, or rename the heading to `## Add a new language` so the existing
`#add-a-new-language` fragment works; ensure you update the exact markdown text
`## C. Add a new language` or the link target
`#add-a-new-language`/`#c-add-a-new-language` accordingly.
---
Nitpick comments:
In `@src/components/language-flag-dropdown.tsx`:
- Line 11: The import for the class-merge utility in language-flag-dropdown.tsx
currently pulls `cn` from "`@/lib/utils`"; change it to import `cn` from the
project's canonical module "`@/lib/cn`" so the component uses the standard
class-merging implementation (update the import statement that references `cn`
in this file).
In `@src/components/language-toggle.tsx`:
- Around line 10-13: The component imports the class-merge helper from
"`@/lib/utils`" instead of the project standard "`@/lib/cn`"; update the import in
language-toggle.tsx to import the cn function from "`@/lib/cn`" (keeping the
existing symbol name `cn`), verify any usages of `cn(...)` in the LanguageToggle
component remain unchanged and type-check, and ensure no other helper methods
from "`@/lib/utils`" are relied on in this file.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: a5dd9d5c-c61d-4761-8adc-b6add5835a7e
⛔ Files ignored due to path filters (33)
public/flags/bd.svgis excluded by!**/*.svgpublic/flags/us.svgis excluded by!**/*.svgpublic/og/en/sd/about/image.pngis excluded by!**/*.pngpublic/og/en/sd/caching/benefits/image.pngis excluded by!**/*.pngpublic/og/en/sd/caching/challenges/image.pngis excluded by!**/*.pngpublic/og/en/sd/caching/eviction/image.pngis excluded by!**/*.pngpublic/og/en/sd/caching/image.pngis excluded by!**/*.pngpublic/og/en/sd/caching/invalidation/image.pngis excluded by!**/*.pngpublic/og/en/sd/caching/strategies/image.pngis excluded by!**/*.pngpublic/og/en/sd/cdn/benefits/image.pngis excluded by!**/*.pngpublic/og/en/sd/cdn/how-it-works/image.pngis excluded by!**/*.pngpublic/og/en/sd/cdn/image.pngis excluded by!**/*.pngpublic/og/en/sd/cdn/push-vs-pull/image.pngis excluded by!**/*.pngpublic/og/en/sd/data-partitioning/image.pngis excluded by!**/*.pngpublic/og/en/sd/data-partitioning/sharding-techniques/image.pngis excluded by!**/*.pngpublic/og/en/sd/data-partitioning/trade-offs/image.pngis excluded by!**/*.pngpublic/og/en/sd/data-partitioning/types/image.pngis excluded by!**/*.pngpublic/og/en/sd/hook/image.pngis excluded by!**/*.pngpublic/og/en/sd/introduction/image.pngis excluded by!**/*.pngpublic/og/en/sd/load-balancer/benefits/image.pngis excluded by!**/*.pngpublic/og/en/sd/load-balancer/how-it-works/image.pngis excluded by!**/*.pngpublic/og/en/sd/load-balancer/image.pngis excluded by!**/*.pngpublic/og/en/sd/load-balancer/types/image.pngis excluded by!**/*.pngpublic/og/en/sd/networking/http-versions/image.pngis excluded by!**/*.pngpublic/og/en/sd/networking/http-vs-https/image.pngis excluded by!**/*.pngpublic/og/en/sd/networking/image.pngis excluded by!**/*.pngpublic/og/en/sd/networking/tcp-vs-udp/image.pngis excluded by!**/*.pngpublic/og/en/sd/replication/image.pngis excluded by!**/*.pngpublic/og/en/sd/replication/methods/image.pngis excluded by!**/*.pngpublic/og/en/sd/replication/redundancy/image.pngis excluded by!**/*.pngpublic/og/en/sd/replication/replication/image.pngis excluded by!**/*.pngpublic/og/en/sd/scaling/image.pngis excluded by!**/*.pngpublic/og/en/sd/what-is-system-design/image.pngis excluded by!**/*.png
📒 Files selected for processing (32)
.gitignoreCLAUDE.mdCONTRIBUTING.mdREADME.mdTRANSLATING.mdcontent/sd/introduction.en.mdxcontent/sd/meta.en.jsonscripts/generate-index-og.tsscripts/generate-og-images.tssrc/app/[lang]/(home)/layout.tsxsrc/app/[lang]/(home)/page.tsxsrc/app/[lang]/layout.tsxsrc/app/[lang]/sd/[[...slug]]/page.tsxsrc/app/[lang]/sd/layout.tsxsrc/app/actions.tssrc/app/api/unsubscribe/route.tssrc/app/global.csssrc/app/layout.tsxsrc/app/robots.tssrc/app/sitemap.tssrc/components/ai/page-actions.tsxsrc/components/language-flag-dropdown.tsxsrc/components/language-toggle.tsxsrc/components/subscribe-modal.tsxsrc/dictionaries/bn.jsonsrc/dictionaries/en.jsonsrc/lib/constants.tssrc/lib/dictionaries.tssrc/lib/i18n.tssrc/lib/layout.shared.tsxsrc/lib/source.tssrc/proxy.ts
💤 Files with no reviewable changes (1)
- src/app/layout.tsx
…builder to support clean root paths
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/app/[lang]/layout.tsx (1)
38-39: ⚡ Quick winLocalize the description using
getDictionary(lang).The description is currently hardcoded with Bengali and English text, which doesn't adapt to the user's locale. Server components should call
getDictionary(lang)to access locale-specific translations.💡 Suggested implementation
export async function generateMetadata({ params, }: LayoutProps<"/[lang]">): Promise<Metadata> { const { lang } = await params; const meta = LOCALE_META[lang as Locale] ?? LOCALE_META.bn; + const dict = await getDictionary(lang); return { title: { template: `%s | ${meta.siteName}`, default: meta.siteName, }, - description: - "মন্টু মিয়াঁর সিস্টেম ডিজাইন - A System Design Book in Bengali. Learn system design concepts with simple analogies.", + description: dict.metadata.description,Ensure
src/dictionaries/bn.jsonandsrc/dictionaries/en.jsoninclude ametadata.descriptionfield with locale-appropriate text.As per coding guidelines, server components should call
getDictionary(lang)directly to access UI string translations fromsrc/dictionaries/{lang}.json.🤖 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 `@src/app/`[lang]/layout.tsx around lines 38 - 39, Update the hardcoded metadata.description in the exported metadata in layout.tsx to load locale-specific text by calling getDictionary(lang) inside the server component; specifically import and call getDictionary(lang) and use the returned dictionary's metadata.description (e.g., dict.metadata.description) instead of the hardcoded string so the description is localized for both bn and en dictionaries. Ensure src/dictionaries/bn.json and src/dictionaries/en.json contain metadata.description keys.
🤖 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 `@src/app/`[lang]/layout.tsx:
- Around line 38-39: Update the hardcoded metadata.description in the exported
metadata in layout.tsx to load locale-specific text by calling
getDictionary(lang) inside the server component; specifically import and call
getDictionary(lang) and use the returned dictionary's metadata.description
(e.g., dict.metadata.description) instead of the hardcoded string so the
description is localized for both bn and en dictionaries. Ensure
src/dictionaries/bn.json and src/dictionaries/en.json contain
metadata.description keys.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: eac2adeb-861e-4641-993c-552560b3c2d4
📒 Files selected for processing (2)
src/app/[lang]/layout.tsxsrc/lib/constants.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- src/lib/constants.ts
- Localize language-switcher aria-labels via dictionaries (a11y.changeLanguage) - Import cn from @/lib/cn (project convention) in the switcher components - Normalize unknown locale once in baseOptions (consistent meta + nav.url) - Chain generate-index-og after generate-og-images so the index OG isn't deleted - Docs: fix stale src/app/sd paths -> [lang], clarify per-locale OG output paths, update font note to Bricolage Grotesque (intentional), fix TRANSLATING anchor Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… balancing, caching, CDN, and replication topics
- Replace generic intro.en.mdx tags with page-specific English SEO keywords (CodeRabbit nitpick on PR #18) - TRANSLATING.md: add a prominent 'tell the story, not the words' section documenting the adaptive, story-based translation approach (slang/idioms/ cultural references localized, voice preserved, famous quotes restored) - TRANSLATING.md: update the tags guidance to recommend specific English SEO tags Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (3)
content/sd/cdn/index.en.mdx (1)
1-12: ⚡ Quick winAdd
descriptionfield for better SEO and social sharing.While the
descriptionfield is optional in the frontmatter schema, it's used by the metadata generator to populate OpenGraph and Twitter card descriptions. Without it, social media previews and search results will lack a description.Consider adding a description like:
--- title: "CDN, Now What?" +description: "Understanding Content Delivery Networks and how they reduce latency" tags: - Content Delivery NetworkBased on learnings: Create MDX files in
content/sd/directory with required frontmatter fields:title(required, Bengali),description(optional, Bengali), andtags(optional, English keywords array)🤖 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 `@content/sd/cdn/index.en.mdx` around lines 1 - 12, The frontmatter for the MDX file is missing a description field used by the metadata generator; update the frontmatter to include a Bengali "description" key alongside the existing "title" and "tags" entries (keep "title" in Bengali as required and "tags" as an English array), populating "description" with a concise Bengali sentence suitable for OpenGraph/Twitter preview so social previews and search results have a proper description.content/sd/cdn/how-it-works.en.mdx (1)
1-11: ⚡ Quick winAdd
descriptionfield for better SEO and social sharing.The
descriptionfield is used by the metadata generator for OpenGraph and Twitter card descriptions. Adding one will improve social media previews and search results.Consider:
--- title: "How Does a CDN Actually Work?" +description: "Understanding Origin and Edge servers in CDN architecture" tags: - CDN ArchitectureBased on learnings: Create MDX files in
content/sd/directory with required frontmatter fields:title(required, Bengali),description(optional, Bengali), andtags(optional, English keywords array)🤖 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 `@content/sd/cdn/how-it-works.en.mdx` around lines 1 - 11, The MDX frontmatter is missing the optional description field used by the metadata generator; update the frontmatter block (the YAML between the leading --- markers that currently contains title and tags) to include a description: "<short Bengali description>" so that OpenGraph/Twitter cards and SEO use it; ensure you keep the existing title and tags keys unchanged and add description as a plain string value in Bengali.content/sd/cdn/push-vs-pull.en.mdx (1)
1-11: ⚡ Quick winAdd
descriptionfield for better SEO and social sharing.The
descriptionfield is used by the metadata generator for OpenGraph and Twitter card descriptions. Adding one will improve social media previews and search results.Consider:
--- title: "Push or Pull?" +description: "Comparing Pull and Push CDN caching strategies" tags: - Push CDNBased on learnings: Create MDX files in
content/sd/directory with required frontmatter fields:title(required, Bengali),description(optional, Bengali), andtags(optional, English keywords array)🤖 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 `@content/sd/cdn/push-vs-pull.en.mdx` around lines 1 - 11, The frontmatter is missing a description field used by the metadata generator; update the MDX frontmatter (near the existing title and tags fields) to include a description: provide a short Bengali sentence for the description key (YAML string) so OpenGraph/Twitter cards get a proper preview; keep title in Bengali and tags as an English keywords array and add description between or after title/tags in the YAML block.
🤖 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.
Inline comments:
In `@content/sd/load-balancer/types.en.mdx`:
- Around line 4-14: The frontmatter "tags" array currently contains 11 entries
which exceeds the 4–8 keyword guideline; reduce and replace it with 4–8 focused,
English technical keywords that map Bengali content to common search queries.
Edit the frontmatter tags in content/sd/load-balancer/types.en.mdx (the "tags"
array) to remove lower-value or redundant terms and keep core concepts like
"Load Balancer", "Hardware Load Balancer" OR "Software Load Balancer" (choose
one), "Layer 4 Load Balancer" OR "Layer 7 Load Balancer" (choose the most
relevant), and one or two platform/tool keywords such as "Nginx" or
"HAProxy"/"AWS" so the array contains between 4 and 8 concise tags.
In `@content/sd/networking/http-versions.en.mdx`:
- Around line 4-13: The frontmatter tags array currently has nine entries;
reduce them to 4–8 focused SEO keywords by removing redundancies and less
essential items. Edit the frontmatter tags array to keep core technical terms
such as: "HTTP", "HTTP/2", "HTTP/3", "QUIC", "TCP", and "Networking" (or pick a
subset of 4–6 from these), and remove redundant or overlapping tags like "HTTP
Versions" and any least-relevant terms to meet the 4–8 guideline.
---
Nitpick comments:
In `@content/sd/cdn/how-it-works.en.mdx`:
- Around line 1-11: The MDX frontmatter is missing the optional description
field used by the metadata generator; update the frontmatter block (the YAML
between the leading --- markers that currently contains title and tags) to
include a description: "<short Bengali description>" so that OpenGraph/Twitter
cards and SEO use it; ensure you keep the existing title and tags keys unchanged
and add description as a plain string value in Bengali.
In `@content/sd/cdn/index.en.mdx`:
- Around line 1-12: The frontmatter for the MDX file is missing a description
field used by the metadata generator; update the frontmatter to include a
Bengali "description" key alongside the existing "title" and "tags" entries
(keep "title" in Bengali as required and "tags" as an English array), populating
"description" with a concise Bengali sentence suitable for OpenGraph/Twitter
preview so social previews and search results have a proper description.
In `@content/sd/cdn/push-vs-pull.en.mdx`:
- Around line 1-11: The frontmatter is missing a description field used by the
metadata generator; update the MDX frontmatter (near the existing title and tags
fields) to include a description: provide a short Bengali sentence for the
description key (YAML string) so OpenGraph/Twitter cards get a proper preview;
keep title in Bengali and tags as an English keywords array and add description
between or after title/tags in the YAML block.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 654f4350-1e0b-498d-84b9-32caa3c1f1df
📒 Files selected for processing (37)
content/sd/about.en.mdxcontent/sd/caching/benefits.en.mdxcontent/sd/caching/challenges.en.mdxcontent/sd/caching/eviction.en.mdxcontent/sd/caching/index.en.mdxcontent/sd/caching/invalidation.en.mdxcontent/sd/caching/meta.en.jsoncontent/sd/caching/strategies.en.mdxcontent/sd/cdn/benefits.en.mdxcontent/sd/cdn/how-it-works.en.mdxcontent/sd/cdn/index.en.mdxcontent/sd/cdn/meta.en.jsoncontent/sd/cdn/push-vs-pull.en.mdxcontent/sd/data-partitioning/index.en.mdxcontent/sd/data-partitioning/meta.en.jsoncontent/sd/data-partitioning/sharding-techniques.en.mdxcontent/sd/data-partitioning/trade-offs.en.mdxcontent/sd/data-partitioning/types.en.mdxcontent/sd/hook.en.mdxcontent/sd/introduction.en.mdxcontent/sd/load-balancer/benefits.en.mdxcontent/sd/load-balancer/how-it-works.en.mdxcontent/sd/load-balancer/index.en.mdxcontent/sd/load-balancer/meta.en.jsoncontent/sd/load-balancer/types.en.mdxcontent/sd/networking/http-versions.en.mdxcontent/sd/networking/http-vs-https.en.mdxcontent/sd/networking/index.en.mdxcontent/sd/networking/meta.en.jsoncontent/sd/networking/tcp-vs-udp.en.mdxcontent/sd/replication/index.en.mdxcontent/sd/replication/meta.en.jsoncontent/sd/replication/methods.en.mdxcontent/sd/replication/redundancy.en.mdxcontent/sd/replication/replication.en.mdxcontent/sd/scaling.en.mdxcontent/sd/what-is-system-design.en.mdx
✅ Files skipped from review due to trivial changes (8)
- content/sd/networking/meta.en.json
- content/sd/cdn/meta.en.json
- content/sd/replication/meta.en.json
- content/sd/load-balancer/meta.en.json
- content/sd/data-partitioning/meta.en.json
- content/sd/networking/index.en.mdx
- content/sd/caching/meta.en.json
- content/sd/load-balancer/benefits.en.mdx
🚧 Files skipped from review as they are similar to previous changes (1)
- content/sd/introduction.en.mdx
- Trim over-length tag lists to <=8 keywords (load-balancer/types: 10->8, networking/http-versions: 9->8) - Add a page-specific English description to the 13 chapters that lacked one (used for OpenGraph/Twitter cards and search snippets) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…tility derived from LOCALES
…ross the codebase
|
Looks good to me . |
MehrazRumman
left a comment
There was a problem hiding this comment.
Looks fine ! But do you think more tests are needed here ?
…nary dependencies from client components
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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.
Inline comments:
In `@src/app/`[lang]/sd/[[...slug]]/page.tsx:
- Around line 55-56: The markdown action URL passed to ViewOptions is not
locale-aware; replace markdownUrl={`${page.url}.mdx`} with a locale-aware URL by
calling buildUrl(lang, `${page.url}.mdx`) (or localePath(lang,
`${page.url}.mdx`) if you need a relative href) so the ViewOptions actions use
the current locale; update the prop in the ViewOptions invocation in page.tsx
accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 275303b9-8c1a-477c-b61d-52feb2a7a20a
📒 Files selected for processing (6)
CLAUDE.mdTRANSLATING.mdsrc/app/[lang]/sd/[[...slug]]/page.tsxsrc/components/ai/page-actions.tsxsrc/dictionaries/bn.jsonsrc/dictionaries/en.json
💤 Files with no reviewable changes (1)
- src/dictionaries/bn.json
✅ Files skipped from review due to trivial changes (4)
- src/dictionaries/en.json
- src/components/ai/page-actions.tsx
- CLAUDE.md
- TRANSLATING.md
… with locale validation and improved accessibility.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
src/lib/email-hash.ts (1)
56-64:⚠️ Potential issue | 🟠 Major | ⚡ Quick winPreserve configuration-error propagation in
verifyEmailHash.Line 56 catches
UNSUBSCRIBE_SECRETfailures and returnsfalse, which makessrc/app/api/unsubscribe/route.tsreturn 403 instead of its intended 500 server-configuration response.🔧 Proposed fix
export function verifyEmailHash(email: string, hash: string): boolean { - try { - return ( - safeEqual(generateEmailHash(email), hash) || - safeEqual(generateLegacyEmailHash(email), hash) - ); - } catch (error) { - console.error("Hash verification failed:", error); - return false; - } + return ( + safeEqual(generateEmailHash(email), hash) || + safeEqual(generateLegacyEmailHash(email), hash) + ); }🤖 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 `@src/lib/email-hash.ts` around lines 56 - 64, The try/catch in verifyEmailHash is swallowing configuration errors (like missing UNSUBSCRIBE_SECRET) and returning false; change it so configuration errors propagate: in src/lib/email-hash.ts update the catch in verifyEmailHash to rethrow errors related to UNSUBSCRIBE_SECRET (e.g., if error.message or error.name references UNSUBSCRIBE_SECRET or config) and only return false for genuine verification failures; alternatively remove the try/catch entirely so errors from generateEmailHash/generateLegacyEmailHash bubble up. Ensure you reference the generateEmailHash, generateLegacyEmailHash and UNSUBSCRIBE_SECRET symbols when making the change.
🤖 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.
Outside diff comments:
In `@src/lib/email-hash.ts`:
- Around line 56-64: The try/catch in verifyEmailHash is swallowing
configuration errors (like missing UNSUBSCRIBE_SECRET) and returning false;
change it so configuration errors propagate: in src/lib/email-hash.ts update the
catch in verifyEmailHash to rethrow errors related to UNSUBSCRIBE_SECRET (e.g.,
if error.message or error.name references UNSUBSCRIBE_SECRET or config) and only
return false for genuine verification failures; alternatively remove the
try/catch entirely so errors from generateEmailHash/generateLegacyEmailHash
bubble up. Ensure you reference the generateEmailHash, generateLegacyEmailHash
and UNSUBSCRIBE_SECRET symbols when making the change.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: c343b613-0ef2-49d9-b0c6-090ae6ce90c2
⛔ Files ignored due to path filters (20)
public/og/en/sd/about/image.pngis excluded by!**/*.pngpublic/og/en/sd/caching/benefits/image.pngis excluded by!**/*.pngpublic/og/en/sd/caching/challenges/image.pngis excluded by!**/*.pngpublic/og/en/sd/caching/image.pngis excluded by!**/*.pngpublic/og/en/sd/caching/invalidation/image.pngis excluded by!**/*.pngpublic/og/en/sd/cdn/benefits/image.pngis excluded by!**/*.pngpublic/og/en/sd/cdn/how-it-works/image.pngis excluded by!**/*.pngpublic/og/en/sd/cdn/image.pngis excluded by!**/*.pngpublic/og/en/sd/cdn/push-vs-pull/image.pngis excluded by!**/*.pngpublic/og/en/sd/data-partitioning/sharding-techniques/image.pngis excluded by!**/*.pngpublic/og/en/sd/data-partitioning/types/image.pngis excluded by!**/*.pngpublic/og/en/sd/hook/image.pngis excluded by!**/*.pngpublic/og/en/sd/index/image.pngis excluded by!**/*.pngpublic/og/en/sd/load-balancer/benefits/image.pngis excluded by!**/*.pngpublic/og/en/sd/load-balancer/how-it-works/image.pngis excluded by!**/*.pngpublic/og/en/sd/load-balancer/image.pngis excluded by!**/*.pngpublic/og/en/sd/networking/http-vs-https/image.pngis excluded by!**/*.pngpublic/og/en/sd/networking/image.pngis excluded by!**/*.pngpublic/og/en/sd/replication/image.pngis excluded by!**/*.pngpublic/og/en/sd/what-is-system-design/image.pngis excluded by!**/*.png
📒 Files selected for processing (20)
CLAUDE.mdTRANSLATING.mdemails/README.mdnext.config.mjsscripts/generate-index-og.tsscripts/generate-og-images.tssrc/app/[lang]/(home)/layout.tsxsrc/app/[lang]/(home)/page.tsxsrc/app/[lang]/layout.tsxsrc/app/[lang]/sd/[[...slug]]/page.tsxsrc/app/llms.mdx/[lang]/[[...slug]]/route.tssrc/app/sitemap.tssrc/components/ai/page-actions.tsxsrc/components/language-flag-dropdown.tsxsrc/components/language-toggle.tsxsrc/lib/constants.tssrc/lib/dictionaries.tssrc/lib/email-hash.tssrc/lib/layout.shared.tsxsrc/lib/source.ts
✅ Files skipped from review due to trivial changes (3)
- src/app/llms.mdx/[lang]/[[...slug]]/route.ts
- CLAUDE.md
- TRANSLATING.md
🚧 Files skipped from review as they are similar to previous changes (7)
- src/components/language-flag-dropdown.tsx
- src/lib/source.ts
- src/app/[lang]/sd/[[...slug]]/page.tsx
- src/components/language-toggle.tsx
- scripts/generate-index-og.ts
- src/app/[lang]/(home)/page.tsx
- src/lib/layout.shared.tsx
…ilHash The inner try/catch caught the missing-secret config error and returned false, so the unsubscribe route returned 403 "invalid hash" and its 500 "server configuration error" path was dead code. Remove it: a wrong hash still returns false (safeEqual never throws), and the only throw path is the missing secret, which the route already catches and surfaces as 500. Addresses CodeRabbit review on PR #18. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Summary by CodeRabbit
New Features
Locale-aware SEO
Content
Documentation
Bug Fixes
Chores