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
4 days ago
-
fix(sonar): wave 8 - final sweep, all 21 remaining live findings
Z User- S8689/S5144: documented sanitizer/authority invariants (redact() contract, fixed-hostname + origin-form) - taint-model blind spots, NOSONAR justified - S3776 x3: extract collectNormalizedMessages, verifyRightsAndSweep, ReviewsHeader (16 -> <=15 each) - S8786/S5843: extract_refs_kb trailing-number + kW token validators (differential-fuzz equivalent: 0 mismatches / 200k cases), redact() regex linearized in both probe scripts, HEAD_RE_PARTS regrouped (0/60k) - css:S7924 x2: cyan-500 -> cyan-400 at the flagged rules (4.5:1 cleared) - S7503/S3626 write-strategies, S6582 worker, S4323 cables aliases, S7786 TypeError, S2486 comment style Verified: tsc clean, eslint clean, vitest 1394/1394, py_compile clean.5632e3b -
fix(sonar): wave 7 - cleanup round from live scan (93 findings across 65 files)
Z User- 34 in-scope follow-ups exposed by the 17:59 scan (refactor residuals: S3776 helper splits, S4323 type aliases, S6759 readonly on extracted components, S8786 bounded-regex justifications, S6551 scrub patterns, S9440/S7924 CSS at new positions) - python leftovers: 29x S1481 positional _, S8786 regex canonicalization (fuzz-verified), S3776 task24 step-fn hoisting, S1192 dialog/content-type consts - operator tooling: S9382 documented NOSONARs for deliberate poll/throttle loops + Promise.all for independent probes, S8689 second log site routed through redact(), S5144 second fetch site behind UPSTREAM_HOST_ALLOWLIST Verified: tsc clean, vitest 1394/1394, node --check + py_compile on touched scripts.6780540 -
fix(sonar): wave 2 - resolve 112 findings (CourseReviews, telegram-bot, saudi-kb, chatbot, shape, css, refs.test)
Z User- CourseReviews: S3776 40->14 via label helpers, S3358, S6759 readonly props - telegram-bot: S3776 extractions (splitForTelegram, handlePrivateMessage, pollLoop, supervisorBody), S9382 throttle NOSONARs, S7503 de-async, S4782, S6582; retry_after sleep removed from loop - chatbot-saudi-kb: S7780 String.raw x12 - chatbot.ts: S3776 cascade/sweep extractions, S107 bundle, S4123 sync validators, S6551 JSON.stringify diagnostics - docgen/shape.ts: bidiRuns decomposed (95->~2), S3358/S4323/S7755, docgen output pinned by existing tests - index.css + elite-animations.css: S9440 consolidated prefers-reduced-motion blocks, S9449 explicit transition properties, S4666 merged duplicate selectors, S9450, S7924 contrast fixes - chatbot-refs.test.ts: S5906 toHaveLength assertions Verified: tsc clean, eslint 0 errors, biome clean, vitest 1394/1394.c2dde89
7 days ago
-
feat(ui): implement review suggestions #2-#5 — motion discipline, signature completion, proof system, certificate share asset
Z UserSuggestion #2 — one motion per screen (Brand Kit §6): hero is now visually silent except the primary CTA: static Zap badge, static ambient glow, static image frame, static floating cards, static scroll indicator; the ONLY continuous motion is the new .brand-cta-glow pulse (opacity-only pseudo-element, reduced-motion safe). Background icon layer cut 25→5 icons sharing ONE slow 40s transform drift. Suggestion #3 — signature completion: .brand-signature-line now under every Home section title (removed the clashing section-header-glow divider), .brand-signature-hover floors on the AI-section + CTA-banner primary buttons (new optional wrapperClassName on ArcFlashButton — backward compatible). Headline keyword gradient-text switched to the official orange→cyan signature. Suggestion #4 — unified proof system (truthful by construction): green check chip "شهادة موثقة" on course cards, "طالب موثق" badge on every published review (reviews are enrollment-gated server-side…d42fc97
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 -
feat(avatar): profile photo now surfaces in chat bubbles and course reviews
Z UserOwner request (2026-11-26): the photo uploaded from the profile page (31baaf4) should follow the user across every social surface — chat messages and course reviews — not just the profile/navbar. Server: - review-router.listByCourse now projects userAvatar (users.avatar) with each published review; the sibling lesson-comments router already returned it, so the review list was the odd one out. Client: - CourseReviews.tsx: reviewer avatar circle renders the real photo when set (lazy/async, cover-cropped), initials circle stays the fallback for reviewers without a photo — identical geometry, no layout shift. - ChatBot.tsx: MessageBubble gains a stable userAvatar prop (memo-safe — changes only when the user actually changes their photo); user bubbles wear the real photo in place of the generic User icon chip, icon chip remains the fallback. Assistant bubbles keep the site logo. Admin moderation tables intentionally keep compact initials (moderation rows…2e6a64d
11 days ago
-
perf(lists): content-visibility render-skip for long below-fold lists — articles grid, course reviews, lesson rows, dashboard enrollments, admin mod/audit/roster queues
ahmdelbaz28-uxThree CSS utilities (cv-auto 320px / cv-auto-md 180px / cv-auto-row 72px) with contain-intrinsic-size: auto <estimate> — the browser remembers the real rendered size after first paint, so placeholders only apply to never-seen items and later scrolls never shift layout (CLS-safe with the skeleton-geometry + idle-warm work). Applied from index >= 6-12 per list: the first screenful always paints fully; the growing tail stops rendering (style+layout+paint) until scrolled near — rendering cost becomes ~O(viewport) instead of O(list length) on articles/courses/reviews/lessons/audit pages.fe1f1c0
20 days ago
-
fix(a11y+lint): zero biome errors — real a11y cures, YT resume race fix, sanitizer widened
ahmdelbaz28-uxBiome 2.6.2 migration (schema matched to CLI) surfaced 31 latent findings; every one is resolved at the root — suppressions only where intentional: REAL BUGS fixed: - YouTubeLessonPlayer auto-resume race: the effect keyed only [ready, lessonId] so progress resolving AFTER player-ready never resumed — lessons silently restarted from 0:00 on slow networks. Now guarded once-per-lesson (resumedLessonRef) with savedProgress in deps; first of (ready AND progress) wins, refetches never re-seek mid-playback. - Admin testimonial form: 6 labels unassociated with controls — proper htmlFor/id pairs so screen readers announce every field. - CourseReviews: stars row gains role=img (aria-label now honored); rating buttons rebuilt as REAL radio inputs inside labels (keyboard-accessible, native checked state); stray <label> with no control becomes a <span>. - ChatBot feedback row: role=group div -> fieldset (border reset via classes). - CommentNudge: role=complementary div -> semantic <a…7e3d3ff
24 days ago
-
security+ux(pre-launch-audit): close CORS/CSRF null-origin hole, exact-origin gate, course pagination, reviews UI, RTL+a11y sweep
Launch Audit BotSECURITY (P0, regression-tested): - Remove opaque origin 'null' from CORS + CSRF allowlists (api/boot.ts, api/middleware/security.ts) — sandboxed <iframe sandbox> attacks that ride SameSite=None cookies are now rejected 403. Electron prod loads the live origin since the session-persistence fix; native shells use Bearer tokens. - CSRF same-origin gate: exact parsed-origin comparison replaces startsWith() prefix matching (sibling-domain bypass closed). - Session grace window 30d -> 24h (api/context.ts): stolen-token effective lifetime drops from ~37d to ~8d; tokenVersion revocation unchanged. - chatbot /stream: malformed JSON now 400 INVALID_JSON instead of unhandled 500. - NEW api/middleware/security.csrf.test.ts — 8 permanent regression tests (null origin, sibling domain, legit origins, S2S no-origin, referer exactness). UX (P1): - Courses catalog: real server-side pagination (?page=N) + debounced server-side search — courses 13+ are no longer unreachable; filter chips …b9995d9