Skip to content

Apply config after setting display engine#2510

Merged
CLHatch merged 1 commit into
mainfrom
whiptail
May 31, 2026
Merged

Apply config after setting display engine#2510
CLHatch merged 1 commit into
mainfrom
whiptail

Conversation

@CLHatch

@CLHatch CLHatch commented May 31, 2026

Copy link
Copy Markdown
Contributor

Pull request

Purpose
Describe the problem or feature in addition to a link to the issues.

Approach
How does this change address the problem?

Open Questions and Pre-Merge TODOs
Check all boxes as they are completed

  • Use github checklists. When solved, check the box and explain the answer.

Learning
Describe the research stage
Links to blog posts, patterns, libraries or addons used to solve this problem

Requirements
Check all boxes as they are completed

Summary by Sourcery

Enhancements:

  • Trigger theme configuration automatically after updating the UI display engine setting.

@CLHatch CLHatch requested a review from a team as a code owner May 31, 2026 17:16
@sourcery-ai

sourcery-ai Bot commented May 31, 2026

Copy link
Copy Markdown
Contributor
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Ensures that whenever the display engine is set via config_display_engine, the configuration theme is also applied immediately to keep UI settings consistent.

Sequence diagram for applying config_theme after setting display engine

sequenceDiagram
    participant Caller
    participant config_display_engine
    participant run_script

    Caller->>config_display_engine: config_display_engine
    config_display_engine->>run_script: config_set ui.display_engine DisplayEngine
    config_display_engine->>run_script: config_theme
    config_display_engine-->>Caller: return 0
Loading

File-Level Changes

Change Details Files
Apply UI theme configuration immediately after setting a valid display engine.
  • Invoke the config_theme script right after persisting the selected display engine via config_set for dialog/whiptail engines.
  • Keep existing notice messaging and control flow unchanged aside from the added theme application step.
scripts/config_display_engine.sh

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@github-actions github-actions Bot added the core Automatic label label May 31, 2026
@CLHatch CLHatch merged commit 2615faf into main May 31, 2026
15 checks passed
@CLHatch CLHatch deleted the whiptail branch May 31, 2026 17:16

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've found 1 issue, and left some high level feedback:

  • Consider documenting in a code comment why config_theme must be called immediately after setting ui.display_engine, so future changes don’t break this ordering dependency.
  • If config_theme can fail, you may want to handle or log its failure explicitly here so it’s clear whether the display engine was successfully changed but theme configuration was not.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider documenting in a code comment why `config_theme` must be called immediately after setting `ui.display_engine`, so future changes don’t break this ordering dependency.
- If `config_theme` can fail, you may want to handle or log its failure explicitly here so it’s clear whether the display engine was successfully changed but theme configuration was not.

## Individual Comments

### Comment 1
<location path="scripts/config_display_engine.sh" line_range="15" />
<code_context>
 	case "${DisplayEngine}" in
 		dialog | whiptail)
 			run_script 'config_set' ui.display_engine "${DisplayEngine}"
+			run_script 'config_theme'
 			notice "Display engine set to '{{|UserCommand|}}${DisplayEngine}{{[-]}}'."
 			return 0
</code_context>
<issue_to_address>
**issue (bug_risk):** Consider handling failures from `config_theme` to avoid leaving the configuration in a partially applied state.

If `run_script 'config_theme'` fails, we still log success and return 0. If this step is required for a usable display engine, please check its exit status and either propagate the error (e.g., `run_script ... || return $?`) or emit a clear warning so callers can distinguish full success from partial configuration.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

case "${DisplayEngine}" in
dialog | whiptail)
run_script 'config_set' ui.display_engine "${DisplayEngine}"
run_script 'config_theme'

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

issue (bug_risk): Consider handling failures from config_theme to avoid leaving the configuration in a partially applied state.

If run_script 'config_theme' fails, we still log success and return 0. If this step is required for a usable display engine, please check its exit status and either propagate the error (e.g., run_script ... || return $?) or emit a clear warning so callers can distinguish full success from partial configuration.

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

Labels

core Automatic label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant