feat: CV navigation links in chat responses (GPS for the CV)
Agent instruction now requires markdown links to CV anchors:
- Companies: [Olympic Broadcasting](#exp-olympic-broadcasting)
- Projects: [Immich Photo Manager](#proj-immich-photo-manager)
- Sections: [Skills](#skills), [Experience](#experience)
formatResponse converts [text](#anchor) → clickable green links
that close the chat panel, smooth-scroll to the target, and
pulse a green highlight for 2 seconds.
All existing CV anchor IDs used: exp-{companyID}, proj-{projectID},
course-{courseID}, plus section IDs (experience, projects, skills, etc.)
This commit is contained in:
@@ -112,6 +112,23 @@ function closeChatHelpAndAsk(question) {
|
||||
sendChatQuestion(question);
|
||||
}
|
||||
|
||||
// Navigate from chat link to CV section, then highlight
|
||||
function scrollToCV(link) {
|
||||
var anchor = link.getAttribute('href');
|
||||
var target = document.querySelector(anchor);
|
||||
if (target) {
|
||||
// Close chat panel
|
||||
document.getElementById('chat-panel').classList.remove('chat-open');
|
||||
document.getElementById('chat-toggle-btn').classList.remove('mascot-active');
|
||||
// Scroll to target
|
||||
target.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
||||
// Highlight briefly
|
||||
target.classList.add('chat-highlight');
|
||||
setTimeout(function() { target.classList.remove('chat-highlight'); }, 2000);
|
||||
}
|
||||
return false; // prevent default anchor navigation
|
||||
}
|
||||
|
||||
// Clear input after HTMX request completes
|
||||
document.addEventListener('htmx:afterRequest', function(event) {
|
||||
if (event.detail.elt && event.detail.elt.id === 'chat-form') {
|
||||
|
||||
Reference in New Issue
Block a user