<commit_before>module Gitlab
  module ChatCommands
    module Presenters
      class IssueNew < Presenters::Base
        include Presenters::Issuable

        def present
          in_channel_response(new_issue)
        end

        private

        def new_issue 
          {
            attachments: [
              {
                title:        "#{@resource.title} · #{@resource.to_reference}",
                title_link:   resource_url,
                author_name:  author.name,
                author_icon:  author.avatar_url,
                fallback:     "New issue #{@resource.to_reference}: #{@resource.title}",
                pretext:      pretext,
                color:        color(@resource),
                fields:       fields,
                mrkdwn_in: [
                  :title,
                  :pretext,
                  :text,
                  :fields
                ]
              }
            ]
          }
        end

        def pretext
          "I opened an issue on behalf on #{author_profile_link}: *#{@resource.to_reference}* from #{project.name_with_namespace}"
        end

        def project_link
          "[#{project.name_with_namespace}](#{url_for(project)})"
        end

        def author_profile_link
          "[#{author.to_reference}](#{url_for(author)})"
        end
      end
    end
  end
end
<commit_msg>Improve styling of the new issue message<commit_after>module Gitlab
  module ChatCommands
    module Presenters
      class IssueNew < Presenters::Base
        include Presenters::Issuable

        def present
          in_channel_response(new_issue)
        end

        private

        def new_issue 
          {
            attachments: [
              {
                title:        "#{@resource.title} · #{@resource.to_reference}",
                title_link:   resource_url,
                author_name:  author.name,
                author_icon:  author.avatar_url,
                fallback:     "New issue #{@resource.to_reference}: #{@resource.title}",
                pretext:      pretext,
                color:        color(@resource),
                fields:       fields,
                mrkdwn_in: [
                  :title,
                  :pretext,
                  :text,
                  :fields
                ]
              }
            ]
          }
        end

        def pretext
          "I created an issue on #{author_profile_link}'s behalf: **#{@resource.to_reference}** in #{project_link}"
        end

        def project_link
          "[#{project.name_with_namespace}](#{projects_url(project)})"
        end

        def author_profile_link
          "[#{author.to_reference}](#{url_for(author)})"
        end
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.08875954892688251, 'fraction_numerical': 0.0, 'mean_word_length': 1.301255230125523, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '668416', 'n_tokens_mistral': 747, 'n_tokens_neox': 704, 'n_words': 149}