From 2a958262ccdb0b6354f1d5240cacd1d5c064d653 Mon Sep 17 00:00:00 2001 From: WDI-Ideas Date: Mon, 30 Mar 2026 03:23:13 +0530 Subject: [PATCH 1/3] chore: remove debug logs and harden slug helper edge cases --- .gitea/workflows/src/components/LearningFacilityNew.tsx | 4 ---- .gitea/workflows/src/utils/urlHelpers.ts | 8 +++++++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/src/components/LearningFacilityNew.tsx b/.gitea/workflows/src/components/LearningFacilityNew.tsx index 2bd37ab..f54888c 100644 --- a/.gitea/workflows/src/components/LearningFacilityNew.tsx +++ b/.gitea/workflows/src/components/LearningFacilityNew.tsx @@ -389,12 +389,10 @@ export function LearningFacilityNew() { const [expandedTourCard, setExpandedTourCard] = useState(null); useEffect(() => { - console.log('LearningFacility component mounted'); // Debug log window.scrollTo(0, 0); // Listen for custom booking modal event from CTAPopupModal const handleOpenBookingModal = () => { - console.log('Custom booking modal event received'); // Debug log handleBookNow(); }; @@ -403,7 +401,6 @@ export function LearningFacilityNew() { // Also check if we should auto-open the booking modal based on URL parameters const urlParams = new URLSearchParams(window.location.search); if (urlParams.get('autoBooking') === 'true') { - console.log('Auto-opening booking modal from URL parameter'); // Debug log setTimeout(() => handleBookNow(), 100); } @@ -1850,7 +1847,6 @@ function BookingModal({ const handleFormSubmit = (e: React.FormEvent) => { e.preventDefault(); - console.log('Booking form submitted:', bookingForm); // Here you would typically send the form data to your backend alert('Booking request submitted successfully! We will contact you soon.'); onClose(); diff --git a/.gitea/workflows/src/utils/urlHelpers.ts b/.gitea/workflows/src/utils/urlHelpers.ts index 9f5a27d..1f3b513 100644 --- a/.gitea/workflows/src/utils/urlHelpers.ts +++ b/.gitea/workflows/src/utils/urlHelpers.ts @@ -18,8 +18,14 @@ export const createSlug = (text: string): string => { * Example: "Ad ut neque enim omn", "e7d611b6-853b-4785-b508-599eeed2af92" -> "ad-ut-neque-enim-omn-e7d611b6-853b-4785-b508-599eeed2af92" */ export const getSlugWithId = (title: string, id: string) => { + const slug = createSlug(title); const normalizedId = id.trim(); - return `${createSlug(title)}-${normalizedId}`; + + if (!slug && !normalizedId) return ''; + if (!slug) return normalizedId; + if (!normalizedId) return slug; + + return `${slug}-${normalizedId}`; }; /** -- 2.34.1 From 392cc789333d00cd00d06efebce07fef1d140797 Mon Sep 17 00:00:00 2001 From: WDI-Ideas Date: Mon, 30 Mar 2026 03:24:17 +0530 Subject: [PATCH 2/3] fix: treat HTML nbsp as whitespace in reading time --- .gitea/workflows/src/utils/getReadingTime.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitea/workflows/src/utils/getReadingTime.ts b/.gitea/workflows/src/utils/getReadingTime.ts index 8b01a10..54eaee3 100644 --- a/.gitea/workflows/src/utils/getReadingTime.ts +++ b/.gitea/workflows/src/utils/getReadingTime.ts @@ -2,7 +2,7 @@ export const getReadingTime = (text: string): string => { if (!text) return "0 min read"; // Remove HTML tags if present - const cleanText = text.replace(/<[^>]+>/g, ""); + const cleanText = text.replace(/<[^>]+>/g, "").replace(/ /gi, " "); if (!cleanText.trim()) return "0 min read"; // Count words -- 2.34.1 From eeddcafe40cd3b2864c91c18307294e9c93eb1e0 Mon Sep 17 00:00:00 2001 From: WDI-Ideas Date: Mon, 30 Mar 2026 03:33:00 +0530 Subject: [PATCH 3/3] ci: review PR files sequentially to mitigate 403/html API failures --- .gitea/workflows/codeant.yml | 39 +++++++++++++++++++++++++++++------- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/.gitea/workflows/codeant.yml b/.gitea/workflows/codeant.yml index 55a858c..2c8d668 100644 --- a/.gitea/workflows/codeant.yml +++ b/.gitea/workflows/codeant.yml @@ -96,14 +96,39 @@ jobs: if [ "${GITHUB_EVENT_NAME}" = "pull_request" ] && [ -n "${GITHUB_BASE_REF}" ]; then echo "Running PR review against base branch: ${GITHUB_BASE_REF}" - for attempt in 1 2 3; do - echo "PR review attempt $attempt/3" - codeant review --base "${GITHUB_BASE_REF}" --exclude "${REVIEW_EXCLUDES}" 2>&1 | tee review.txt || true - if ! grep -q "Unexpected token '<'" review.txt; then - break + git fetch origin "${GITHUB_BASE_REF}" --depth=1 || true + + CHANGED_FILES=$(git diff --name-only "origin/${GITHUB_BASE_REF}...HEAD" | grep '^.gitea/workflows/src/' | grep -v '^.gitea/workflows/codeant.yml' || true) + + if [ -z "${CHANGED_FILES}" ]; then + echo "No source files changed in PR scope." | tee review.txt + exit 0 + fi + + echo "Files to review:" + echo "${CHANGED_FILES}" + + FAILED=0 + : > review.txt + while IFS= read -r file; do + [ -z "$file" ] && continue + echo "--- Reviewing: $file ---" | tee -a review.txt + codeant review --base "${GITHUB_BASE_REF}" --include "$file" --exclude "${REVIEW_EXCLUDES}" 2>&1 | tee -a review.txt || true + + if grep -q "Unexpected token '<'\|HTTP error 403" review.txt; then + FAILED=1 + echo "Transient API failure detected for $file; continuing to next file." | tee -a review.txt fi - sleep $((attempt * 15)) - done + + # Pace requests to avoid backend throttling on CI runners. + sleep 12 + done <