Skip to content

fix: FIT-138: Text on ASR Hypotheses Selection template not visible Dark mode #7638

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

ricardoantoniocm
Copy link
Contributor

@ricardoantoniocm ricardoantoniocm commented May 28, 2025

Reason for change

The existing styling for ASR Hypotheses choices relied on individual inline styles, leading to Dark mode not being supported. This PR addresses this by centralizing the styling for .lsf-choice__item elements (ASR transcription choices) into a unified CSS block.

Specifically, custom CSS has been added within the <Style> block in docs/source/templates/asr_hypotheses.md and label_studio/annotation_templates/ranking-and-scoring/asr-hypotheses/config.yml. This new CSS defines consistent padding, box-shadow, background-color, border-radius, margin, line-height, and transition effects.

A hover style has also been added for improved user interaction feedback. All previously existing per-choice inline styles have been removed, ensuring that all transcription choices now uniformly adopt the styles defined in the centralized CSS block.

This change significantly improves maintainability, consistency, and the overall visual appearance of ASR Hypotheses choices in both documentation and configuration files.

Screenshots

Before:
Prod_-_Label_Studio
Prod_-_Label_Studio

After:
LSO_Local
LSO_Local
image

Testing

The following steps were performed to verify the fix:

  1. Precondition: Ensure Dark mode is turned ON.
  2. Navigate to Home page.
  3. Click on Create Project.
  4. Navigate to Labeling Setup, then navigate to Ranking & Scoring.
  5. Select the ASR Hypotheses Selection template.
  6. Observe that you can read the text associated with each checkbox.
  7. Close the modal, switch to Light mode, and execute steps 3-6.

Reviewer notes

Please pay close attention to the new CSS added within the <Style> block in both docs/source/templates/asr_hypotheses.md and label_studio/annotation_templates/ranking-and-scoring/asr-hypotheses/config.yml. Verify that all inline styles for individual transcription choices have been successfully removed. Confirm that the new centralized styling provides a consistent and visually appealing experience for ASR hypotheses without any regressions or unexpected side effects.

General notes

This change is a significant step towards improving the maintainability and visual consistency of our templates. By centralizing the styling, future modifications will be much simpler and less prone to inconsistencies.

Copy link

netlify bot commented May 28, 2025

Deploy Preview for heartex-docs canceled.

Name Link
🔨 Latest commit 1ef3527
🔍 Latest deploy log https://app.netlify.com/projects/heartex-docs/deploys/6837448a4948c6000891633e

Copy link

netlify bot commented May 28, 2025

Deploy Preview for label-studio-storybook canceled.

Name Link
🔨 Latest commit 1ef3527
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-storybook/deploys/6837448a5502880008569709

Copy link

netlify bot commented May 28, 2025

Deploy Preview for label-studio-playground canceled.

Name Link
🔨 Latest commit 1ef3527
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-playground/deploys/6837448ad6936e000882e93a

@github-actions github-actions bot added the fix label May 28, 2025
Copy link

netlify bot commented May 28, 2025

Deploy Preview for label-studio-docs-new-theme canceled.

Name Link
🔨 Latest commit 1ef3527
🔍 Latest deploy log https://app.netlify.com/projects/label-studio-docs-new-theme/deploys/6837448a071f44000850c4af

Copy link

codecov bot commented May 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.48%. Comparing base (926f637) to head (1ef3527).
Report is 3 commits behind head on develop.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #7638   +/-   ##
========================================
  Coverage    78.48%   78.48%           
========================================
  Files          197      197           
  Lines        16000    16000           
========================================
  Hits         12557    12557           
  Misses        3443     3443           
Flag Coverage Δ
pytests 78.48% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ricardoantoniocm ricardoantoniocm marked this pull request as ready for review May 28, 2025 15:29
@ricardoantoniocm ricardoantoniocm self-assigned this May 28, 2025
Copy link
Contributor

@Copilot 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 fixes an issue with the dark mode display of transcription text by removing conflicting inline styles from the ASR Hypotheses templates. Key changes include:

  • Removing explicit background-color and box-shadow CSS properties.
  • Leaving only minimal inline styling (padding-left: 5px;) so that Dark mode styles apply correctly.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
label_studio/annotation_templates/ranking-and-scoring/asr-hypotheses/config.yml Removed conflicting inline styles from transcription objects
docs/source/templates/asr_hypotheses.md Removed conflicting inline styles from transcription examples

…ed margin to prevent the box shadow from being cut off.
@ricardoantoniocm ricardoantoniocm requested a review from Copilot May 28, 2025 16:31
Copy link
Contributor

@Copilot 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

Centralize styling for ASR Hypotheses Selection to support Dark mode by adding a unified CSS block and removing per-choice inline styles.

  • Added a <Style> block defining .lsf-choice__item rules in config.yml
  • Added the same <Style> block in asr_hypotheses.md
  • Removed all inline style attributes from sample transcription data

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
label_studio/annotation_templates/ranking-and-scoring/asr-hypotheses/config.yml Added centralized CSS for choice items and removed inline styles
docs/source/templates/asr_hypotheses.md Added centralized CSS for choice items and removed inline styles

Copy link
Collaborator

@hlomzik hlomzik left a comment

Choose a reason for hiding this comment

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

Good template improvement!

@ricardoantoniocm ricardoantoniocm merged commit 93ccecb into develop May 28, 2025
54 checks passed
@robot-ci-heartex robot-ci-heartex deleted the fb-fit-138/text-asr-hypotheses-selection-template-not-visible-dark-mode branch May 28, 2025 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants