Defect #43504
closedUnexpected file name shown when hovering over a link in the Files column
0%
Description
When hovering over a file name in the Files column on the issue list, only the download icon should appear.
However, the same file name is also displayed in the lower-right corner.
It did not reproduce in 6.1.0, but it reproduced in the latest trunk.
This issue is caused by .icon-label, which should originally be display: none, being shown due to CSS.
The problem can be fixed with the changes described below.
diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css
index 0a22e3c81..2e5682a76 100644
--- a/app/assets/stylesheets/application.css
+++ b/app/assets/stylesheets/application.css
@@ -370,9 +370,9 @@ table.list td.icon {width: 100%;} /* Prevents border from disappearing due to in
table.list td.id { width: 2%; text-align: center;}
table.list td.name, table.list td.description, table.list td.subject, table.list td.parent-subject, table.list td.comments, table.list td.roles, table.list td.attachments, table.list td.text, table.list td.short_description {text-align: left;}
-table.list td.attachments span {display: block; height: 16px;}
-table.list td.attachments span a.icon-download {display: inline-block; visibility: hidden;}
-table.list td.attachments span:hover a.icon-download {visibility: visible;}
+table.list td.attachments > span {display: block; height: 16px;}
+table.list td.attachments > span a.icon-download {visibility: hidden;}
+table.list td.attachments > span:hover a.icon-download {visibility: visible;}
table.list td.tick {width:15%}
table.list td.checkbox { width: 15px; padding: 2px 0 0 0; }
table.list .checkbox input {padding:0px; height: initial;}
Files
Updated by Katsuya HIDAKA 21 days ago
I confirmed that the patch mentioned in the issue description works as expected in Chrome, Safari, and Firefox. Looks good.
As another option, adding an explicit CSS class like .attachment-file to the <span> tag might make the intent clearer and improve readability of the code.
diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css
index 0a22e3c81..decf83754 100644
--- a/app/assets/stylesheets/application.css
+++ b/app/assets/stylesheets/application.css
@@ -370,9 +370,9 @@ table.list td.icon {width: 100%;} /* Prevents border from disappearing due to in
table.list td.id { width: 2%; text-align: center;}
table.list td.name, table.list td.description, table.list td.subject, table.list td.parent-subject, table.list td.comments, table.list td.roles, table.list td.attachments, table.list td.text, table.list td.short_description {text-align: left;}
-table.list td.attachments span {display: block; height: 16px;}
-table.list td.attachments span a.icon-download {display: inline-block; visibility: hidden;}
-table.list td.attachments span:hover a.icon-download {visibility: visible;}
+table.list td.attachments span.attachment-filename {display: block; height: 16px;}
+table.list td.attachments span.attachment-filename a.icon-download {visibility: hidden;}
+table.list td.attachments span.attachment-filename:hover a.icon-download {visibility: visible;}
table.list td.tick {width:15%}
table.list td.checkbox { width: 15px; padding: 2px 0 0 0; }
table.list .checkbox input {padding:0px; height: initial;}
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index c1ddaedda..1180d4427 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -316,7 +316,8 @@ module ApplicationHelper
:icon => 'download',
:title => l(:button_download),
:download => true
- )
+ ),
+ class: 'attachment-filename'
)
else
object.filename
I confirmed that all tests pass with this patch applied.
Updated by Mizuki ISHIKAWA 17 days ago
Katsuya HIDAKA wrote in #note-2:
I confirmed that the patch mentioned in the issue description works as expected in Chrome, Safari, and Firefox. Looks good.
As another option, adding an explicit CSS class like
.attachment-fileto the<span>tag might make the intent clearer and improve readability of the code.[...]
I confirmed that all tests pass with this patch applied.
Thank you for the suggestion. I think this code will handle future changes better