Skip to content

fix: support multiline text in --field for textarea custom fields#42

Merged
Hinne1 merged 2 commits intomainfrom
claude/fix-field-multiline-newlines
Mar 24, 2026
Merged

fix: support multiline text in --field for textarea custom fields#42
Hinne1 merged 2 commits intomainfrom
claude/fix-field-multiline-newlines

Conversation

@Hinne1
Copy link
Copy Markdown
Contributor

@Hinne1 Hinne1 commented Mar 24, 2026

Summary

  • The --field flag truncated textarea values at the first newline because literal \n from shell double-quotes was passed through as two characters
  • TextToADF expects actual newlines to split into paragraphs
  • Fix: unescape literal \n sequences before passing to TextToADF

Before

atl issue edit NX-15361 --field "Kontext=Line 1\n\nLine 2"
# Result: only "Line 1" stored, rest truncated

After

atl issue edit NX-15361 --field "Kontext=Line 1\n\nLine 2"
# Result: two paragraphs stored correctly

Also enables +++ expand sections from --field:

atl issue edit NX-15361 --field "Kontext=+++Expand title\nContent here\n+++"

One-liner change in internal/cmd/issue/field_util.go.

The --field flag truncated textarea values at the first newline because
literal \n from shell double-quotes was passed through as two characters.
TextToADF expects actual newlines to split paragraphs.

Unescape literal \n sequences before passing to TextToADF, so
`--field "Kontext=line1\n\nline2"` produces two paragraphs instead of one.
@gemini-code-assist
Copy link
Copy Markdown

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 resolves an issue where multiline text provided through the --field flag for textarea custom fields was truncated. Previously, literal \n characters from shell double-quotes were not correctly interpreted as newlines, leading to data loss. The change introduces a mechanism to unescape these \n sequences, ensuring that multiline content and special formatting like expand sections are properly processed and stored.

Highlights

  • Multiline Text Support: Enabled multiline text input for textarea custom fields when using the --field flag by correctly interpreting \n sequences as newlines.
  • Expand Sections: Allowed the use of +++ syntax within --field values to create expandable sections in textarea custom fields.
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.

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.

@Hinne1 Hinne1 marked this pull request as ready for review March 24, 2026 03:53
Copy link
Copy Markdown

@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 adds support for multiline text from the --field flag by unescaping \n sequences. While this is a useful feature, the current implementation using strings.ReplaceAll is a bit too aggressive and can lead to unintended data modification. For example, a Windows path like C:\Users\normal or any text containing a literal \n would be incorrectly altered. I've added a comment with a suggestion for a more robust implementation that handles escaped backslashes, allowing users to intentionally write newlines (\n) and literal backslashes (\\).

Support \\ for literal backslashes so that content like Windows paths
(C:\Users\normal) or code snippets (printf("hello\n")) can be
represented correctly by escaping: C:\\Users\\normal, printf("hello\\n").

Uses placeholder-based replacement chain to avoid double-processing.
@github-actions
Copy link
Copy Markdown

Merging this branch will decrease overall coverage

Impacted Packages Coverage Δ 🤖
github.com/enthus-appdev/atl-cli/internal/cmd/issue 6.77% (-0.01%) 👎

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/enthus-appdev/atl-cli/internal/cmd/issue/field_util.go 0.00% (ø) 43 (+1) 0 43 (+1)

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

@Hinne1 Hinne1 merged commit efe3a95 into main Mar 24, 2026
11 checks passed
@Hinne1 Hinne1 deleted the claude/fix-field-multiline-newlines branch March 24, 2026 04:38
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.

1 participant