Skip to content

Move color service to core/ui#3716

Open
UrbanBobek wants to merge 3 commits intoControlSystemStudio:masterfrom
UrbanBobek:refactor-colors
Open

Move color service to core/ui#3716
UrbanBobek wants to merge 3 commits intoControlSystemStudio:masterfrom
UrbanBobek:refactor-colors

Conversation

@UrbanBobek
Copy link
Contributor

PR for this task of the Codeathon 2026

First step is to migrate the color service to core/ui so all applications can use the colors and not just the display builder.

Later, the inconsistent implementation of how colors are used across the codebase should be addressed.

Checklist

  • Testing:

    • The feature has automated tests
    • Tests were run
    • If not, explain how you tested your changes
  • Documentation:

    • The feature is documented
    • The documentation is up to date
    • Release notes:
      • Added an entry if the change is breaking or significant
      • Added an entry when adding a new feature

Adds WidgetColor, NamedWidgetColor, NamedWidgetColors, WidgetColorService,
ConfigFileParser and FileToStreamFunction to core/ui so they can be used
by any application, not just the display builder.

WidgetColorService is adapted from app/display/model: the shared
ModelPlugin.logger is replaced with a per-class logger following
the convention used across core/ui, ModelThreadPool is replaced
with CompletableFuture.supplyAsync(), and the display-model-specific
read timeout preference is replaced with a 5000ms constant.

ColorUnitTest and DelayedStream moved here from app/display/model,
along with the color.def example file used by the tests.
WidgetColor, NamedWidgetColor, NamedWidgetColors, WidgetColorService,
ConfigFileParser and FileToStreamFunction have been removed from
app/display/model and all import references across app/display updated
to use the new org.phoebus.ui.color package.

NamedWidgetFonts, WidgetFontService and WidgetClassesService updated
to directly reference org.phoebus.ui.color.ConfigFileParser and
FileToStreamFunction. ColorUnitTest moved to core/ui.
@shroffk
Copy link
Member

shroffk commented Feb 27, 2026

Thank you,
This is a good first step towards our goal of having a core color service which helps consistency across Phoebus applications

In this PR we might want to double check the usage to the
ConfigFileParser.java
and
FileToStreamFunction.java

to evaluate if it justifies being moved to a core/util module instead of the core/color one.

@UrbanBobek UrbanBobek changed the title Remove Hardcoded Colors for Consistency Move color service to core/ui Feb 27, 2026
…nfig

These utilities are not color-specific — they are used by color, font,
and widget class loading.
All import references in core/ui and app/display/model updated accordingly.
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants