Root Cause: Knowledge base context was being added to simple value prompts, overriding the directive to return only the value.
Example of the problem:
- User types: "Stanford"
- AI responds: "Stanford is the host institution for the Miller Indigenous Economic Development Fellowship..."
- Expected: "Stanford University" (as a suggestion with approval buttons)
Fixes Applied:
File: app/routes/api.extension.chat.tsx (lines 153-179)
- Detect simple values using same criteria as prompt building
- Skip
searchKnowledgeBase()for select/radio fields and simple values - Prevents context from being added that causes AI to discuss instead of return
File: app/routes/api.extension.chat.tsx (lines 224-248)
- Removed all context from simple value prompt
- More direct instructions: "YOU ARE A FORM-FILLING ASSISTANT"
- Added explicit examples showing input → output format
- Emphasized: "NO explanations, NO context, NO suggestions"
Expected Result: User types "Stanford" → AI returns "Stanford University" → Shown as suggestion with ✨ "Sounds good!" button
Problem: For radio buttons like "Are you currently a doctoral candidate? Yes/No", the extension detected "yes" as the field label instead of the question.
Fix: chrome-extension/content-v037.js (lines 284-327)
Changes:
- Minimum length check: Skip candidates shorter than 15 characters (eliminates "Yes", "No", "Male", "Female")
- Question mark priority: Labels with
?get 1000-point bonus - Use clean text: Call
getCleanLabelText()to exclude nested form elements - Fix compareDocumentPosition: Use
DOCUMENT_POSITION_FOLLOWINGinstead ofPRECEDING
Expected Result: Radio groups now detect the full question as the label
Problem: First sparkle (and possibly others) showed two tooltips when hovering.
Root Cause: Code was creating both a custom .sp-tooltip div AND setting icon.title which creates a native browser tooltip.
Fix: chrome-extension/content-v037.js (line 768)
- Removed
icon.title = tooltipText; - Kept only the custom tooltip div
Expected Result: Only one tooltip appears on hover
Status: Code appears correct, needs testing
What should happen:
- After login, auth banner is removed (line 1880)
processFields()is called (line 1882)- Banner shows: "✨ X fields ready • Y generating..." (line 1616)
- Auto-dismisses after 5 seconds (line 1462-1466)
Possible issues:
- Banner shown but dismissed before user returns to tab
- Timing issue where fields aren't ready when user returns
- Auth detection not firing (check browser console logs)
Debug steps:
// Check console for these logs:
"Scholarships Plus: Auth token detected, re-processing fields"
"Scholarships Plus: Extracted X fields"
"Scholarships Plus: Updated sparkles - X ready, Y generating"-
app/routes/api.extension.chat.tsx
- Lines 153-179: Skip knowledge base for simple values
- Lines 224-248: More forceful simple value prompt
-
chrome-extension/content-v037.js
- Lines 284-327: Improved radio button label detection
- Line 768: Removed duplicate tooltip
# Copy updated files to Windows mount
cp /home/trill/Development/scholarships-plus/chrome-extension/content-v037.js \
/mnt/c/Users/Omni/Development/chrome-extension/
# Bump version in manifest.json (Chrome caches!)
# e.g., "version": "0.2.6"
# Reload extension at chrome://extensions/
# Hard refresh test page (Ctrl+Shift+R)- Click empty sparkle for "University" field
- Type "Stanford" in chat
- Expected: AI returns "Stanford University" as suggestion
- Expected: Shows buttons: "✨ Sounds good!" and "Let's change that."
- Click "✨ Sounds good!"
- Expected: Field fills with animation
- Find radio button group: "Are you currently a doctoral candidate? Yes/No"
- Expected: Sparkle appears next to question, NOT next to "Yes"
- Expected: Chat greeting says: "...help you with 'Are you currently a doctoral candidate?'"
- Hover over any sparkle
- Expected: Only ONE tooltip appears
- Expected: No native browser tooltip
- Log out, navigate to scholarship application
- Expected: Red auth banner appears
- Log in (in new tab)
- Return to application tab
- Expected: Auth banner removed
- Expected: Green banner shows: "✨ X fields detected"
- Expected: All sparkles appear immediately
- Click sparkle for essay field
- Type: "Can you help me write about my research experience?"
- Expected: AI generates paragraph with context
- Expected: Shows as suggestion with approval buttons
- Click "Let's change that."
- Expected: Can continue refining
Current behavior: Each time you open the chat, it starts fresh. Previous conversation is lost.
User expectation: Chat should remember what was discussed (e.g., "Nope." should reference earlier "Save Stanford as my university")
Solution needed:
- Store conversation history in database per (applicationId, fieldName)
- Load history when opening chat
- Clear history when field is filled
Not implemented yet - would require backend changes
Check browser console Network tab for /api/extension/chat request:
{
"scholarshipId": "...",
"applicationId": "...",
"fieldName": "university", // ← Should be present for field-specific chat
"fieldLabel": "Name of college or university",
"fieldType": "text",
"message": "Stanford"
}If fieldName is missing, currentFieldName is null in content script.
Check browser console for the response label:
- Should see: "Suggested response:" (with buttons)
- If you see: "Assistant" (no buttons) → field mode not detected
Add console.log:
// Line 1253 in content-v037.js
console.log('currentFieldName:', currentFieldName);Check console logs:
[FINDLABEL] Starting for element: doctoral radio
[SPARKLE] Field: doctoral Source: radio-group-before-input Label text: Are you currently a doctoral candidate?
Should show the full question, not "yes" or "no".
- Deploy and test the changes
- Check browser console for any errors
- Report results - which issues are fixed, which persist
- Consider chat memory feature if needed