# AI Session Progress Log

## Project
- Laravel 11 application
- Current direction: Blade-first public site (no React/Inertia for frontend pages)

## What Was Improved

### 1) Public views reorganized to Blade structure
- Introduced a shared site layout:
  - `resources/views/layouts/site.blade.php`
- Introduced page-based structure:
  - `resources/views/pages/*`
  - `resources/views/pages/blog/*`
- Added shared partials:
  - `resources/views/partials/breadcrumbs.blade.php`
  - `resources/views/partials/blog/entry.blade.php`

### 2) Legacy view setup removed from active flow
- Legacy PHP include approach (`resources/views/includs/*`) replaced by Blade layout/sections.
- Legacy duplicated assets under `resources/views/asset/*` removed.
- Public assets are consumed from `public/assets/*`.

### 3) Routes standardized with names
- Public routes now have names (examples):
  - `home`, `about`, `services`, `portfolio`, `team`, `hiring`
  - `contact.show`, `contact.store`
  - `blog.research.index`, `blog.development.index`, `blog.read`
  - `article.like`
- Navigation and page links now use `route(...)` in most public views.

### 4) Contact flow hardened
- `ContactController@store` improved:
  - Proper validation via `$request->validate(...)`
  - Added honeypot field (`website`) anti-spam check
  - Supports JSON response for async/AJAX requests
  - Supports redirect + flash success for normal form submit
- Added route throttling for contact submit:
  - `throttle:5,1`
- Contact view improved:
  - Displays success flash and validation errors
  - Preserves old input
  - Includes honeypot field

### 5) Blog read route handling fixed
- `ResearchArticlesListController@view` now reads slug from query key `_`:
  - `/read_blog?_=slug`

### 6) Portfolio filter bug fixed
- Issue: filtering appeared broken due to Bootstrap `d-flex` (`display:flex !important`) overriding inline `display:none` logic.
- Fix in `resources/views/pages/portfolio.blade.php`:
  - Filter now toggles `d-none` class on card columns.
  - Works correctly across categories.

## Important Files Updated
- `routes/web.php`
- `app/Http/Controllers/ContactController.php`
- `app/Http/Controllers/ResearchArticlesListController.php`
- `resources/views/layouts/site.blade.php`
- `resources/views/pages/*.blade.php`
- `resources/views/pages/blog/*.blade.php`
- `resources/views/partials/*.blade.php`

## Validation Performed
- Blade cache compilation succeeded:
  - `php artisan view:cache`
- PHP syntax checks passed for modified controller/route files.

## Known Notes / Caveats
- Breeze auth files still exist and were intentionally left in place.
- `resources/views/layouts/guest.blade.php` still contains `href="/"` (not harmful, but could be normalized to `route('home')`).
- `routes/webold.php` may still exist as a backup/legacy reference; main app routing uses `routes/web.php`.
- Some static content in portfolio/research sections is intentionally hardcoded for now.

## Suggested Next Steps (when revisiting)
1. Move portfolio cards to data-driven rendering (array/model driven instead of hardcoded HTML).
2. Add feature tests for public pages and contact submit flow.
3. Normalize remaining direct URLs to named routes in all Blade files.
4. Optionally remove unused Inertia artifacts if the project remains Blade-only.

## Session Outcome
- Public site structure is now cleaner, more maintainable, and aligned with Laravel Blade conventions.
- Portfolio filtering issue reported by user is confirmed fixed.

---

## Update: February 24, 2026 (Latest Session)

### A) Portfolio and Project UI refinements
- Portfolio hero updated to stronger liquid-glass style.
- Portfolio cards updated to glass-like style with clearer borders and card separation.
- Project details breadcrumbs cleaned to avoid redundant long titles.
- Contributors section changed from inline block to modal flow:
  - `استعرض فريق العمل` trigger now opens team modal.

### B) Global layout and footer
- Sticky footer behavior fixed at layout level for all pages using a shared `.site-content` wrapper.
- Footer rebuilt with:
  - quick links
  - contact block
  - social links
  - legal links
  - dynamic copyright year

### C) Legal pages added and expanded
- Added routes/pages:
  - `/privacy-policy` (`privacy.policy`)
  - `/terms-and-conditions` (`terms.conditions`)
- Both pages converted to full long-form Arabic drafts.
- Styling aligned with site:
  - check-mark bullet style
  - no large redundant internal headers
  - highlighted rectangular `آخر تحديث` label.

### D) Hiring flow redesigned (major)
- Hiring page converted to info-first UX with CTA.
- Application form moved to dedicated page:
  - `/hiring/apply` (`hiring.apply.show`)
- Form submission route:
  - `POST /hiring/apply` (`hiring.apply`)
- Implemented internal job application system:
  - migration: `job_applications` table
  - model: `JobApplication`
  - controller: `HiringController` (show/apply/store)
- Form capabilities:
  - required PDF CV upload (max 5MB)
  - optional LinkedIn and portfolio links
  - education level as dropdown:
    - ثانوي / دبلوم / بكالوريوس / ماجستير / دكتوراه
  - honeypot anti-spam
  - throttle middleware
  - built-in arithmetic captcha (no third-party dependency)
  - privacy consent required
  - interactive CV upload (click + drag/drop)

### E) Hiring feedback and validation UX
- Feedback shown in Bootstrap modal (success/errors) on apply page.
- Modal fixed for RTL alignment.
- Redirect behavior corrected:
  - redirect to `/hiring` only on success
  - stay on apply page on validation errors
- Added Arabic client-side messages for invalid/missing email.
- Privacy consent converted to themed toggle UI with Arabic validation prompt.
- Modal close `X` positioned at corner for cleaner layout.

### F) Filament admin additions/fixes
- Added `JobApplicationResource` with list/edit management.
- Added status workflow (`new`, `reviewing`, `shortlisted`, `rejected`, `hired`) and notes.
- Added CV open link + inline PDF preview in edit page.
- Fixed Filament compatibility error:
  - replaced unsupported `Placeholder::html()` usage
  - now returns `HtmlString` from placeholder content.

### G) Files added/updated in this session
- `routes/web.php`
- `app/Http/Controllers/HiringController.php`
- `app/Models/JobApplication.php`
- `database/migrations/2026_02_24_130000_create_job_applications_table.php`
- `app/Filament/Resources/JobApplicationResource.php`
- `app/Filament/Resources/JobApplicationResource/Pages/ListJobApplications.php`
- `app/Filament/Resources/JobApplicationResource/Pages/EditJobApplication.php`
- `resources/views/pages/hiring.blade.php`
- `resources/views/pages/hiring-apply.blade.php`
- `resources/views/pages/privacy-policy.blade.php`
- `resources/views/pages/terms-and-conditions.blade.php`
- `resources/views/pages/portfolio.blade.php`
- `resources/views/pages/portfolio-show.blade.php`
- `resources/views/layouts/site.blade.php`

### H) Current state summary
- Public UX is now Blade-native and consistent with theme.
- Hiring flow is fully self-hosted (no Google Form dependency).
- Applications can be reviewed in Filament with CV preview and status tracking.

---

## Update: February 28, 2026 (Courses, Content Interaction, Manual Audio)

### A) Site styling and page polish
- Global visual theme refined around:
  - `#EAEFEF`
  - `#BFC9D1`
  - `#25343F`
  - `#FF9B51`
- Header, menu, cards, buttons, hero sections, footer, legal pages, hiring page, and portfolio page were aligned to the same Blade-first design language.
- Added/adjusted:
  - sticky footer behavior
  - active menu highlighting
  - legal card headers/footers
  - portfolio hero stats
  - glass filter UI
  - improved card sizing/hover behavior
  - custom Arabic font usage (`AL-Mohanad`)

### B) Projects and sponsorship workflow
- Portfolio/projects were moved from static display toward real database-backed rendering.
- Added project domain support for:
  - supervisors
  - contributors
  - sponsors
  - sponsorship inquiries
- Sponsorship inquiry flow now exists from project page to Filament review.
- Approved sponsors are represented separately from the project-sponsor pivot relation.
- Project detail UX improved with:
  - supervisor modal
  - contributor/team modal
  - sponsor visibility only when data exists
  - conditional sponsorship CTA visibility based on project status

### C) Filament admin hardening and settings
- Filament access is now restricted to admin-role users through the shared `users` table.
- Added/fixed dashboard resources around:
  - sponsorship inquiries
  - sponsors
  - supervisors
  - contacts
  - job applications
  - site settings
- Site settings now control hiring availability and public hiring notice behavior.
- Hiring closed-state UX now uses modal guidance instead of abrupt redirect behavior.

### D) Courses module added (new dashboard section)
- Added a separate `Course Management` area in Filament.
- Implemented course system models/tables/resources for:
  - course categories
  - courses
  - instructors
  - lessons
  - student profiles
  - enrollments
  - progress
  - certificates
- Added seeded demo data with:
  - mixed course types
  - statuses
  - instructors
  - students
  - enrollments
  - certificate examples
- Courses page now uses real DB data and supports:
  - hero stats
  - filtering
  - paid/free flags
  - discount display
  - dedicated course detail pages

### E) Pricing and discounts for courses
- Added pricing support to courses:
  - free vs paid
  - base price
  - active discount toggle
  - discount price
  - discount window
- Added payment-related fields to enrollments for future checkout/payment workflow.
- Frontend cards/details now show:
  - free badge
  - paid badge
  - discount badge on image

### F) Blog/article interaction system rebuilt
- Post likes were moved from session-only logic to a dedicated `post_likes` table.
- Real moderated comment system added with:
  - `post_comments` table
  - pending approval workflow
  - Filament moderation resource
  - anti-spam rules
  - optional first name
  - guest commenting support
- Added comment reactions with reversible:
  - like
  - dislike
- Approved comments are now displayed sorted by highest likes first.
- Article UI improvements include:
  - comment form reveal/collapse animation
  - modal-based success/error feedback
  - simplified placeholders-only form
  - cleaner reaction controls

### G) Article audio support switched to manual upload workflow
- Browser speech synthesis prototype was replaced with a manual audio upload strategy.
- Added optional `audio_path` to posts.
- Added Filament audio upload field for articles.
- Article page now:
  - shows a glass audio player card only when an audio file exists
  - hides the entire audio card when no audio file is attached
  - uses real HTML audio playback with circular progress styling
- This avoids TTS API cost and gives editorial control over voice quality.

### H) Content and page additions
- About page redesigned with:
  - new hero
  - real stats
  - timeline
  - mission/pillars sections
- Added separate courses page in navigation.
- `دروس ومقالات` split so menu now has:
  - `مقالات`
  - `الدورات`
- Contact map styling was tested with Leaflet and reverted back to themed iframe/OpenStreetMap embed.

### I) Important operational notes
- Storage-backed media paths are used for uploaded content (`public` disk), including project covers and article audio.
- If image/audio files do not appear in browser, verify:
  - `php artisan storage:link`
  - correct `public` disk path
- The current article audio strategy is manual upload, not external TTS.
- OpenAI moderation integration was tested briefly and then fully removed by request.

### J) Current state summary
- The application now has three major content domains working together:
  - public Blade site
  - Filament admin/dashboard
  - database-backed projects/courses/blog interactions
- Courses and blog interaction systems are now structurally in place, not just static UI.
- Article comments, likes/dislikes, and manual article audio are ready for day-to-day content operations from the dashboard.

---

## Update: March 1, 2026 (Service Requests, Article List Refinement, News Section)

### A) Services page request workflow added
- Public services page now supports direct service request submission from the frontend.
- Added a modal-based request form on the services page with:
  - service name capture
  - contact details
  - request details
  - loading state
  - inline validation feedback
  - success feedback modal
- Added throttled public endpoint:
  - `POST /service-requests` (`service-requests.store`)

### B) Service request backend + Filament admin
- Added new database-backed service request workflow:
  - model: `ServiceRequest`
  - migration: `service_requests` table
  - controller: `ServiceRequestController`
- Added Filament resource for reviewing incoming requests:
  - list incoming service requests
  - edit request status
  - store internal notes
  - badge count for new requests
- Creation from Filament is intentionally disabled; requests originate from the public site.

### C) Blog/article list pages improved
- Research and reflective article list pages were refactored to share a sidebar partial.
- Added contextual sidebar card content per section:
  - `تقنية`
  - `ساحة الفكر`
- Added recent-posts sidebar block fed from the same content system.
- Sidebar behavior on article list pages was adjusted so it remains visible on desktop while scrolling.
- Empty-state handling was added for article list pages when no matching posts exist.

### D) Reflective section renamed in navigation
- Blog submenu item previously shown as `تطوير الذات` was renamed to `ساحة الفكر`.
- The associated list page and sidebar copy were updated to better reflect:
  - self-reflection
  - human experience
  - opinions and contemplative writing

### E) News section added using the existing post system
- Decided not to create a separate news engine.
- Reused the existing post/content/comment/like/read flow for a new category-backed section:
  - category: `news`
- Added top-level navigation item:
  - `الأخبار`
- Added news list route/page:
  - `GET /news` (`news.index`)
- Added dedicated news list view reusing the current article-list structure.
- Shared read page now adapts breadcrumb/back-link context based on category:
  - `تقنية`
  - `ساحة الفكر`
  - `الأخبار`
- Sidebar recent-posts heading is now section-aware, e.g.:
  - `أحدث الأخبار`
  - `أحدث المقالات التقنية`

### F) Database category update completed
- Added migration to insert the `news` category into `categories` if it does not already exist.
- Migration was executed successfully during this session.
- Verified categories now include:
  - `news`
  - `research`
  - `self_development`

### G) Files added/updated in this session
- `AI_SESSION_PROGRESS.md`
- `routes/web.php`
- `app/Http/Controllers/ResearchArticlesListController.php`
- `app/Http/Controllers/ServiceRequestController.php`
- `app/Models/ServiceRequest.php`
- `app/Filament/Resources/ServiceRequestResource.php`
- `app/Filament/Resources/ServiceRequestResource/Pages/ListServiceRequests.php`
- `app/Filament/Resources/ServiceRequestResource/Pages/EditServiceRequest.php`
- `database/migrations/2026_02_28_190000_create_service_requests_table.php`
- `database/migrations/2026_02_28_200000_add_news_category_to_categories_table.php`
- `resources/views/layouts/site.blade.php`
- `resources/views/pages/services.blade.php`
- `resources/views/pages/blog/research_articles_list.blade.php`
- `resources/views/pages/blog/development_articles_list.blade.php`
- `resources/views/pages/blog/news_articles_list.blade.php`
- `resources/views/pages/blog/read_blog.blade.php`
- `resources/views/partials/blog/sidebar.blade.php`

### H) Git checkpoint created
- Created commit:
  - `2ae16d7` `Add service requests and refine blog article listings`
- Additional work after that checkpoint includes the new news section and `news` category migration/application.

### I) Current state summary
- Public content now has three category-backed entry points in the shared post system:
  - `تقنية`
  - `ساحة الفكر`
  - `الأخبار`
- The read page, likes, comments, and moderation flow remain unified across all three.
- Service requests are now a first-class public-to-admin workflow.
