-
Notifications
You must be signed in to change notification settings - Fork 2.8k
fix: FIT-137: Text area in content moderation template not optimized for 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
base: develop
Are you sure you want to change the base?
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 canceled.
|
✅ 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 canceled.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
|
Flag | Coverage Δ | |
---|---|---|
pytests | 77.82% <ø> (+0.05%) |
⬆️ |
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.
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.
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
, andbackground
properties to use semantic, theme-driven variables.setResult
logic to support both inline style and TailwindclassName
-based selection, added interactive classes, and improved error handling.Paragraphs.module.scss
to 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:
setResult
logic.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.