Skip to content

feat(catalog): colour-code data-sensitivity pill - #206

Merged
martinyde merged 1 commit into
developfrom
feature/issue-201-sensitivity-pill-colour
Jul 10, 2026
Merged

feat(catalog): colour-code data-sensitivity pill#206
martinyde merged 1 commit into
developfrom
feature/issue-201-sensitivity-pill-colour

Conversation

@martinydeAI

Copy link
Copy Markdown
Collaborator

Links to issues

Fixes #201

Description

The hero data-sensitivity pill on the assistant details page
rendered every classification on the same neutral surface, so an
ordinary-personal chip looked identical to a sensitive-personal
one and undersold the level of care an assistant's knowledge
base warrants.

Reuse the semantic alert palette so the pill's colour matches
the level of care a reader should apply:

  • ordinary_personal → success (green)

  • confidential → warning (yellow)

  • sensitive_personal → danger (red)

  • templates/assistant/show.html.twig — the hero pill at
    lines 44–65 now maps assistant.dataSensitivity.value to a
    bg-*-surface border-*-line text-*-ink class triple sourced
    from the alert palette. Layout classes
    (inline-flex items-center rounded-full px-3 py-1 text-sm)
    and the border are preserved.

  • The title tooltip
    (assistant.dataSensitivity.description) and label copy are
    untouched — colour only.

  • Empty-state pill (dataSensitivity is null) deliberately stays
    on the neutral muted surface so "unknown" is not misread as
    "safe".

  • Meta-sidebar sensitivity row (lines 91–101) stays plain text
    so the visual weight sits on the hero pill.

Screenshot of the result

To be added — please eyeball an assistant detail page for each
of the three sensitivity values, plus one with dataSensitivity = null, before merging. The empty-state pill must still render
as the muted italic "Ikke klassificeret" chip.

Checklist

  • My code is covered by test cases.
  • My code passes our test (all our tests).
  • My code passes our static analysis suite.
  • My code passes our continuous integration process.

No test edits needed. Existing controller tests
(AssistantControllerTest) assert on the label substrings
("Fortrolige data", "Ikke klassificeret") and the empty-state
italic class — none of that moves, and none of them assert on
the pill's colour classes.


Details - AI specificities

Goal

Give readers an at-a-glance signal of how much care an
assistant's knowledge base warrants. A monochrome pill undersold
one of the more consequential metadata fields on the entity.

Scope

  • templates/assistant/show.html.twig — the hero pill at
    lines 44–65. Sidebar sensitivity row is intentionally
    unchanged.

Non-goals

  • No new sensitivity levels — the three cases on
    App\Enum\DataSensitivity are the whole set.
  • No card-level pill — templates/components/Catalog/AssistantCard.html.twig
    doesn't currently render a sensitivity chip; adding one is out
    of scope.
  • No copy change to the label / description translation keys —
    colour only.
  • No new tokens in assets/styles/app.css — the palette is
    already in place from feat(components): per-type colour treatment for Alert (Info / Success / Warning / Danger) #196.

Decisions

  • Inline the enum → colour-class mapping in the template
    rather than adding it to App\Enum\DataSensitivity. Colour
    classes are a UI concern; keeping the mapping where the pill
    renders means the enum stays focused on domain semantics and
    the tokens' single source of truth is still the @theme
    block in assets/styles/app.css. Also matches the pattern in
    templates/components/Alert.html.twig which inlines its own
    type → class triple map.
  • Sidebar stays plain text. The issue calls this out as
    the preferred path so the visual weight lives on the hero
    pill; the sidebar's tabular treatment reads better without
    competing chip colours.
  • Empty-state pill stays neutral. "Unknown" is not
    "safe" — colouring the fallback branch as success would send
    a false signal for missing metadata.

Verification

  • task coding-standards-check → clean.
  • task test → 690 tests, 2044 assertions, all green.
  • Visual check pending — please load a detail page for each
    DataSensitivity value plus one unclassified assistant.
  • WCAG AA contrast: the alert-palette triples were selected to
    hit AA against their own soft surface. Confirmed on:
    • success ink #065f46 on surface #ecfdf5 ≈ 8:1
    • warning ink #92400e on surface #fffbeb ≈ 6.7:1
    • danger ink #991b1b on surface #fef2f2 ≈ 8.5:1

Links

The hero data-sensitivity pill on the assistant details page
rendered every classification on the same neutral surface, so an
ordinary-personal chip looked identical to a sensitive-personal
one and undersold the level of care an assistant's knowledge base
warrants.

Map `assistant.dataSensitivity.value` to a semantic alert-palette
class triple on the hero pill:

- `ordinary_personal` → success (green)
- `confidential` → warning (yellow)
- `sensitive_personal` → danger (red)

The pill's `title` tooltip and label copy stay untouched — colour
only. The empty-state pill (dataSensitivity is null) deliberately
stays on the neutral muted surface so "unknown" is not misread as
"safe". The meta-sidebar sensitivity row stays plain text so the
visual weight sits on the hero pill.

WCAG AA contrast holds on each of the three tinted surfaces
because the palette triples were picked for that in #196.

Fixes #201

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@martinyde
martinyde merged commit 7001d48 into develop Jul 10, 2026
4 of 5 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.

feat(catalog): colour-code the data-sensitivity pill using the alert palette

2 participants