Feature #25988

Preview files by default instead of downloading them

Added by Jan from Planio www.plan.io 4 months ago. Updated 3 months ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:UI
Target version:3.4.0
Resolution:Fixed

Description

Through user research at Planio, we determined that users expect to preview file attachments (images, text, pdfs - see #22483) in a browser window rather than downloading them when they click.

The attached patch switches the default behaviour from downloading to previewing and it replaces the old magnifier icon (for previewing) with a disk icon (for downloading).

It also cleans up attachment display using the attachments/links partial by displaying data in a borderless table format.

Here's a preview:

Current status:

Proposed new status:

attachments_preview_download_new.png (226 KB) Jan from Planio www.plan.io, 2017-05-17 16:00

attachments_preview_download_old.png (220 KB) Jan from Planio www.plan.io, 2017-05-17 16:00

0001-Highlight-Files-tab-when-viewing-attachments.patch Magnifier (1.1 KB) Jan from Planio www.plan.io, 2017-05-17 16:01

0002-Switch-default-behaviour-on-Attachment-click-to-view.patch Magnifier (6.41 KB) Jan from Planio www.plan.io, 2017-05-17 16:01

0003-Use-new-icon-download-class-for-downloads.patch Magnifier (3.57 KB) Jan from Planio www.plan.io, 2017-05-17 16:37

ragged_right.png (194 KB) Jan from Planio www.plan.io, 2017-05-21 12:15

three_columns.png (191 KB) Jan from Planio www.plan.io, 2017-05-21 12:15

25988-format_object.diff Magnifier (1.28 KB) Go MAEDA, 2017-06-11 07:02


Related issues

Related to Redmine - Feature #22481: Show thumbnails for PDF attachments New
Related to Redmine - Defect #26310: "attachment:filename" should generate a link to preview i... Closed

Associated revisions

Revision 16651
Added by Jean-Philippe Lang 4 months ago

Preview files by default instead of downloading them (#25988).

Patch by Jan Schulz-Hofen.

Revision 16652
Added by Jean-Philippe Lang 4 months ago

Highlight menu item when viewing an attachment (#25988).

Revision 16665
Added by Jean-Philippe Lang 3 months ago

Preview files by default instead of downloading them (#25988).

Patch by Go MAEDA.

Revision 16738
Added by Jean-Philippe Lang 3 months ago

"attachment:filename" should generate a link to preview instead of download (#26310, #25988).

History

#1 Updated by Jan from Planio www.plan.io 4 months ago

Since there’s a semantical difference between saving and downloading (saving to disk), I've introduced a new CSS class here (but I'm still using the same icon for now).

#2 Updated by budo kaiman 4 months ago

+1 the default behaviour always throws me off.

#3 Updated by Go MAEDA 4 months ago

I think it is dangerous to place a download button just beside the delete button. Some user may accidentally delte files.

#4 Updated by Jan from Planio www.plan.io 4 months ago

Go MAEDA wrote:

I think it is dangerous to place a download button just beside the delete button. Some user may accidentally delte files.

Thank you for your feedback. I agree that might be the case. However, Redmine has already JS popups asking if files should really be deleted. I also liked the fact that we place the icons next to each other, to make a clearer separation between text and icons.

Do you have a proposal where the icons would be better placed?

#5 Updated by Go MAEDA 4 months ago

Jan from Planio www.plan.io wrote:

I also liked the fact that we place the icons next to each other, to make a clearer separation between text and icons.

Do you have a proposal where the icons would be better placed?

I would rather prefer the position where the magnifier icon is placed in the current implementation, but I can understand what you said.

#6 Updated by Jan from Planio www.plan.io 4 months ago

  • Blocks Feature #25999: View repository content by default (instead of the history) added

#7 Updated by Gregor Schmidt 4 months ago

I agree. Putting the download buttons into a new column between file name and description might be the safer option.

#8 Updated by Jan from Planio www.plan.io 4 months ago

Thank you for your feedback, Go and Gregor. Holger and I played around with different layouts before I submitted the patch. We went for the current implementation because we felt it looks cleaner to have the two icons next to each other.

When placing the download icon next to the filename, you will either end up with three stacked columns of icons (paperclip, disk, and trashcan), or you re-introduce much of the current visual style which I find not very appealing due to its "ragged right" appearance.

Here are the two screenshots:


Cons: Three columns of icons


Cons: "Ragged right" appearance

#9 Updated by Go MAEDA 4 months ago

  • Target version changed from Candidate for next minor release to 3.4.0

Jan, thanks for testing UI variations. Now I have understood that the first UI is best.
I am setting target version to 3.4.0.

#10 Updated by Go MAEDA 4 months ago

  • Related to Feature #22481: Show thumbnails for PDF attachments added

#11 Updated by Jean-Philippe Lang 4 months ago

  • Blocks deleted (Feature #25999: View repository content by default (instead of the history))

#12 Updated by Jean-Philippe Lang 4 months ago

  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang
  • Resolution set to Fixed

I've committed the change with the download icons close to the filename, I find it more usable.
I prefer not to commit the first patch as attachments are not part of the files module. Having no tab selected is indeed not great but it would be much better to highlight the tab that correspond to the container of the attachment (eg. when previewing an issue attachment, the issue tab should be selected). I'll have a look at this.

#13 Updated by Go MAEDA 3 months ago

I noticed that attachment links in the following features should also lead to Preview page by default to increase consistency.

  • File type custom field (#6719)
  • Files column in issues list (#25515)

I wrote a patch to change the behavior: 25988-format_object.diff

#14 Updated by Jean-Philippe Lang 3 months ago

  • Status changed from Reopened to Closed

Thanks.

#15 Updated by Go MAEDA 3 months ago

  • Related to Defect #26310: "attachment:filename" should generate a link to preview instead of download added

Also available in: Atom PDF