refactor: streamline JoinConfiguration setup and improve component joining logic#86
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the setup of JoinConfiguration instances to simplify builder calls and improve the component joining logic.
- Streamlines JoinConfiguration builder calls to a single line for improved readability.
- Introduces conditional prefix logic to avoid unnecessary separators when joining collections and maps.
- Enhances formatting consistency in both list and map join methods.
Files not reviewed (1)
- gradle.properties: Language not supported
…surfapi/core/api/messages/CommonComponents.kt Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview of Changes
This refactor simplifies and enhances the setup of
JoinConfigurationinstances across methods used for rendering components, especially in collection-based join operations. It introduces clearer logic for prefix handling and improves code readability by reducing nested builder calls.Details
Version bump
versioningradle.propertiesfrom1.21.4-2.13.1-SNAPSHOTto1.21.4-2.13.2-SNAPSHOT.Refactor: Flattened JoinConfiguration building
.builder()calls with single-line versions for improved readability.separatorlogic into named variables (separator) before building the configuration.Enhancement: Added conditional prefix logic
Improved formatting functions
joinListandjoinMap..colorIfAbsent(...)for key/value component styling.Motivation
The changes aim to enhance code maintainability, consistency, and performance when constructing joined component messages. By reducing visual clutter and duplicative
.builder()usage, the refactor makes future changes and debugging easier.Impact
Testing
Additional Notes