Skip to content

feat: chatbot polish — constants, Vitest, enriched personality & metrics#62

Open
mdabir1203 wants to merge 5 commits into
mainfrom
session/chatbot-polish-jun13
Open

feat: chatbot polish — constants, Vitest, enriched personality & metrics#62
mdabir1203 wants to merge 5 commits into
mainfrom
session/chatbot-polish-jun13

Conversation

@mdabir1203

Copy link
Copy Markdown
Owner

Summary

  • Magic numbers → named constants in ChatWidget.tsx: QWEN_MODEL_ID, MAGNETIC_RANGE_PX, CACHE_HIT_MS, BURST_RADIUS_PX, IDLE_TOOLTIP_DELAY_MS, QUESTION_CYCLE_MS, MAX_RESPONSE_TOKENS, RESPONSE_TEMPERATURE
  • Mail icon conflict fixed: was shadowed by a local SVG component; now uses lucide-react Mail throughout
  • Emphasis words moved to translations.ts: en.hero.emphasisWords / ar.hero.emphasisWordsIdentityHeroBento reads from tx instead of a hardcoded Set
  • Vitest setup: vitest.config.ts, npm run test script, 27 passing unit tests across contact schema, Medium RSS parser, and YouTube channel ID/RSS extraction
  • Pure helper modules extracted: medium.helpers.ts and youtube.helpers.ts so logic is testable without the TanStack server wrapper
  • System prompt enriched with specific metrics: every case study now leads with exact numbers (+38% output, −30% MTTR, <50ms, 50+ sellers, 325K readers) so the AI sounds like a confident exec, not a vague pitch deck
  • Chatbot personality added: explicit voice guidelines (sharp, warm, occasionally funny), banned corporate filler ("Certainly!", "Great question!"), warm redirects for out-of-scope questions, greeting updated EN + AR

Test plan

  • npm run test → 27 tests pass
  • Open chat widget → greeting reads naturally, not robotic
  • Ask "Tell me about AbayaTrack" → response cites +38%, 92%, −30%, 0 extra hires
  • Ask "What makes you different?" → answer has personality, not bullet-point recitation
  • Model loads from cache → celebration burst fires, tooltip "Ask me about Abir →" appears after 4s idle
  • Arabic mode → emphasis words highlight correctly from translations

🤖 Generated with Claude Code

mdabir1203 and others added 3 commits June 13, 2026 21:51
- ChatWidget: named constants for all magic numbers (QWEN_MODEL_ID,
  MAGNETIC_RANGE_PX, CACHE_HIT_MS, etc.), fix Mail icon shadowing by
  using lucide-react import throughout
- translations: emphasisWords arrays in en/ar hero — IdentityHeroBento
  reads from tx instead of hardcoded Set
- server: extract pure helpers (medium.helpers.ts, youtube.helpers.ts)
  so logic is unit-testable without the TanStack server wrapper
- tests: 27 passing Vitest tests across contact schema, Medium RSS
  parser, and YouTube RSS/channel-ID extraction
- package.json: test / test:watch / test:coverage scripts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Every case study now leads with exact numbers (38% output, 30% MTTR,
50ms persona detection, 50+ sellers, 325K readers) so the AI answers
like a confident exec, not a vague pitch deck.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
System prompt now has explicit voice guidelines: confident not arrogant,
playful with curious visitors, fast signal for recruiters, no corporate
filler. Greeting updated EN+AR to match the new tone.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
portfolio2025 Ready Ready Preview, Comment Jun 27, 2026 9:08am

@netlify

netlify Bot commented Jun 13, 2026

Copy link
Copy Markdown

Deploy Preview for visanav failed.

Name Link
🔨 Latest commit 59b0bd2
🔍 Latest deploy log https://app.netlify.com/projects/visanav/deploys/6a3f92e94f259b00083027c1

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 13, 2026

Copy link
Copy Markdown

Deploying portfolio2025 with  Cloudflare Pages  Cloudflare Pages

Latest commit: 59b0bd2
Status: ✅  Deploy successful!
Preview URL: https://732ce247.portfolio2025-9zi.pages.dev
Branch Preview URL: https://session-chatbot-polish-jun13.portfolio2025-9zi.pages.dev

View logs

Comment on lines +4 to +5
return s
.replace(/&amp;/g, "&")
- Add SmartSwap case study infographic (case-study-smartswap.webp, q100
  WebP ~417KB) as the Work page hero visual; align outcome cards to its KPIs
- Replace broken HTML "download CV" buttons with a real PDF
  (Abir_Abbas_CV.pdf) — all CV buttons now view/download the PDF
- Add scripts/cv-to-pdf.js + `npm run cv:pdf` to regenerate the PDF
  from public/cv-ats.html via headless Chromium

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The generated _worker.js only routed a fixed set of asset extensions to
env.ASSETS; everything else fell through to the SSR handler. /Abir_Abbas_CV.pdf
(and cv-ats.html, sitemap.xml) therefore 404'd in production — "Couldn't
download - No file". Add pdf/html/xml/json/webmanifest/md to the routing regex.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants