Skip to content

Dialog#2499

Merged
CLHatch merged 2 commits into
mainfrom
dialog
May 22, 2026
Merged

Dialog#2499
CLHatch merged 2 commits into
mainfrom
dialog

Conversation

@CLHatch

@CLHatch CLHatch commented May 22, 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

Refactor style and dialog string handling to support in-place resolution/stripping helpers and apply them across dialog- and gauge-related scripts for more consistent and reusable styling logic.

Enhancements:

  • Introduce helper variants of style resolution and stripping functions that write results into referenced variables instead of printing, improving reuse and composability.
  • Update dialog, gauge, theme, and color initialization code to use the new in-place style resolution and stripping helpers for consistent handling of styled strings.

@CLHatch CLHatch requested a review from a team as a code owner May 22, 2026 07:20
@github-actions github-actions Bot added the core Automatic label label May 22, 2026
@sourcery-ai

sourcery-ai Bot commented May 22, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Refactors style and string resolution utilities to support in-place variable assignment and avoid subshells, then updates dialog- and gauge-related scripts to use the new APIs for improved performance and correctness when handling styled strings.

File-Level Changes

Change Details Files
Introduce in-place style resolution helper and refactor resolve_styles/resolve_strings to reuse it and avoid subshell pipelines.
  • Split resolve_styles into a small wrapper that prints and a new resolve_styles_into function that assigns the resolved value into a nameref output variable.
  • Adjusted parameter positions in the style resolution logic to accommodate the new output parameter while preserving semantic/directional prefix/suffix handling.
  • Refactored resolve_strings to operate line-by-line using local helper logic instead of a pipeline with while-read, choosing between resolve_styles_into and strip_styles_into based on whether stdout is a terminal.
main.sh
Introduce in-place style stripping helper and update existing style stripping and dialog utilities to use it.
  • Split strip_styles into a wrapper that prints and a new strip_styles_into function that assigns stripped values via nameref while preserving extglob handling and multiline processing.
  • Updated color style initialization to use resolve_styles_into directly on the C associative array elements instead of subshell-based command substitution.
  • Refactored dialog- and gauge-related functions to use resolve_styles_into/strip_styles_into for options, backtitles, list-width calculations, and gauge text expansion, avoiding repeated calls through subshells and ensuring correct in-place updates.
main.sh
includes/dialog_functions.sh
scripts/menu_app_select.sh
scripts/config_theme.sh

Possibly linked issues

  • #[BUG]ds --help showing weird output: PR reworks resolve_styles/strip_styles and their use, directly addressing the macro placeholder output seen in ds --help.

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

@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 reviewed your changes and they look great!


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.

@CLHatch CLHatch merged commit da4b572 into main May 22, 2026
16 checks passed
@CLHatch CLHatch deleted the dialog branch May 22, 2026 07:23
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