# Backport Plan: mega-steel → base-inertia

Source repo: `C:\xampp\htdocs\mega steel` (call it **M**). Target: this repo (template).
Goal: bring M's **generic** features into the template. Leave all steel/brand content behind.

Rules for every port:
- One feature per commit. Run `npm run build` and commit `public/build` with it.
- Strip brand: no Mega Steel logo/colors/text. Use neutral tokens + placeholder logo.
- Use `git -C "C:/xampp/htdocs/mega steel" show <hash>` to see exactly what a feature changed.
- After each feature: check the dashboard in EN + AR, light + dark, desktop + phone.

Status legend: `[ ]` todo · `[x]` done · `[-]` skipped

---

## A. Dashboard UX (pure frontend, low coupling) — port first

| # | Feature | Files in M | M commits |
|---|---|---|---|
| [x] A1 | **Mobile DataTable**: stacked list, swipe-to-edit/delete, bottom action sheet | `components/tables/DataTable.vue` (+491 lines), `components/tables/SwipeRow.vue` (new) | e22d1f0, 4f3efd2, 0915b87, fcecc49, f95f140, 5085e1d, e1acf17, 1dbf4f9 |
| [x] A2 | **Navigation loader with logo** (replaces blank flash between pages) | `components/ui/NavigationLoader.vue` (new), `layout/AdminLayout.vue` / `App.vue` | 68187a8 |
| [x] A3 | **Sidebar**: icon rail when collapsed, instant toggle, active link, dropdown box, "View site" button | `layout/Sidebar.vue`, `layout/Topbar.vue` | a12015a … 12b271d, ffc958a, f17be43, c2495db |
| [x] A4 | **Mobile topbar + profile drawer** | `layout/Topbar.vue`, `layout/Sidebar.vue` | e05020c, ffc958a, e2bac65 |
| [x] A5 | **Toast fixes** (close button, duplicates) | `ui/Toast.vue`, `store/index.js` | d654573 |
| [x] A6 | **AdminFormFooter** (sticky save bar) | `ui/AdminFormFooter.vue` (new) | — |
| [x] A7 | Other small diffs: Alert, Badge, Checkbox, ImagePicker, MultiSelect, RichTextEditor, DarkModeToggle, LinkifyText | review the diff for each file and keep the generic fixes only | — |

## B. i18n / locale

| # | Feature | Files in M | M commits |
|---|---|---|---|
| [x] B1 | **Default to Arabic, ignore browser language** | `Http/Middleware/SetLocale.php` | 243af09 |
| [x] B2 | **Refresh page data on language switch** | `composables/useLanguage.js` (new), `ui/LanguageSwitcher.vue`, `i18n/index.js`, `HandleInertiaRequests.php` | 57f93ff |
| [x] B3 | **Arabic validation messages + nested attribute names** | `lang/ar/validation.php` (new), Auth requests | 7bab0f0, a5764a8 |
| [x] B4 | **Bilingual inputs**: one input + AR/EN tabs, data `{ar, en}` | `inputs/TranslatableInput.vue` (new), `TranslatableTextInput.vue` diff | — |
| [x] B5 | i18n JSON special-char escaping (`{'@'}`, `{'|'}`) | document only, see section E | — |

## C. Site-control engine (dashboard edits public Blade site)

This is the core feature, and it's coupled. Port the **engine plus one example section**, not M's 50 sections.

| # | Feature | Files in M |
|---|---|---|
| [x] C1 | **Public site layout**: Blade layout, site CSS tokens, dark-only Cairo | `views/layouts/client.blade.php`, `css/client.css`, `css/site/*` (colors, typography, spacing, layout), vite inputs, `routes/web.php` public part |
| [x] C2 | **Live preview engine**: iframe renders the real Blade | `Web/Admin/SitePreviewController.php`, `ui/AdminClientPreviewFrame.vue` (check whether it differs), the preview routes, the preview skeleton (5bd8be7, 2b3adc1) |
| [x] C3 | **Settings** (site-wide: logo, contact email…) | `Setting` model/service/controller/request/resource, `pages/Modules/admin/Settings`, `lang/*/settings.php` |
| [x] C4 | **Site header + footer editors** | `SiteHeader*`, `SiteFooter*` (all 4 layers + pages + lang), `inputs/LinkListFields.vue`, `ButtonLinkFields.vue` |
| [x] C5 | **SEO**: settings, meta tags, sitemap, robots | `Traits/HasSeoMeta.php`, `SeoSetting`, `SeoService`, `SeoController`, `inputs/SeoFields.vue`, `views/sitemap.blade.php`, `pages/Modules/admin/Seo` (708ddbf) |
| [x] C6 | **Pages module** (pages list in the dashboard) | `Page*` + `pages/Modules/admin/Pages` (fac765d) |
| [x] C7 | **One example section** (e.g. Hero) as a reference implementation for the skill | `Hero*` 4 layers + Preview request + Blade component + admin page (3f717d6) |
| [ ] C8 | **Detail pages** (optional, generic "item → detail page" system) | `Traits/HasDetailPage.php`, `DetailPage*`, `DetailContentService`, `Requests/Admin/Concerns/DetailContentRules.php`, `Resources/Admin/Concerns/DetailContentResource.php`, `components/forms/*`, `useDetailContentForm.js` (fccf3e6) |
| [ ] C9 | **Contact messages inbox** (optional) | `ContactMessage*`, `pages/Modules/admin/ContactMessages` (6d978b1) |
| [x] C10 | **Scroll reveal + page progress bar** | `js/site/reveal.js`, `js/site/progress.js`, `css/site/animations.css`, `css/site/progress.css` (8fe83aa) |
| [ ] C12 | **Mobile sliders**: extract the inline `<script>` duplicated in ~14 section Blades into one `js/site/slider.js` (data-attribute driven, like reveal.js; add it to the vite inputs). Two variants: **dots** (IntersectionObserver marks the active dot, a dot click calls `scrollIntoView`; source: `components/site/home/services.blade.php`) and **progress** (a bar fills with scroll using RTL-safe `Math.abs(scrollLeft)`, plus a `01/05` counter; source: `components/site/sectors/system.blade.php`). Use it in the C7 example section and document it in the site-section skill (E1). Markup stays per page, only the behavior is shared. | — |
| [x] C11 | `useImageUpload.js` composable, `config/filesystems.php` diff | — |

## D. Leave behind (steel-specific)

Abilities, About*, Applications, Articles*, Sectors*, Materials*, Projects*, WhyUs*, Services*, RequestQuote*, QuoteRequest, Reviews, Home* sections, InfoCards, ContactCard/ContactPageHeader, the brand palette (gold/petrol), the logos, `public/storage/*`.

## E. Knowledge layer (Claude setup in the template)

| # | Item | Action |
|---|---|---|
| [x] E1 | `.claude/skills/site-section/SKILL.md` | Copy from M, rewrite its paths/examples to point at C7 (the example section) |
| [x] E2 | `scroll-reveal` skill | Already user-level (`~/.claude/skills/scroll-reveal`), works everywhere. Nothing to do. |
| [x] E3 | `docs/SITE_RESPONSIVE_RULES.md` | Copy from M (`SITE_RESPONSIVE_RULES.md` in root) |
| [x] E4 | New doc: `docs/DATATABLE_MOBILE.md` | Describe mobile table rules (from A1) |
| [x] E5 | Root md cleanup | Delete stale files (PHASE_*, SALES_*, COMPANY_HISTORY_*, FRONTEND_COMPLETE, *_IMPLEMENTATION). Merge useful ones into `docs/`. |
| [x] E6 | CLAUDE.md: add the lessons learned from M's memory | see list below |
| [ ] E7 | New skill (optional): `admin-module`, the 4-file module + Index/Form + translations checklist | — |

Lessons to add to CLAUDE.md (from M's Claude memory, which does not transfer between projects):
- Public-site design tokens live in `resources/css/site/`. They're dark-only, use Cairo, and stay out of `app.css`.
- Each site page owns its own components. Share them only when explicitly asked.
- Bilingual fields use one input with AR/EN tabs (`TranslatableInput`), and the data is `{ar, en}`.
- A section editor's live preview renders the real Blade in an iframe. Never build a Vue copy.
- Every new or redesigned site section gets `data-reveal` scroll animations.
- Follow `docs/SITE_RESPONSIVE_RULES.md` when making site components responsive.
- Named `max-w-*` classes use the `--spacing-*` tokens. `max-w-none` = max-width 0, so use arbitrary values instead.
- In vue-i18n JSON, escape `@` and a literal `|` as `{'@'}` / `{'|'}`.
- The cPanel root `.htaccess` must not block `/storage`, or uploads return 403.
- On the server, `migrate` / `db:seed` need `--force`, or they silently cancel.
- Commit `public/build` together with the source changes.
- Work on `main`. Ask before creating a feature branch.
- When redesigning a page from Figma, implement every section, including component instances such as the page header.

## Suggested order

A1 → A2 → A5 → B1–B4 → A3/A4 → C1 → C2 → C3 → C7 → E1 → C4 → C5 → C6 → C10 → C12 → E3–E6 → optional (C8, C9, E7)
