Skip to content

Minor change in the ShortenString Function for consistency in multiple receivers#10264

Open
Ag-Derek wants to merge 1 commit intoIDEMSInternational:masterfrom
Ag-Derek:Multiple_Reciever_Changes
Open

Minor change in the ShortenString Function for consistency in multiple receivers#10264
Ag-Derek wants to merge 1 commit intoIDEMSInternational:masterfrom
Ag-Derek:Multiple_Reciever_Changes

Conversation

@Ag-Derek
Copy link
Collaborator

@Ag-Derek Ag-Derek commented Mar 11, 2026


Fixes #10259
This fixes the issue of the Receiver Headers not being consistent, I use the survey dataset and another dataset with a longer name to check for both cases.
@rdstern and @berylwaswa this is ready for review

Developer Testing Checklist

  • Runs without errors
  • OK disabled when dialog is incomplete or invalid
  • OK enabled only when required inputs are valid
  • Reset returns dialog to its default/sensible state
  • Invalid inputs are handled cleanly (e.g. negative, too-large, empty, impossible combos)
  • Running twice with different settings behaves consistently (e.g., open → run → close → reopen → change options checked → run again)
  • All AI/bot comments addressed (fixed, intentionally ignored with explanation, or queried)

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses an issue with inconsistent receiver headers by refining the string shortening mechanism within the ucrReceiverMultiple component. The changes standardize the length of truncated strings and ensure a consistent suffix, leading to a more uniform display across various datasets.

Highlights

  • ShortenString Function Logic: The ShortenString function in ucrReceiverMultiple.vb has been updated to reduce the maximum string length for truncation from 10 to 6 characters. Additionally, the function now consistently appends a colon to the end of the processed string, whether it was shortened or not, to ensure uniform receiver header formatting.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • instat/ucrReceiverMultiple.vb
    • Modified the ShortenString function to change the maxLength from 10 to 6.
    • Ensured that the ShortenString function always appends a colon to the returned string.
Activity
  • The pull request is marked as ready for review.
  • Developer testing checklist has been completed, confirming functionality, error handling, and consistency.
  • Reviewers @rdstern and @berylwaswa have been requested to review the changes.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request modifies the ShortenString function to change the max length and consistently append a colon. My review includes a suggestion to refactor this function for improved clarity and efficiency by using separate return paths, which also avoids reassigning the input parameter.

Comment on lines 200 to +205
If strText.Length > maxLength Then
' Trim the string to the specified length and add ellipsis
Return strText.Substring(0, maxLength) & "..."
strText = strText.Substring(0, maxLength) & "..."
End If
Return strText

Return strText & ":"
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This implementation can be made clearer and more efficient. By using an If/Else block with separate return paths, you can avoid reassigning the strText parameter and perform the string concatenation in a single step for each case. This improves readability and reduces string operations.

        If strText.Length > maxLength Then
            ' Trim the string to the specified length and add ellipsis
            Return strText.Substring(0, maxLength) & "...:"
        Else
            Return strText & ":"
        End If

@rdstern
Copy link
Collaborator

rdstern commented Mar 11, 2026

@Ag-Derek many thanks. It is better, but not quite right. I'll send you a dataset to try:

Here are some pictures from it:

image

This is what I wanted. Great - it is working nicely.

image

A short name for the data frame. Perfect!

image

Not so good for this name!

image

And this is a bit misleading.

I note the name, in the receiver, is not left justified? Would that help?

And maybe only 1 dot when the name is shortened?

Finally I made a name starting mmmmmm as that seems to take the most space!

image

Now it is nowhere near showing the number of columns!

@Ag-Derek
Copy link
Collaborator Author

Ag-Derek commented Mar 12, 2026

@rdstern i tried with you dataset i realised the problem is not from the code but rather its from the UI, the receiver space for the dataset header is limited to the extend that only a few characters can display correctly so when we have extra characters like ... and adding : along with the count of variables selected, this further reduces the limited space. when you have wide dataset name like mmmmmmm which is wider than iiiiiiiiii we get the problems you show above.
so we would have to manage the limited space which is available in the UI or do away with the additional characters like the semi colon.

@rdstern
Copy link
Collaborator

rdstern commented Mar 12, 2026

@Ag-Derek lets get rid of the extra characters! Also having the name mmmmmm is a bit extreme! So if it works for almost all data frame names, then that's also good enough for me. Knowing the number of variables in the receiver, is a convenience, not a necessity. Could you easily add the hover giving the full text - not the full name, but just always the number completely?

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.

Small change in multiple receiver to enable the number of variables to be shown consistently

2 participants