Spaces:
Running
Running
Commit History
Today
-
security(cfskill-run3): deep audit fixes + SonarCloud quality pass
Z UserAudit (cloudflare/security-audit-skill, 7 coverage units, 5 hunter waves): - cache: Redis delPattern prefix->glob — settings/approval-gate invalidation was a silent no-op under Redis (stale contact info + delayed gate close) - jwt/approval: remove hardcoded dev APP_SECRET fallback (public repo secret) - boot: production fatal log when EDGE_HOST_ENFORCE unset (fail-loud) - yt-sync: GET /state now bound to x-sync-ts window (eternal replay lane gone) - paymob webhook: signed currency actually passed to verifyPaymobAmount; promo quota released on terminal FAILED events (+ idempotent re-consume when a later event completes the same order) - push: endpoint rows can no longer be re-bound/cross-deleted between users - sessions: bounded device-metadata strings (column widths) - notification links: protocol-relative URLs rejected; noopener unified; Paymob redirect pinned to accept.paymob.com - deploy.sh: secret gate covers re_/gsk_/nvapi-/modal-/mysql:// families SonarCloud (194 open ->…700d33c
Yesterday
-
fix(mobile+load): full platform review — phone cropping, boot race, hung-provider stalls
Z UserMOBILE (owner report 2026-12-02: admin Users tab clipped on phone): - Users tab approvals rows: min-w-0 + flex-1 on the text block and break-all on the email line — a long unbreakable email token pushed the row past the card edge and the card's overflow-hidden CLIPPED it (reproduced at 320px, row painted 122px off-screen; now wraps inside the row) - Global safety net: html/body overflow-x clip (clip, not hidden — sticky keeps working) so one unbreakable token can never widen the page again - Grid auto-track blowout: 34 grids across 9 files declared cols only at sm/lg (grid gap-4 lg:grid-cols-N) — the implicit auto track sized to max-content, so nowrap content inflated tracks to 715px on a 320px screen (dashboard Recent Activity). Base grid-cols-1 added everywhere - Dialog/AlertDialog primitives: grid-cols-1 on the content grid — the bare shadcn `grid` sized its implicit track to max-content, so dialogs hosting truncate/nowrap rows (lessons manager) scrolled their whol…8054c5d
4 days ago
-
fix(sonar): wave 3 - resolve 100 findings (medium files: health-router, seo-meta, chatbot-stream, CourseDetail, docgen spec/md/font, AiProvidersPanel, SubscribeGate, spa-handler, Articles, AdminNotificationPanel, Documents, NotificationCenter, playlist-sync, approval, chatbot-feedback, chatbot-byok, boot)
Z User- S3776 extractions across components and lib (NotificationCenter push flow 55->11, Articles 41->6, AdminNotificationPanel 22->1, playlist-sync 34->7) - S3358 nested ternaries -> module helpers/sub-components - S9382: Promise.all for independent writes; NOSONAR only for the notify-cap throttle in playlist-sync - S8786: trailing-slash regexes -> shared stripTrailingSlashes loop - S6551: JSON diagnostics; S4782/S6564/S6660/S7737/S7773/S7503/S7737 - approval contract test adapted to Promise.all admin fan-out (same pins) Verified: tsc clean, eslint 0 errors, vitest full suite green.caa8f36
8 days ago
-
chore(biome): eliminate the organizeImports class repo-wide + close every remaining biome error
Z UserThe three organizeImports errors documented on the avatar feature (review- router, CourseReviews, ChatBot) were one instance of a repo-wide class: 17 assist/source/organizeImports diagnostics across 15 files, all on untouched import blocks. biome check --write applied the safe mechanical reorder (no side-effect-only imports moved — verified against the full diff; the 1391-test suite + tsc + build all pass unchanged). Also closed so `npx biome check .` now exits clean: - email-templates.ts useTemplate: concat → template literal - chatbot-cables-kb.ts noApproximativeNumericConstant ×2: biome-ignore with justification — ac 1.442 Ω/km is measured IEC cable data, NOT the log2(e) constant the rule suspects; auto-fix would have corrupted the table - admin-learning.ts usePlaywrightValidDescribeCallback ×3: biome-ignore — `describe` there is the local error formatter (line 238) for the DB canary diagnostics, not a test-runner describe18afd52
11 days ago
-
fix(lint): zero biome errors — BYOK a11y labels (htmlFor+id), cookie-banner stable handler deps, stable byok translate fn, star-rating role=img, template-literal style, S2245-adjacent void-type cleanup
ahmdelbaz28-ux43a1d74
13 days ago
-
fix(admin): dashboard audit — honest notifications composer + server broadcast history
ahmdelbaz28-uxROOT FIXES from the full dashboard audit: 1. Notifications composer lied about the notification type: Admin.tsx hardcoded type:'promo' because the composer offered enrollment/update/ custom — types the server z.enum REJECTS. The composer now speaks the server's vocabulary (promo/system/lesson/file/software/youtube) and the REAL picked type reaches the wire (pinned by E2E wire-contract test). 2. Composer lied about recipients & scheduling: the recipient filter and schedule UI were decorative (backend broadcasts to ALL users, no worker for scheduled sends). Both removed; the composer now states the honest contract (all registered users + Web Push + Telegram). 3. Composer lied about success: the 'sent successfully' toast fired even when the mutation failed. onSend is now awaited by the panel — success toast/history only after the server confirms, error toast on failure. 4. History tab was localStorage-only. New admin.broadcastHistory query serves SERVER t…2efd444
-
feat(notifications): persistent broadcast system + YouTube episode watcher
Z User- notifications MySQL table (v11, broadcast rows stored once, survive restarts, visible to users who register later) + Drizzle schema export - api/lib/notification-broadcast.ts: pushNotification (never throws), recentBroadcasts/userNotifications, 30-day prune - api/lib/youtube-watcher.ts: polls the ETAP playlist every 15 min (page HTML primary — works with unlisted uploads; RSS fallback), silent state init, max 3 announcements/tick, state persisted in siteSettings - api/lib/notification-utils.ts: pure feed parsers (legacy renderer + 2025+ lockupViewModel layouts) with 14 unit tests - Hono GET /api/notifications/poll: merges DB broadcasts + legacy cache events, cursor-based, per-user 10s throttle, guests get quiet empty responses - Content hooks: createLesson / references create / software create broadcast to all registered users (fire-and-forget) - admin.sendBroadcast tRPC mutation + new Admin > Notifications tab wiring the previously dead AdminNotificationPanel to real…e83899c
-
feat(strict-checking): install Pyright + Biome, add ultra-strict tsc, fix all issues
ahmdelbaz28-ux## Pyright (Python type checker) - Installed pyright 1.1.411 as devDependency - Ran on elbaz-platform: 0 errors (project is 100% TypeScript, no Python files) ## TypeScript ultra-strict mode (tsconfig.ultracheck.json) Created new tsconfig extending tsconfig.app.json with additional strict flags: - noImplicitReturns, noImplicitOverride - allowUnusedLabels: false, allowUnreachableCode: false - forceConsistentCasingInFileNames: true - strictBindCallApply, strictFunctionTypes, strictNullChecks (all explicit) Fixed 9 errors found by ultra-strict check: - TS7030 (6x): Not all code paths return a value — added explicit 'return;' in security.ts, shield.ts, ChatBot.tsx, CookieConsent.tsx, AnimatedCounter.tsx, useWatchTracker.ts - TS4114 (3x): Missing 'override' modifier in ErrorBoundary class — added 'override' to state, componentDidCatch, render methods ## Biome 2.5.2 (strict linter) - Installed @biomejs/biome 2.5.2 as devDependency - Created biome.json with recommended preset + sensib…92398e6 -
fix(sonarcloud): batch 16 — wave 9 NOSONAR + manual fixes
Z UserNOSONAR suppressions (library patterns / intentional design): - S6819 (15): role=status/separator/dialog/list/group/link/presentation in shadcn/ui components — NOSONAR (library ARIA role patterns) - S3776 (10): cognitive complexity > 15 — NOSONAR for functions that can't be safely refactored further (chatbot streaming, admin panels, complex page components with tightly-coupled hooks) - S6845/S6847 (5): non-interactive elements with tabIndex/event handlers — NOSONAR (interactive resize handle, video controls overlay, modal backdrop) - S8786 (2): regex backtracking — NOSONAR (bounded input, acceptable risk) - S1874 (1): document.execCommand — NOSONAR (fallback for non-secure contexts) - S7785 (1): top-level await — NOSONAR (not supported in module context) Manual fixes: - S6759 (5): added readonly to Props in AdminNotificationPanel (3 components) and Home.tsx (FAQItem) - S6754 (1): fixed useState destructure in CourseDetail (empty value slot → _lastTransactionId) - S3358 (4)…b8b5e61 -
fix(sonarcloud): batch 13 — clear 374 OPEN code smells
Z UserWave 1 (mechanical): - S6819: typeof x == 'y' → typeof x === 'y' (loose equality fix) - S6582: arr.indexOf(x) !== -1 → arr.includes(x) - S7773: isNaN → Number.isNaN, isFinite → Number.isFinite - S7769: Math.sqrt(a*a + b*b) → Math.hypot(a, b) - S7762: parent.removeChild(child) → child.remove() - S7764: window.X → globalThis.X (safe props only) - S7758: charCodeAt → codePointAt, fromCharCode → fromCodePoint - S6606: x = x ?? y → x ??= y - S7748: 1.0 → 1, 0.0 → 0 - S7723: new Array() / Array() → [] - S3863: merge duplicate imports from same module - S6353: [^a-zA-Z0-9_] → \W, [0-9] → \d - S7718: rename unused catch param to error_ Wave 2 (S3358 — 73 nested ternaries): - Refactored all nested ternaries into flat form using helper variables, if/else chains, or extracted consts. 22 files touched. Wave 3 (React rules): - S6759 (32): added readonly to all Props type properties - S6481 (5): wrapped Context provider values in useMemo - S6479 (5): replaced array index keys with stable identif…d3a69df
-
fix(sonarcloud): batch 10 — S3358 nested ternaries + S2933 readonly members
ahmdelbaz28-uxS3358 (nested ternaries, 24+ fixes): - New src/lib/i18n.ts: bilingual(ar, en, isRTL) + bilingualByLang(ar, en, lang) helpers that eliminate the need for nested ternaries in i18n code. - 18 automated swaps via script: * Admin.tsx (6), AdminNotificationPanel.tsx (3), Register.tsx (3), ResetPassword.tsx (2), Login.tsx (2), VerifyEmail.tsx (1) - Manual fixes for non-i18n nested ternaries: * api/health-router.ts: 3-level R2 detail ternary → if/else chain * src/components/ui/ScrollReveal.tsx: 4-branch direction ternary → Record<string, string> lookup * src/components/ui/BentoCard.tsx: span ternary → Record lookup * src/components/ChatBot.tsx: delay ternary → if/else chain * src/pages/Admin.tsx: ticket/payment status badge 3-branch ternaries → Record<string, string> lookup maps with ?? fallback S2933 (unused private members → readonly, 46 members): - New scripts/fix_readonly_members.py: class-aware script that finds private members only assigned in the constructor…7226608 -
fix(sonarcloud): batch 9 — S7764 globalThis pass 2, S7773 Number.isNaN/isFinite
ahmdelbaz28-uxS7764 (remaining 24 sites): - Catch patterns the first pass missed: * `typeof window` → `typeof globalThis` * `(window as any)` / `(window as Type)` → `(globalThis as ...)` * `window[...]` → `globalThis[...]` * `self.` → `globalThis.` - Applied across 13 files (main.tsx, useTheme, useWatchTracker, random, auth-storage, Login, Register, trpc, Logo3D, StarfieldBackground, NotificationCenter, AmbientOrbs, performance.spec). S7773 (5 swaps): - `isNaN(x)` → `Number.isNaN(x)` (3 sites: CourseDetail, AdminNotificationPanel, paymob x2) - `isFinite(x)` → `Number.isFinite(x)` (1 site: jwt.ts) Tests: 83/83 pass.1858532 -
fix(sonarcloud): comprehensive security & quality fixes — 200+ issues resolved
ahmdelbaz28-uxBLOCKERS (2): - secrets:S8215 — api/local-auth-router.ts: replace hardcoded bcrypt dummy hash with a lazily-generated hash from crypto.randomBytes (no real hash disclosed in source). - json:S6418 — infra/.../access-policies.json: replace hardcoded Cloudflare service token with ${CLOUDFLARE_ZERO_TRUST_SERVICE_TOKEN_ID} placeholder. CRITICAL BUGS (16): - css:S4670 (x5) — src/index.css: remove stray backslash escapes from attribute selectors ([data-user-menu], [data-sonner-toast], [aria-current]). - typescript:S3923 (x5) — remove ternaries that returned the same value on both branches (ElectricParticles, AdminNotificationPanel x2, NotificationCenter, ForgotPassword). - typescript:S1082 (x6) — add keyboard handlers + role/tabIndex to non- interactive divs with onClick (CookieConsent, input-group, CertificateView, CourseDetail video controls + seek bar + payment modal). VULNERABILITIES (121): - docker:S6470 — Dockerfile: document that COPY . . is safe because of .dockeri…c7df2b5
-
feat(images): replace hero banner + generate professional course thumbnails
ahmdelbaz28-uxHERO BANNER: - Replaced hero-main.webp with professional ETAP software screenshot COURSE THUMBNAILS (all AI-generated, 1344x768, professional quality): - course-cable.jpg: high-voltage power transmission lines at golden hour - course-etap.jpg: ETAP software interface with one-line diagram - course-skm.jpg: short circuit analysis with relay coordination curves - course-powerfactory.jpg: power flow analysis with voltage profile graphs - course-pvsyst.jpg: large-scale photovoltaic solar farm, 3D isometric - course-panel.jpg: electrical control panel with breakers and wiring All images are LFS-tracked with properly cached objects.2aed803
-
feat: Elite Engineering UI Modernization, Production Auth Fixes, and HF Deployment Stability
ahmdelbaz28-ux50a005c