feat: marketing production-ready pass — report-issue, i18n, RTL, a11y#48
Open
abdout wants to merge 6 commits into
Open
feat: marketing production-ready pass — report-issue, i18n, RTL, a11y#48abdout wants to merge 6 commits into
abdout wants to merge 6 commits into
Conversation
Without SessionProvider, every client useSession() returned
unauthenticated regardless of server-side state — breaking
useCurrentUser, useCurrentRole, RoleGate, user-button avatar,
pricing role/delete forms.
Restores the wrapper at the layout level. The server layout calls
auth() once in parallel with params resolution (Promise.all), and
passes the session to SessionProvider for client descendants.
The pages: { signIn, error } config in src/auth.ts is left as-is —
proxy.ts already prefixes the user's locale on the next request after
the redirect, so /login lands on /{locale}/login by cookie.
Closes #9
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Next 16's auto-generated LayoutConfig<"/[lang]"> expects
params: Promise<{ lang: string }> but the layout was declaring
params: Promise<{ lang: Locale }> (narrowed). The narrower type
was an over-promise.
Loosens params to string and validates inside via a small
resolveLocale() helper that falls back to i18n.defaultLocale for
unknown segments. Applied to both generateMetadata and LocaleLayout.
Stacked on fix/auth-restore-session-provider (PR #10) — auto-merges
when that lands.
Closes #45
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Mount <ReportIssue variant="icon"/> in [lang]/layout.tsx as a fixed
bottom-start floating button (logical start-4 flips with RTL, sits
opposite the Toaster). Hidden on print.
- Add GITHUB_PERSONAL_ACCESS_TOKEN (optional) + GITHUB_REPO (default
databayt/marketing) to env.mjs server schema and runtimeEnv.
- Move inline fallback strings into common.reportIssue.* in en/ar.json;
component now reads via useTranslations() to mirror hogwarts pattern.
- Refactor component to RHF + Zod + sonner — server action now returns
{ error, success } instead of throwing, matching the auth idiom.
- Document required env via .env.example; allow it past .gitignore's
.env* exclusion with !.env.example.
- Keep footer text-link variant alongside the floating icon for
discoverability on marketing routes.
Refs #47
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- chatbot/chat-window: read preconfigured questions and control labels
from dictionary (was hardcoded English strings used as both display
labels AND prompts sent to the LLM); ar.json gets matching arabic
prompts so Arabic users get Arabic AI responses.
- auth forms (login/join/password/verification): swap all hardcoded
English copy — placeholders, "Or continue with" divider,
"Forgot password?", button labels, "Back to login" — for dictionary
keys via useTranslations(). Verification form's error fallbacks
("Missing token!", "Something went wrong!") now localized too.
- ar.json: translate metadata.title/description (was raw English) and
fix the brand-name typo دايتابايت → داتابيت in getStarted.title.
- [lang]/not-found.tsx: read NEXT_LOCALE cookie + fall back to default
locale instead of hardcoding 'en'; back-to-home link now respects
the user's locale.
- auth/header.tsx: drop the unused Poppins font import; the heading is
empty so it inherits the locale-aware Rubik/Geist body font.
- Delete components/internationalization/middleware.ts — it was a dead
duplicate of root proxy.ts (Next 16 uses proxy.ts as the entry).
- routes.ts: DEFAULT_LOGIN_REDIRECT was '/dashboard' (no such route);
point at '/' so the proxy can route to /{lang} after sign-in.
Refs #47
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
RTL correctness (the user-visible RTL fixes everyone misses):
- ui/{dialog,sheet,dropdown-menu,select,navigation-menu}: physical
ml/mr/pl/pr/left-/right-/text-left → logical ms/me/ps/pe/start-/end-/
text-start. Close buttons, checkmark indicators, sub-menu chevrons,
and viewport offsets now mirror correctly under dir=rtl.
- chatbot/constant: 'bottom-right' / 'bottom-left' position classes now
use end-/start- so the floating chat bubble flips with locale instead
of staying glued to the physical right in Arabic.
A11y (Phase 4):
- [lang]/layout viewport: drop userScalable:false + maximumScale:1
(was failing WCAG 1.4.4 — pinch-zoom blocked). Keep width:device-width
+ initialScale:1.
Auth wiring (Phase 5):
- site-header/content: was hardcoded isAuthenticated={false} with auth()
commented out. Convert to a small client component that calls
useSession() (SessionProvider is already mounted in [lang]/layout).
Header now reflects real session state.
Log hygiene (Phase 5 partial):
- auth/mail: stop logging 2FA tokens, password-reset links, verification
links, and full Resend response bodies (information disclosure risk).
Errors still log via console.error.
- (marketing)/layout: drop the three "handleChatClick called…" debug
logs; the function is one line now.
- next.config: enable compiler.removeConsole in production builds
(preserve warn + error). Stops residual debug noise from leaking to
prod logs without a per-file scrub.
Production polish (Phase 6):
- sitemap.ts: fix `Locale[]` vs `readonly` TS error, point default
baseUrl at :3000 (was :3001 — 404 in dev), include /chatbot.
- robots.ts: same baseUrl fix; disallow auth/wizard/api paths so
crawlers don't index login/register/etc.
Refs #47
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
i18n (Phase 2 leftover):
- expert-modal: project-type / budget / timeline SelectItems read from
t.expert.{projectTypes,budgets,timelines}.* — were previously raw
English regardless of locale.
- mode-switcher: title/aria-label/sr-only now read t.navigation.toggleTheme
(added in en/ar dictionaries alongside toggleLanguage).
Naming fixes (Phase 5):
- Rename src/components/wizard/cutomizer.tsx → customizer.tsx and update
the importer (theme.tsx).
- Rename src/components/auth/verification/verificiation-token.ts →
verification-token.ts and update both importers (tokens.ts,
verification/action.ts).
Bug fix surfaced during cleanup:
- src/auth.ts jwt callback was setting token.name = existingUser.username
but the User model has `name`, not `username` (one of the silent
TS errors masked by `ignoreBuildErrors`). OAuth-linked users were
getting a `null` display name. Fix to existingUser.name.
Log scrub (Phase 5):
- src/auth.ts: drop the three debug console.log calls in
events.linkAccount, events.signIn, callbacks.signIn (they leaked
user emails and provider names to prod logs). debug:true (logged
every internal Auth.js step) → debug only in NODE_ENV=development.
- src/lib/db.ts: drop the unused debugPrismaEngine() helper that
logged a slice of DATABASE_URL. Nothing imported it.
- src/app/api/auth/[...nextauth]/route.ts: drop the top-level config
console.log that ran on every cold start.
- verification/action.ts: drop ~10 step-by-step debug logs from
newVerification(); error returns are unchanged.
README: replace the create-next-app boilerplate with a real project
overview — stack, quickstart, architecture map, i18n notes,
report-issue env requirement, deploy + contribution flow.
Refs #47
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Multi-phase production-readiness pass on the marketing site. Each commit is one focused concern. The PR addresses everything the user asked for ("internationalization, RTL, translations, responsiveness, report-an-issue on every page") plus security/log/build hygiene that surfaced during the audit.
Commits
feat(report-issue): site-wide mount with i18n + env validation<ReportIssue variant="icon"/>globally in[lang]/layout.tsxas a fixed bottom-start floating button (logicalstart-4flips with RTL, sits opposite Toaster). Hidden on print.<Form>/<Textarea>, sonner toasts, dictionary-backed strings (common.reportIssue.*).{error, success}instead of throwing.GITHUB_PERSONAL_ACCESS_TOKEN+GITHUB_REPOinsrc/env.mjs(server schema + runtimeEnv)..env.example;.gitignoreallows it past.env*exclusion.feat(i18n): translate chatbot quick-questions, auth forms, not-foundchatbot.preconfigured.{pricing,services,timeline,about}so Arabic users get Arabic prompts → Arabic AI responses. Send/voice button titles + aria-labels too.t.auth.*.ar.json: translatemetadata.title/description(was raw English) + fix typoدايتابايت → داتابيت.[lang]/not-found.tsx: readNEXT_LOCALEcookie + fall back to default locale; back-to-home link respects locale.auth/header.tsx: drop unusedPoppinsfont import (was Latin-only, would have rendered Arabic poorly).components/internationalization/middleware.ts(dead duplicate of rootproxy.ts).routes.ts:DEFAULT_LOGIN_REDIRECT/dashboard→/(no/dashboardroute exists, was 404 after sign-in).feat(rtl,a11y): logical Tailwind utilities, real auth, viewport zoomui/{dialog,sheet,dropdown-menu,select,navigation-menu}— physicalml/mr/pl/pr/left-/right-/text-left→ logicalms/me/ps/pe/start-/end-/text-start. Close buttons, checkmark indicators, sub-menu chevrons all mirror underdir=rtl.chatbot/constant— bubble/window position classes useend-/start-so the floating chat flips with locale instead of being glued to physical right.userScalable:false / maximumScale:1, restoring pinch-zoom on mobile.site-header/contentwas hardcodedisAuthenticated={false}withauth()commented out. Convert to a small client component usinguseSession()(provider already mounted in[lang]/layout).auth/mail.tsno longer logs 2FA tokens, password-reset links, or full Resend response bodies (info disclosure). Marketing layout's three debugconsole.logs removed.next.config.tsnow stripsconsole.*in prod (preserving warn/error).sitemap.tsfixes a TS error (Locale[]vsreadonly) and points defaultbaseUrlat:3000(was:3001); includes/chatbot.robots.tsdisallows auth/wizard/api paths.Existing foundation commits (already on branch)
fix(ts): align [lang]/layout params with Next 16 LayoutPropsfix(auth): restore SessionProvider in [lang]/layoutVerification
pnpm devboots clean.pnpm buildproduces 32 routes including static/sitemap.xmland/robots.txt./en,/ar,/en/login,/ar/join,/en/pricing,/ar/chatbot,/sitemap.xml,/robots.txtall return 200.Required env in Vercel before this lands
GITHUB_PERSONAL_ACCESS_TOKEN— repo scope, lets the report-issue server action open issues indatabayt/marketing.GITHUB_REPO— defaults todatabayt/marketing.Out of scope / follow-up issues
typescript.ignoreBuildErrorsonce pre-existing pricing/wizardanytypes are tightened (~30 hits, separate PR).ui/primitives (~120 hits across marketing/wizard/pricing).Intl.NumberFormatinmarketing/utils.tsandpricing/lib/utils.ts(currently hardcodeen-US).useTranslationsto dynamic per-locale import (currently statically imports both dictionaries → ~30 KB unused on every client).cutomizer.tsx→customizer.tsx,verificiation-token.ts→verification-token.ts).Closes #47