fix(runner): l'image d'une question Image déborde du cadre si trop large#136
Merged
Merged
Conversation
…ur conteneur Quand une largeur était définie (settings.maxWidth, ex. 1200px), le composant appliquait à la fois width: 1200px ET maxWidth: 1200px — donc rien ne bornait l'image à la largeur du questionnaire, et une grande image (>1000px) débordait du cadre sur les écrans plus étroits. Fix : on garde width = largeur souhaitée mais on ajoute maxWidth: 100% (borne au conteneur) + height: auto (ratio préservé). La taille choisie est respectée tant qu'elle tient, sinon l'image se réduit proprement au cadre. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
5 tasks
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.
Résumé
Bug rapporté : une question de type Image dont l'image fait plus de ~1000 px déborde du cadre du questionnaire.
Cause : quand une largeur est définie (
settings.maxWidth, ex. 1200px), le composant appliquaitwidth: 1200pxetmaxWidth: 1200px. Rien ne bornait donc l'image à la largeur du conteneur → débordement sur les écrans plus étroits que la largeur choisie.Fix (
DisplayQuestion.jsx, type IMAGE) :width= largeur souhaitée (inchangé)maxWidth: 100%→ l'image ne dépasse jamais le conteneurheight: auto→ ratio préservé quand l'image est réduiteLa taille choisie reste respectée tant qu'elle tient dans le cadre ; sinon l'image se réduit proprement.
Test plan
largeur max= 1200 px sur un écran/cadre plus étroit → l'image se réduit au cadre, sans débordement, ratio conservélargeur max= 300 px → l'image fait bien 300 px (taille respectée)🤖 Generated with Claude Code