Add EU AI-disclosure label to the popup - #38
Open
jobic10 wants to merge 1 commit into
Open
Conversation
Adds the European Commission's official AI-labelling icons (AI, AI GENERATED, AI MODIFIED) and suggests the one matching a session's composition, as an informational line under the popup breakdown. - src/assets/eu-icons: the 12 official Commission SVGs (3 marks in black/white, solid and 50% transparent), free to use, no attribution required. Ship via the existing recursive src/assets copy. - src/lib/eu-ai-label.js: maps a session's kept AI share to the right mark. AI GENERATED only at effectively 100% AI (no human-created elements), AI MODIFIED for a genuine human/AI mix, basic AI for minimal use, none when no AI was recorded. - popup: the suggested label is derived from the same rounded percentages the breakdown bars display, so it can never contradict them (an AI bar of 0% shows no label). Hovering the row explains why that label was suggested. Informational only: nothing is written to the log or auto-applied. The author decides whether an AI Act Article 50 disclosure actually applies. Includes unit tests for the classification thresholds and icon paths.
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
Adds the European Commission's official AI-labelling icons and surfaces the one matching a session's composition as an informational line under the popup breakdown.
Details
src/assets/eu-icons/: the 12 official Commission SVGs (AI, AI GENERATED, AI MODIFIED, each in black/white, solid and 50% transparent). Freely usable, no attribution required. They ship via the existing recursivesrc/assetscopy, so no build change was needed.src/lib/eu-ai-label.js: maps a session's kept AI share to the right mark. AI GENERATED only at effectively 100% AI (no human-created elements beyond prompting), AI MODIFIED for a genuine human/AI mix, basic AI for minimal use, and none when no AI was recorded.Scope and safety
Informational only. Nothing is written to the TWFF log and nothing is auto-applied. Colophon cannot know whether a document falls within AI Act Article 50 scope (deepfakes, or text on matters of public interest without editorial review), so the author decides whether a disclosure actually applies.
Tests
Adds unit tests for the classification thresholds, session summarisation, and icon-path resolution. Full suite: 110 passing, lint clean (0 errors), build succeeds.
Note for reviewers
The popup label follows the bars' event-count basis so the two always agree visually. When the authoritative label eventually moves to the TWFF export/viewer, that surface should use the character-based measure in
eu-ai-label.jsfor precision. The extension popup (awareness) and the export (disclosure) can intentionally differ there.