-
Couldn't load subscription status.
- Fork 3.1k
fix: FIT-137: Multiple labeling templates not yet adapted to dark mode #7584
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
fix: FIT-137: Multiple labeling templates not yet adapted to dark mode #7584
Conversation
…rsational AI templates).
…into fb-fit-137/text-area-in-content-moderation-template-not-optimized-for-dark-mode
…s for styles. Adapts Pairwise template to dark mode.
✅ Deploy Preview for label-studio-docs-new-theme ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for label-studio-storybook ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for heartex-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## develop #7584 +/- ##
========================================
Coverage 78.48% 78.48%
========================================
Files 197 197
Lines 16000 16000
========================================
Hits 12558 12558
Misses 3442 3442
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this 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 optimizes Dark Mode styling and improves maintainability across several Label Studio templates by replacing hardcoded CSS values with CSS variables and Tailwind CSS utility classes.
- Updated styling in SCSS and YAML configuration files to use theme-driven variables.
- Refactored the Pairwise component to support both inline style and className-based selection with improved error handling.
- Updated example annotation JSON to reflect changes in component naming conventions.
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| web/libs/editor/src/tags/object/Paragraphs/Paragraphs.module.scss | Updated border and text color to use CSS variables. |
| web/libs/editor/src/tags/control/Pairwise.js | Added checks for missing object references and refactored selection styling logic. |
| web/libs/editor/src/examples/pairwise/annotations/1.json | Changed the "to_name" field value to match updated component naming. |
| label_studio/annotation_templates/ranking-and-scoring/text-to-image/config.yml | Replaced hardcoded styles with semantic CSS variables. |
| label_studio/annotation_templates/natural-language-processing/content-moderation/config.yml | Updated the styling in the view components for Dark Mode optimization. |
| label_studio/annotation_templates/generative-ai/llm-ranker/config.yml | Updated ranking component styles using new CSS variable standards. |
| docs/source/templates/text_to_image.md | Demonstrated new style guidelines in documentation. |
| docs/source/templates/content_moderation.md | Updated documentation to align with the new styling conventions. |
Comments suppressed due to low confidence (1)
web/libs/editor/src/examples/pairwise/annotations/1.json:10
- Ensure that the updated 'to_name' value 'txt-2' correctly matches the expected identifier in the associated Pairwise component configuration. If the component still expects 'pw', this change may lead to mismatches in how annotations are linked.
"to_name": "txt-2",
…if self.annotation or self.annotation.names is not available.
label_studio/annotation_templates/generative-ai/llm-ranker/config.yml
Outdated
Show resolved
Hide resolved
…fig.yml Co-authored-by: Andrew <[email protected]>
✅ Deploy Preview for label-studio-playground ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
| let selection = {}; | ||
|
|
||
| // If selectionstyle is provided, use inline style for backward compatibility. | ||
| // Otherwise, use Tailwind semantic classes for selection via className. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's an interesting approach with tailwind and classnames override! I would simplify it a little: we don't need selection var at this level, just assign it directly in both branches to self._selection. But it's good anyway
|
/git merge
|
…on-template-not-optimized-for-dark-mode' Workflow run: https://github.com/HumanSignal/label-studio/actions/runs/15214529094
Reason for change
This PR addresses several UI and styling inconsistencies, particularly in Dark Mode, across various labeling templates. The primary goal is to modernize and unify the styling of Label Studio UI components and templates by replacing hardcoded CSS values with CSS variables and Tailwind CSS utility classes. This improves maintainability, enables better theme support, and resolves several reported issues where elements were barely visible or not optimized for Dark Mode.
Specifically, this PR resolves the following issues:
These changes also include:
box-shadow,border, andbackgroundproperties to use semantic, theme-driven variables.setResultlogic to support both inline style and TailwindclassName-based selection, added interactive classes, and improved error handling.Paragraphs.module.scssto use CSS variables for border and color properties.Screenshots
Before:
Pairwise Classification:

Author Names:

LLM Ranker:

Text to Image Generation:

After:
Pairwise Classification:

Author Names:

LLM Ranker:

Text to Image Generation:

Rollout strategy
This change will be rolled out as part of a standard release. No feature flags or environment variables are required.
Testing
The following testing has been performed:
setResultlogic.Detailed steps to reproduce and verify fixes for each ticket are available in the linked Jira issues. Screenshots will be added to confirm the fixes for each template.
Risks
Reviewer notes
General notes
This PR represents a significant step towards a more unified and maintainable UI styling system. The adoption of CSS variables and Tailwind CSS will make future theme adjustments and UI enhancements much more efficient.