Skip to content

Add EU AI-disclosure label to the popup - #38

Open
jobic10 wants to merge 1 commit into
mainfrom
feature/eu-ai-disclosure-icons
Open

Add EU AI-disclosure label to the popup#38
jobic10 wants to merge 1 commit into
mainfrom
feature/eu-ai-disclosure-icons

Conversation

@jobic10

@jobic10 jobic10 commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

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 recursive src/assets copy, 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.
  • Popup: the suggested label is derived from the same rounded percentages the breakdown bars display, so it can never contradict them (if the AI bar reads 0%, no label is shown). Hovering the row explains, in plain language, why that label was suggested.

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.js for precision. The extension popup (awareness) and the export (disclosure) can intentionally differ there.

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.
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.

1 participant