[Dream-76] Primerise Interface tab of Admin/Design page - #24854
[Dream-76] Primerise Interface tab of Admin/Design page#24854bsatarnejad wants to merge 12 commits into
Conversation
|
Warning Flaky specs
🤖 Ask Copilot to investigateCopy the prompt below into a new comment on this PR to delegate the investigation to GitHub Copilot. It will look into the flakiness and open a separate pull request with you as reviewer. |
|
Warning Flaky specs
🤖 Ask Copilot to investigateCopy the prompt below into a new comment on this PR to delegate the investigation to GitHub Copilot. It will look into the flakiness and open a separate pull request with you as reviewer. |
|
Caution The Enterprise plan field is not set on the work package Details:
Please make sure that:
|
There was a problem hiding this comment.
Pull request overview
This PR primerizes the Interface tab under Admin → Design, replacing the legacy form-based UI with Primer components (grouped color sections and per-color edit dialogs) and introducing an auto-submitting theme selector consistent across relevant tabs.
Changes:
- Reworks the Interface tab UI into Primer headings + grouped
BorderBoxsections, with per-color edit dialogs. - Switches the theme selector to an auto-submit
Primer::Alpha::Selectand updates feature specs accordingly. - Adds translations and helper logic to support grouped colors and inherited/theme-based effective values.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| spec/features/custom_styles/tabs_navigation_spec.rb | Updates feature coverage for the new Primer UI, including dialog-based editing and auto-submit theme selection. |
| spec/controllers/custom_styles_controller_spec.rb | Adds controller-level coverage for updating themes while preserving the selected tab. |
| config/locales/en.yml | Adds labels/captions for color groups and per-color editing text. |
| app/views/custom_styles/show.html.erb | Replaces the old theme selector UI with a Primer Select wired to an auto-submit Stimulus controller. |
| app/views/custom_styles/_interface.html.erb | Primerizes the Interface tab layout and replaces the bulk form with per-color edit dialogs. |
| app/helpers/custom_styles_helper.rb | Introduces grouping and “effective color” helper logic to support the new UI rendering. |
Suppressed comments (1)
spec/features/custom_styles/tabs_navigation_spec.rb:98
- This example relies on opening and submitting a Primer dialog. In non-JS feature specs the dialog open/close behavior is not executed, which can make the test fail or become flaky. Add
:jsso the test runs with a JS driver.
it "restores the inherited color by clearing an override" do
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
HDinger
left a comment
There was a problem hiding this comment.
The UI looks good to me 👍 I think there are some code improvements that need to be done before merging though
| <%= render( | ||
| Primer::Beta::Heading.new( | ||
| tag: :h2, | ||
| font_size: 3, | ||
| font_weight: :normal, | ||
| mt: 4, | ||
| mb: 2, | ||
| pb: 2, | ||
| border: :bottom | ||
| ) | ||
| ) do %> | ||
| <%= t(:label_interface_colors) %> | ||
| <% end %> | ||
|
|
||
| <%= render(Primer::Beta::Text.new(tag: :p, mb: 3)) do %> | ||
| <%= t(:label_interface_colors_description) %> | ||
| <% end %> |
There was a problem hiding this comment.
I'd like to challenge the design here, and recommend to use a Primer::Beta::Subhead instead. It would give us a description slot which is how we usually display these additional texts. I am aware, that the designs show it differently but I would be willing to disucss that.
| <% variable = design_color.variable %> | ||
| <% label = t("admin.custom_styles.colors.#{variable}") %> | ||
| <% instruction = t("admin.custom_styles.instructions.#{variable}", default: "") %> | ||
| <% hexcode = effective_design_color(design_color, current_theme: @current_theme) %> | ||
| <% form_id = "design-color-#{variable}-form" %> |
There was a problem hiding this comment.
It reads weird to me to have these things as variables. Given that this is an HTML file, I'd expect the things to be written inline directly. Is there a reason to extract them?
There was a problem hiding this comment.
They’re reused for each row: the translations, color, and form ID each appear multiple times. Keeping them avoids repeated lookups and ensures dialog form IDs remain consistent.
| <%= form_tag( | ||
| update_design_themes_path, | ||
| method: :post, | ||
| data: { | ||
| controller: "auto-submit", | ||
| turbo_confirm: (t("admin.custom_styles.theme_warning") if @current_theme.blank?) | ||
| } | ||
| ) do %> | ||
| <%= render( | ||
| Primer::Alpha::Select.new( | ||
| name: "theme", | ||
| label: t("admin.custom_styles.color_theme"), | ||
| caption: t("admin.custom_styles.color_theme_caption"), | ||
| input_width: :large, | ||
| data: { | ||
| action: "auto-submit#submit", | ||
| test_selector: "color-theme-select" | ||
| } | ||
| ) | ||
| ) do |select| %> | ||
| <% @theme_options.each do |option| %> | ||
| <% label, value, attributes = option.is_a?(Array) ? option : [option, option, {}] %> | ||
| <% select.option( | ||
| label:, | ||
| value:, | ||
| selected: attributes&.fetch(:selected, value == @current_theme), | ||
| disabled: attributes&.fetch(:disabled, false) | ||
| ) %> | ||
| <% end %> | ||
| <% end %> |
There was a problem hiding this comment.
Since this will be reused on the other tabs, I guess it makes sense to extract it into a component
There was a problem hiding this comment.
Good point. I can extract it to a component to make the view easier to read. But it will be used only once in show.html.erb, because this view is shared by both Interface and Branding tabs.
20f3c32 to
9d31abb
Compare
|
Warning Flaky specs
🤖 Ask Copilot to investigateCopy the prompt below into a new comment on this PR to delegate the investigation to GitHub Copilot. It will look into the flakiness and open a separate pull request with you as reviewer. |
|
Warning Flaky specs
🤖 Ask Copilot to investigateCopy the prompt below into a new comment on this PR to delegate the investigation to GitHub Copilot. It will look into the flakiness and open a separate pull request with you as reviewer. |
|
Warning Flaky specs
🤖 Ask Copilot to investigateCopy the prompt below into a new comment on this PR to delegate the investigation to GitHub Copilot. It will look into the flakiness and open a separate pull request with you as reviewer. |

Ticket
https://community.openproject.org/wp/DREAM-76
What are you trying to accomplish?
Primerise interface tab in admin->design(interface)
Screenshots