feat(catalog): colour-code data-sensitivity pill - #206
Merged
Conversation
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>
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.
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 atlines 44–65 now maps
assistant.dataSensitivity.valueto abg-*-surface border-*-line text-*-inkclass triple sourcedfrom the alert palette. Layout classes
(
inline-flex items-center rounded-full px-3 py-1 text-sm)and the border are preserved.
The
titletooltip(
assistant.dataSensitivity.description) and label copy areuntouched — 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 renderas the muted italic "Ikke klassificeret" chip.
Checklist
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 atlines 44–65. Sidebar sensitivity row is intentionally
unchanged.
Non-goals
App\Enum\DataSensitivityare the whole set.templates/components/Catalog/AssistantCard.html.twigdoesn't currently render a sensitivity chip; adding one is out
of scope.
colour only.
assets/styles/app.css— the palette isalready in place from feat(components): per-type colour treatment for Alert (Info / Success / Warning / Danger) #196.
Decisions
rather than adding it to
App\Enum\DataSensitivity. Colourclasses 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
@themeblock in
assets/styles/app.css. Also matches the pattern intemplates/components/Alert.html.twigwhich inlines its owntype→ class triple map.the preferred path so the visual weight lives on the hero
pill; the sidebar's tabular treatment reads better without
competing chip colours.
"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.DataSensitivity value plus one unclassified assistant.
hit AA against their own soft surface. Confirmed on:
#065f46on surface#ecfdf5≈ 8:1#92400eon surface#fffbeb≈ 6.7:1#991b1bon surface#fef2f2≈ 8.5:1Links
merged into
develop, so nodo-not-mergelabel needed).