Adds draggable score badge and hardens CI pipeline - #30
Merged
Conversation
…ndled promise rejection
Comment on lines
+239
to
+255
| let currentLeft = null; | ||
| let currentTop = null; | ||
|
|
||
| this._dragMoved = false; | ||
|
|
||
| // Garde le badge entièrement visible, quelle que soit la taille du | ||
| // viewport (utile aussi après un redimensionnement de la fenêtre). | ||
| const clamp = (left, top) => { | ||
| const rect = measureUntransformed(); | ||
| return this.clampToViewport( | ||
| left, | ||
| top, | ||
| { width: rect.width, height: rect.height }, | ||
| { width: window.innerWidth, height: window.innerHeight }, | ||
| EDGE_MARGIN | ||
| ); | ||
| }; |
Comment on lines
+316
to
+333
| const restorePosition = async () => { | ||
| try { | ||
| const stored = await _extensionAPI?.storage?.local?.get(STORAGE_KEY); | ||
| // Le storage peut répondre après que l'utilisateur a déjà | ||
| // déplacé le badge: son geste gagne sur la valeur stockée. | ||
| if (userInteracted) return; | ||
| const saved = stored?.[STORAGE_KEY]; | ||
| if (!saved || !Number.isFinite(saved.left) || !Number.isFinite(saved.top)) { | ||
| return; | ||
| } | ||
| el.style.setProperty('right', 'auto', 'important'); | ||
| el.style.setProperty('bottom', 'auto', 'important'); | ||
| const { left, top } = clamp(saved.left, saved.top); | ||
| applyPosition(left, top); | ||
| } catch (error) { | ||
| this.log('Position du badge non restaurée', error); | ||
| } | ||
| }; |
… Escape key handling
BartM82
approved these changes
Aug 24, 2026
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.
Makes the score badge repositionable by mouse, touch, and keyboard, with the position persisted across pages via extension storage. A movement threshold (4 px) distinguishes a drag from a click, so the report still opens on a plain tap. Arrow keys move the badge in fine or coarse steps (Shift), and the badge is clamped to the visible viewport on resize or after a window change.
CI & supply chain hardening:
zizmorworkflow audit job to catch security issues in CI definitionsgh release create) to reduce the trusted action surfaceDependencies:
Tests:
chrome.storage.localso position-persistence tests can observe or replace storage calls