Skip to content

[LIVE-8419] Update SourceBadge colours and vertically centre text#277

Merged
adi-gnm merged 5 commits intomainfrom
ab/live/8419-source-badge-offset-colour-update
Oct 13, 2025
Merged

[LIVE-8419] Update SourceBadge colours and vertically centre text#277
adi-gnm merged 5 commits intomainfrom
ab/live/8419-source-badge-offset-colour-update

Conversation

@adi-gnm
Copy link
Member

@adi-gnm adi-gnm commented Oct 13, 2025

Description

Figma: https://www.figma.com/design/AzlT1ayOb0mv4peLWc6Ccu/My-Guardian-2.0?node-id=11801-41148&m=dev

Ticket: https://theguardian.atlassian.net/browse/LIVE-8419

Small tweaks to the SourceBadge component:

  1. Updated light and dark mode colours to match the designs linked above
  2. Changed the style names also to make them a bit more generic
    • note: the style names and even the component name will change more once Sasha finishes work on the components. Those changes will be covered a new PR.
  3. Fixed the height of components to 16 & 24 px (except when font scaling is enabled)
  4. Slightly offset the text vertically to center it in the badge

Testing notes/instructions:

@maheengill to integrate the preview release in her news app PR and confirm changes with Luke

Checklist

  • Changes have been checked by the developer
  • Changes have been checked by the reviewers
  • Unit tested

For pull requests introducing UI changes:

  • Sign-off by Design:
  • Dark Mode
  • Tablet
  • Accessibility (e.g. VoiceOver):
Screenshots or videos:
Before After
Light com gu source components badge_SourceBadgeTest_badge NOTNIGHT com gu source components badge_SourceBadgeTest_badge NOTNIGHT
Dark com gu source components badge_SourceBadgeTest_badge NIGHT com gu source components badge_SourceBadgeTest_badge NIGHT

@adi-gnm
Copy link
Member Author

adi-gnm commented Oct 13, 2025

@maheengill I've started a release workflow from this branch. When the preview release is available, could you test it with your PR?

The style names have changed so you'll need to update that in your PR.

@adi-gnm adi-gnm changed the title Ab/live/8419 source badge offset colour update [LIVE-8419] Update SourceBadge colours and vertically centre text Oct 13, 2025
gu-gradle-library-release bot added a commit that referenced this pull request Oct 13, 2025
…3T1043.71580d4d published by ab-gnm

ab-gnm published release version 5.0.0-PREVIEW.ablive8419-source-badge-offset-colour-update.2025-10-13T1043.71580d4d
using gha-gradle-library-release-workflow: https://github.com/guardian/gha-gradle-library-release-workflow

Release-Version: 5.0.0-PREVIEW.ablive8419-source-badge-offset-colour-update.2025-10-13T1043.71580d4d
Release-Initiated-By: https://github.com/ab-gnm
Release-Workflow-Run: https://github.com/guardian/source-apps/actions/runs/18463181414
Release-Notes: #277
@adi-gnm adi-gnm marked this pull request as ready for review October 13, 2025 10:51
@adi-gnm adi-gnm requested a review from a team as a code owner October 13, 2025 10:51
Copilot AI review requested due to automatic review settings October 13, 2025 10:51
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the SourceBadge component to align with new design specifications, including color updates, improved text positioning, and more generic style naming.

  • Updated badge colors for light and dark modes across all styles
  • Fixed badge heights to 16px and 24px with centered text positioning
  • Renamed style enums from color-specific names to semantic names (Gray→Info, LightBlue→Info, etc.)

Reviewed Changes

Copilot reviewed 3 out of 7 changed files in this pull request and generated 1 comment.

File Description
SourceBadge.kt Core component updates with new colors, heights, text centering, and renamed style enums
detekt-baseline-debug.xml Updated baseline to reflect renamed style enum properties
libs.versions.toml Dependency version updates for Compose BOM and Licensee

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

style = size.textStyle,
maxLines = maxLines,
overflow = textOverflow,
modifier = Modifier.offset(y = (-0.5).dp),
Copy link

Copilot AI Oct 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The hardcoded -0.5dp offset should be a named constant or calculated based on text metrics to ensure it works correctly across different font sizes and scaling factors.

Copilot uses AI. Check for mistakes.
@gu-gradle-library-release
Copy link
Contributor

@ab-gnm has published a preview version of this PR with release workflow run #226, based on commit 71580d4:

5.0.0-PREVIEW.ablive8419-source-badge-offset-colour-update.2025-10-13T1043.71580d4d

Want to make another preview release?

Click 'Run workflow' in the GitHub UI, specifying the ab/live/8419-source-badge-offset-colour-update branch, or use the GitHub CLI command:

gh workflow run release.yml --ref ab/live/8419-source-badge-offset-colour-update

Want to make a full release after this PR is merged?

Click 'Run workflow' in the GitHub UI, leaving the branch as the default, or use the GitHub CLI command:

gh workflow run release.yml

Copy link
Contributor

@maheengill maheengill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with my new badge pr and the badge is displayed correctly and appears centre aligned vertically. Also compared new colours with designs and they match the designs.

@adi-gnm adi-gnm added this pull request to the merge queue Oct 13, 2025
Merged via the queue into main with commit 29dd9a2 Oct 13, 2025
13 checks passed
@adi-gnm adi-gnm deleted the ab/live/8419-source-badge-offset-colour-update branch October 13, 2025 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance Departmental tracking: maintenance work, not a fix or a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants