Skip to content

feat: Bulk Import Workflow | Multi-Language Support | Feature Toggles UI#309

Merged
RUKAYAT-CODER merged 3 commits into
rinafcode:mainfrom
0xElyte:main
Apr 28, 2026
Merged

feat: Bulk Import Workflow | Multi-Language Support | Feature Toggles UI#309
RUKAYAT-CODER merged 3 commits into
rinafcode:mainfrom
0xElyte:main

Conversation

@0xElyte
Copy link
Copy Markdown
Contributor

@0xElyte 0xElyte commented Apr 28, 2026

Closes #269
Closes #260
Closes #254

feat: Bulk Import, Multi-language Support & Feature Toggles

Summary

Three interconnected platform capabilities delivered in a single branch: a CSV/JSON bulk data importer, a full internationalization (i18n) system with RTL support, and a feature flag admin panel with percentage rollouts and targeting rules.


Changes

1. Bulk Import Workflow

Enables admins and instructors to import large datasets (courses, users, questions) from CSV or JSON files without writing code.

  • BulkImporter.tsx — Drag-and-drop upload UI with column mapping, live validation feedback, progress tracking, and per-row error reporting
  • parser.ts — CSV and JSON parsers with encoding detection and header normalization
  • validator.ts — Schema-based row validation (required fields, type checks, enum constraints, custom rules)
  • rollback.ts — Transactional rollback support; partial imports can be undone if a later step fails
  • types.ts — Shared types (ImportJob, ImportRow, FieldMapping, ValidationResult)
  • index.ts — Public barrel export
  • index.tsBulkImporter added to shared component barrel

2. Multi-language Support (i18n)

Full internationalization infrastructure supporting 4 languages at launch (EN, ES, AR, FR) with correct LTR/RTL rendering server-side to avoid hydration flash.

  • src/lib/i18n/config.tsi18next singleton; static locale loading for EN/ES/AR/FR; getHtmlDir() for RTL detection; loadLocale() for dynamic import
  • src/lib/i18n/index.ts — Public barrel; re-exports useTranslation and Trans from react-i18next
  • src/locales/fr.json — French translations (3rd full locale alongside ES and AR)
  • layout.tsx — Reads i18n:language cookie server-side; sets <html lang dir> before hydration
  • RootProviders.tsx — Wraps tree with <I18nextProvider>; passes SSR locale to <I18nProvider>
  • useInternationalization.tsx — Syncs i18next singleton on language change; persists selection to cookie; sets document.documentElement.dir
  • Header.tsx — Nav links translated via t(); DynamicLanguageSwitcher added to desktop and mobile menus
  • package.json — Added i18next ^24.0.0 and react-i18next ^15.0.0

3. Feature Toggles UI

Admin panel for managing feature flags with percentage rollouts and attribute-based targeting — no code deploys needed to toggle features.

  • store.ts — Core types (FeatureFlag, TargetingRule, AuditEntry, RolloutStrategy); in-process flagStore Map; evaluateFlag() with deterministic hash bucketing for percentage rollouts; auditLog capped at 500 entries
  • index.ts — Public barrel
  • useFeatureFlag.tsuseFeatureFlag(id, context) and useAllFeatureFlags() React hooks
  • route.tsGET (list all), POST (create); rate-limited
  • route.tsGET, PUT (update/toggle), DELETE; audit entry on every mutation
  • route.tsGET ?id=&<context> — evaluates a flag for an arbitrary user context
  • route.tsGET ?flagId=&limit=&offset= — paginated audit log
  • page.tsx — Full admin UI: toggle switches, stats bar, search + tag + on/off filters, expandable flag rows, percentage slider, targeting rule editor, per-flag audit log modal, delete confirmation

Testing

  • All 20 changed files pass TypeScript strict-mode with zero errors
  • Conflicts with remote FeatureFlagProvider and QRCode additions resolved during cherry-pick rebase

Checklist

  • No breaking changes to existing API contracts
  • Dark mode supported throughout (Tailwind dark: variants)
  • Rate limiting applied to all new API routes
  • Audit log written on every flag mutation (create / update / toggle / delete)
  • RTL languages (Arabic) render correctly server-side without hydration flash
  • x-admin-user header used as audit actor (consistent with existing auth pattern)

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Apr 28, 2026

@0xElyte Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@RUKAYAT-CODER RUKAYAT-CODER merged commit 9b9c59f into rinafcode:main Apr 28, 2026
1 of 2 checks passed
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.

Bulk Import Workflow Multi-language Support Feature Toggles UI

2 participants