Skip to content

feat: marketing production-ready pass — report-issue, i18n, RTL, a11y#48

Open
abdout wants to merge 6 commits into
mainfrom
feat/47-report-issue-site-wide
Open

feat: marketing production-ready pass — report-issue, i18n, RTL, a11y#48
abdout wants to merge 6 commits into
mainfrom
feat/47-report-issue-site-wide

Conversation

@abdout
Copy link
Copy Markdown
Contributor

@abdout abdout commented Apr 26, 2026

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

  • Mount <ReportIssue variant="icon"/> globally in [lang]/layout.tsx as a fixed bottom-start floating button (logical start-4 flips with RTL, sits opposite Toaster). Hidden on print.
  • Refactor component to repo idiom: React Hook Form + Zod + shadcn <Form>/<Textarea>, sonner toasts, dictionary-backed strings (common.reportIssue.*).
  • Server action returns {error, success} instead of throwing.
  • Register GITHUB_PERSONAL_ACCESS_TOKEN + GITHUB_REPO in src/env.mjs (server schema + runtimeEnv).
  • New .env.example; .gitignore allows it past .env* exclusion.

feat(i18n): translate chatbot quick-questions, auth forms, not-found

  • Chatbot quick-question chips were hardcoded English (both labels AND prompts sent to the LLM). Now read from chatbot.preconfigured.{pricing,services,timeline,about} so Arabic users get Arabic prompts → Arabic AI responses. Send/voice button titles + aria-labels too.
  • Auth forms (login, join, password, verification): all hardcoded copy now reads t.auth.*.
  • ar.json: translate metadata.title/description (was raw English) + fix typo دايتابايت → داتابيت.
  • [lang]/not-found.tsx: read NEXT_LOCALE cookie + fall back to default locale; back-to-home link respects locale.
  • auth/header.tsx: drop unused Poppins font import (was Latin-only, would have rendered Arabic poorly).
  • Delete components/internationalization/middleware.ts (dead duplicate of root proxy.ts).
  • routes.ts: DEFAULT_LOGIN_REDIRECT /dashboard/ (no /dashboard route exists, was 404 after sign-in).

feat(rtl,a11y): logical Tailwind utilities, real auth, viewport zoom

  • RTL: 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 all mirror under dir=rtl.
  • RTL: chatbot/constant — bubble/window position classes use end-/start- so the floating chat flips with locale instead of being glued to physical right.
  • A11y (WCAG 1.4.4): viewport meta no longer sets userScalable:false / maximumScale:1, restoring pinch-zoom on mobile.
  • Auth wiring: site-header/content was hardcoded isAuthenticated={false} with auth() commented out. Convert to a small client component using useSession() (provider already mounted in [lang]/layout).
  • Log hygiene: auth/mail.ts no longer logs 2FA tokens, password-reset links, or full Resend response bodies (info disclosure). Marketing layout's three debug console.logs removed. next.config.ts now strips console.* in prod (preserving warn/error).
  • Production polish: sitemap.ts fixes a TS error (Locale[] vs readonly) and points default baseUrl at :3000 (was :3001); includes /chatbot. robots.ts disallows auth/wizard/api paths.

Existing foundation commits (already on branch)

  • fix(ts): align [lang]/layout params with Next 16 LayoutProps
  • fix(auth): restore SessionProvider in [lang]/layout

Verification

  • pnpm dev boots clean.
  • pnpm build produces 32 routes including static /sitemap.xml and /robots.txt.
  • /en, /ar, /en/login, /ar/join, /en/pricing, /ar/chatbot, /sitemap.xml, /robots.txt all return 200.

Required env in Vercel before this lands

  • GITHUB_PERSONAL_ACCESS_TOKEN — repo scope, lets the report-issue server action open issues in databayt/marketing.
  • (Optional) GITHUB_REPO — defaults to databayt/marketing.

Out of scope / follow-up issues

  • Re-enable typescript.ignoreBuildErrors once pre-existing pricing/wizard any types are tightened (~30 hits, separate PR).
  • Sweep remaining physical Tailwind utilities outside ui/ primitives (~120 hits across marketing/wizard/pricing).
  • Locale-aware date/Intl.NumberFormat in marketing/utils.ts and pricing/lib/utils.ts (currently hardcode en-US).
  • Migrate useTranslations to dynamic per-locale import (currently statically imports both dictionaries → ~30 KB unused on every client).
  • Rename misspelled files (cutomizer.tsxcustomizer.tsx, verificiation-token.tsverification-token.ts).

Closes #47

abdout and others added 3 commits April 25, 2026 11:36
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>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marketing Ready Ready Preview, Comment Apr 27, 2026 7:03am

abdout and others added 2 commits April 26, 2026 14:22
- 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>
@abdout abdout changed the title feat: site-wide ReportIssue + env validation (Phase 1) feat: marketing production-ready pass — report-issue, i18n, RTL, a11y Apr 26, 2026
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>
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: marketing production readiness — Phase 1 (report-issue site-wide)

1 participant