Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-22002

Confluence renders attachments with long filenames with an ellipsis rather than a presenting the information to the browser and using css to limit the fieldwidth

      Changed from new feature to bug- Original text of description:

      We would like the ability to set attachment macro's column width. Currently "name" column is too short. It doesn't display medium-sized file names very well.
      It will be very helpful to provide a way to limit the "comment" column' width too.

      This presents a usability problem with larger filenames. We probably shorted filenames in this way in the past because of the absence of browser support for the css3 property: text-overflow.

      Most modern browsers now support this property.

      Fix

      There are 2 modules affected by this bug. The attachments macro and the view attachments page (Tools > Attachments).

      To fix the attachments macro, download the version 3.6.7 or newer from the Atlassian Marketplace.

      For most users, that fix should be sufficient and you can stop here. If, however, you also need to fix the view attachments page, you'll have to edit confluence/includes/css/attachments.css and add the following CSS code:

      #viewAttachmentsDiv table.attachments {
          border-bottom: 1px solid #ccc;
          table-layout: fixed;
      }
      
      table.attachments .filename-column {
          overflow: hidden;
          text-overflow: ellipsis;
          white-space: nowrap;
      }
      
      @media screen and (min-width: 1600px) {
          table.attachments th.filesize-column {
              width: 80px;
          }
      
          table.attachments th.filedate-column {
              width: 180px;
          }
      
          table.attachments th.filecreator-column {
              width: 180px;
          }
      
          table.attachments th.comment,
          table.attachments th.labels {
              width: 200px;
          }
      
          table.attachments th.actions-column {
              width: 180px;
          }
      }
      

      You will need to delete confluence/includes/css/attachments-min.css for these changes to take effect.

      Then edit confluence/pages/includes/attachments-table.vm and change:

      <th>#sortLink("size", "${sortPathPrefixHtml}size" $action.getText('file.size'))</th>
      <th>$action.getText('creator.name')</th>
      <th>#sortLink("createddate" "${sortPathPrefixHtml}createddate" $action.getText('columnheading.creation.date'))</th>
      

      to this:

      <th class="filesize-column">#sortLink("size", "${sortPathPrefixHtml}size" $action.getText('file.size'))</th>
      <th class="filecreator-column">$action.getText('creator.name')</th>
      <th class="filedate-column">#sortLink("createddate" "${sortPathPrefixHtml}createddate" $action.getText('columnheading.creation.date'))</th>
      

      and this:

      #if ($showActions == "true")
          <th> </th>
      #end
      

      to this:

       #if ($showActions == "true")
          <th class="actions-column">&nbsp;</th>
      #end
      

      Finally (and most importantly), change this:

      $generalUtil.htmlEncode($generalUtil.shortenString($attachment.fileName, 35))
      

      to this:

      $generalUtil.htmlEncode($attachment.fileName)
      

        1. labels are hidden.png
          labels are hidden.png
          48 kB
        2. NotResolved.jpg
          NotResolved.jpg
          116 kB
        3. Partially_Solved.jpg
          Partially_Solved.jpg
          202 kB
        4. Partially_Solved.jpg
          Partially_Solved.jpg
          210 kB
        5. Unable to read documents....jpg
          Unable to read documents....jpg
          55 kB

            [CONFSERVER-22002] Confluence renders attachments with long filenames with an ellipsis rather than a presenting the information to the browser and using css to limit the fieldwidth

            Chad Barnes added a comment - - edited

            Name column is still very small in Confluence 5.7.3 when using Chrome. It looks fine (is wide enough for the file names) in Firefox.

            Chad Barnes added a comment - - edited Name column is still very small in Confluence 5.7.3 when using Chrome. It looks fine (is wide enough for the file names) in Firefox.

            Not fixed in 5.5.1

            David Skreiner added a comment - Not fixed in 5.5.1

            Don't worry Ethan, we are!!!

            Normand Carbonneau added a comment - Don't worry Ethan, we are!!!

            @Peter Kozcan - Thanks for the beautiful fix! Running your own server can be a pain sometimes but this is the upside. Of course if I was using OnDemand I'd be pretty pissed at lack of movement on something so simple...

            Ethan Foulkes added a comment - @Peter Kozcan - Thanks for the beautiful fix! Running your own server can be a pain sometimes but this is the upside. Of course if I was using OnDemand I'd be pretty pissed at lack of movement on something so simple...

            This bug is still present in OnDemand version 5.4-OD-5. Either it has come back or was never fixed. The file names are still hidden. White space is still not being contracted. Yes, it looks pretty but it is highly unusable.
            As a bonus the viewpageattachments.action now has an additional bug: the sidebar now shows on the attachments page which is seriously annoying. Something screwed up there in the theme for OnDemand.

            OutOfTheBox added a comment - This bug is still present in OnDemand version 5.4-OD-5. Either it has come back or was never fixed. The file names are still hidden. White space is still not being contracted. Yes, it looks pretty but it is highly unusable. As a bonus the viewpageattachments.action now has an additional bug: the sidebar now shows on the attachments page which is seriously annoying. Something screwed up there in the theme for OnDemand.

            Note: the bug with the truncated filenames seems to have come back in 5.4.2 (CONF-32209).

            Scott Dudley [Inactive] added a comment - Note: the bug with the truncated filenames seems to have come back in 5.4.2 ( CONF-32209 ).

            This plugin took care of your problem handling space within the attachment macro:

            It should work for 5, too - If not, just drop us a line.

            //SEIBERT/MEDIA added a comment - This plugin took care of your problem handling space within the attachment macro: https://marketplace.atlassian.com/plugins/confluence.extra.modifiedattachments It should work for 5, too - If not, just drop us a line.

            MartinB added a comment -

            On our instance, the button caption "delete" is now partly hidden (see attachment)

            MartinB added a comment - On our instance, the button caption "delete" is now partly hidden (see attachment)

            Hi Scott,

            Thanks for your comment. As you point out, using a fixed table layout may not be the best idea in that case. I'll see if I can spend some more time coming up with a better solution that works for that case and I'll make sure to test with office documents as they have extra actions. It will be worked on as part of CONF-30112.

            Niraj Bhawnani added a comment - Hi Scott, Thanks for your comment. As you point out, using a fixed table layout may not be the best idea in that case. I'll see if I can spend some more time coming up with a better solution that works for that case and I'll make sure to test with office documents as they have extra actions. It will be worked on as part of CONF-30112 .

            I just tested the downloadable 5.2-rc1, which was released today, and I can confirm that it's still broken exactly as described in my comment above from 26/Jul/13 11:35 AM. (As in Normand's case, the Attachments macro is fine...it's just the Tools->Attachments page that is busted.)

            Scott Dudley [Inactive] added a comment - I just tested the downloadable 5.2-rc1, which was released today, and I can confirm that it's still broken exactly as described in my comment above from 26/Jul/13 11:35 AM. (As in Normand's case, the Attachments macro is fine...it's just the Tools->Attachments page that is busted.)

              nbhawnani Niraj Bhawnani
              e4a15a8c6b83 Aviaso
              Affected customers:
              46 This affects my team
              Watchers:
              44 Start watching this issue

                Created:
                Updated:
                Resolved: