Skip to content

fix(web): make the space hero edit control legible on any cover (#946) - #969

Merged
Deeds67 merged 1 commit into
mainfrom
fix/946-space-hero-edit-icon-contrast
Aug 13, 2026
Merged

fix(web): make the space hero edit control legible on any cover (#946)#969
Deeds67 merged 1 commit into
mainfrom
fix/946-space-hero-edit-icon-contrast

Conversation

@Deeds67

@Deeds67 Deeds67 commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Fixes #946.

The ✎ was invisible on a dark cover

space-hero.svelte rendered the edit menu with ButtonContextMenu's default ghost variant. Ghost paints the icon with the theme's ink on a transparent background — @immich/ui resolves ghost + secondary to text-dark, which is near-black in the light theme.

The hero cover is a photo, not a themed surface, so a theme-tinted control is a coin toss against it. On the reporter's dark green cover the pencil all but vanished. (Dark theme has the mirror-image problem: a near-white icon that would disappear on a bright cover.)

Rather than nudge the opacity, this switches the control to variant="filled" + buttonClass="icon-white-drop-shadow" — the same recipe every other over-image context menu in the app already uses (space-album-card.svelte, both people pages). A filled chip carries its own background, so it contrasts with itself whatever the photo underneath happens to be, in both themes and on any cover.

Verified by rendering the top-right chrome through the app's real compiled Tailwind + @immich/ui theme over the cover from the issue:

before (ghost) after (filled)
light theme near-black ✎, no background — lost in the foliage dark chip, white ✎
dark theme near-white ✎, no background — would vanish on a bright cover light chip, dark ✎

The role badge was untranslated

Reported in the same issue. The badge printed the raw lowercase SharedSpaceRole enum (owner), dressed up with CSS capitalize — which is why it read Owner in every locale.

It now goes through the owner / role_editor / role_viewer keys, which already exist and are already translated in all nine maintained locales, so no i18n changes were needed. role-badge.svelte had the same mapping inline, so both now share a spaceRoleLabelKey helper. Its return type is the literal key union rather than string, so $t() still type-checks the keys against en.json.

Tests

TDD — all seven tests were watched failing first, including the text-dark assertion that pins the reported bug:

  • spaceRoleLabelKey unit tests (three roles + unknown-role fallback to the least-privileged label)
  • hero role badge renders role_editor / role_viewer rather than the raw enum. $t echoes keys back under test, so a badge reading role_editor is the proof it went through i18n at all. Deliberately not asserted for owner: the key and the raw enum value are both owner, so that test could not fail.
  • hero edit control carries a background and is not painted text-dark

The e2e assertions on hero-role-badge (permission-matrix, spaces-albums-journey, spaces-p1) already matched case-insensitively and stay green — English renders Owner / Editor / Viewer. Their comments claiming a raw enum are updated.

Green: web unit suite 4347 passed, check:typescript, check:svelte, lint, prettier (web + e2e).

Noted, not changed

The role badge itself is bg-white/20 text-white, which has the same weakness on a bright cover. It is not what was reported and darkening it is a design change rather than a bugfix, so it is left for a follow-up.

The ✎ menu on the space hero used ButtonContextMenu's default `ghost`
variant, which paints the icon with the *theme's* ink on a transparent
background — `text-dark`, i.e. near-black, in the light theme. The hero
cover is a photo rather than a themed surface, so that is a coin toss:
against a dark cover the icon all but disappeared.

Switch it to the `filled` variant with `icon-white-drop-shadow`, the
same recipe every other over-image context menu in the app already uses
(space album cards, the people pages). A filled chip carries its own
background, so it contrasts with itself whatever the photo underneath
happens to be, in both themes.

Also reported on the same badge row: the role read `Owner` in every
locale. It was printing the raw lowercase `SharedSpaceRole` enum dressed
up with CSS `capitalize`. Route it through the `owner` / `role_editor` /
`role_viewer` keys that already exist in all nine maintained locales,
via a `spaceRoleLabelKey` helper shared with `role-badge.svelte` — which
had the same mapping inline.
@Deeds67 Deeds67 added the changelog:fix Bug fix for changelog label Aug 10, 2026
@Deeds67
Deeds67 merged commit e496492 into main Aug 13, 2026
56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog:fix Bug fix for changelog 🖥️web

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Edit icon in space header hard to see on dark background

1 participant