Skip to content

Adds draggable score badge and hardens CI pipeline - #30

Merged
BartM82 merged 21 commits into
M82-project:mainfrom
sebdraven:main
Aug 24, 2026
Merged

Adds draggable score badge and hardens CI pipeline#30
BartM82 merged 21 commits into
M82-project:mainfrom
sebdraven:main

Conversation

@sebdraven

Copy link
Copy Markdown
Member

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:

  • Pins all GitHub Actions to full commit SHAs to prevent supply chain attacks
  • Adds a zizmor workflow audit job to catch security issues in CI definitions
  • Adds Dependabot configuration for weekly automated updates of Actions and npm dev dependencies
  • Replaces the third-party release action with the GitHub CLI (gh release create) to reduce the trusted action surface
  • Upgrades the Node.js runtime from 20 to 24 across all workflows

Dependencies:

  • Upgrades Vitest and the v8 coverage plugin from v2 to v4, pulling in the new Rolldown/Vite 8 stack

Tests:

  • Adds a dedicated test suite covering the drag logic: the viewport-clamping function is tested as a pure function, while click/drag arbitration, CSS transition suspension, keyboard navigation, debounced storage writes, position restore, and error resilience are covered via DOM events
  • Extends the test helper stub to include chrome.storage.local so position-persistence tests can observe or replace storage calls

@sebdraven
sebdraven requested review from BartM82 and a balanced review from Copilot August 24, 2026 12:51

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@sebdraven
sebdraven requested a lite review from Copilot August 24, 2026 14:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.

Comment thread modules/uiManager.js
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 thread modules/uiManager.js
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);
}
};
@BartM82
BartM82 merged commit 8e62901 into M82-project:main Aug 24, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants