Add expandable 'Why this score?' explanation under match score - #2
Open
Uzma1206 wants to merge 1 commit into
Open
Add expandable 'Why this score?' explanation under match score#2Uzma1206 wants to merge 1 commit into
Uzma1206 wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Adds a collapsible "Why this score?" section directly under the match score circle. When expanded, it shows a plain-language breakdown of what's helping the candidate's fit ("Why it's strong") and what's holding it back ("What's holding it back"), sourced from the existing
insights.strengthsandinsights.gapsfields already returned by the AI analysis.Motivation
The AI response already includes
insights.strengthsandinsights.gaps— this data was being rendered lower down in the separate Insights section, but nothing tied it directly to the score itself. Users see an "80" or "65" with no immediate context for why that number was chosen. This surfaces that reasoning right where users are already looking, without requiring them to scroll down to a separate section.Changes
content.js: Added a<details>/<summary>block to the score section template (getPanelHTML), and populated it inrenderAnalysis()using the existingdata.insights.strengths/data.insights.gapsfields — no changes to the AI prompt or response schema were needed.styles.css: Added minimal styling for the new.jm-why-scoreblock, including custom expand/collapse arrows (▸ / ▾) and removal of the default<details>marker.Why this approach
Used the native
<details>/<summary>HTML elements instead of a custom toggle with a JS click handler — this keeps the change small, avoids adding event listeners, and gets keyboard accessibility and expand/collapse behavior for free from the browser.Testing
insights.strengths/insights.gapsare absent from the AI responseScreenshots
(attach a screenshot of the collapsed and expanded state here)