-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Multiple improvements for comment edit diff #21990
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 8 commits
30dc426
9353bc2
58f716c
a2a6c88
a285166
f9f9090
a15b1f2
76ab24d
213bf66
943e448
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,20 +13,17 @@ function showContentHistoryDetail(issueBaseUrl, commentId, historyId, itemTitleH | |
|
||
$dialog = $(` | ||
<div class="ui modal content-history-detail-dialog"> | ||
<i class="close icon inside"></i> | ||
<div class="header"> | ||
${itemTitleHtml} | ||
<div class="ui dropdown right dialog-header-options" style="display: none; margin-right: 50px;"> | ||
${i18nTextOptions} <i class="dropdown icon"></i> | ||
${svg('octicon-x', 16, 'close icon inside')} | ||
<div class="header df ac sb"> | ||
<div>${itemTitleHtml}</div> | ||
<div class="ui dropdown dialog-header-options df ac mr-5 hide"> | ||
${i18nTextOptions}${svg('octicon-triangle-down', 14, 'dropdown icon')} | ||
<div class="menu"> | ||
<div class="item red text" data-option-item="delete">${i18nTextDeleteFromHistory}</div> | ||
</div> | ||
</div> | ||
</div> | ||
<!-- ".modal .content" style was polluted in "_base.less": "&.modal > .content" --> | ||
<div class="scrolling content" style="text-align: left; min-height: 30vh;"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMO The
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could just eliminate the loading state of the modal and fetch all data after click and only show the modal when all data is present. I don't agree about superflous whitespace on small diffs 😉 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The user needs a UI feed back when they clicks the history menu item, so, something must be shown. The dialog height in current approach can be very small, which makes the loading UI look strange. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Could probably add a
Please show an example. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The example was there: #21990 (comment) Or you can reproduce by:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes that's the broken loading state, but if we don't have a loading state inside the modal, this won't be an issue. I'll check later. |
||
<div class="ui loader active"></div> | ||
</div> | ||
<div class="comment-diff-data tl p-3 is-loading"></div> | ||
</div>`); | ||
$dialog.appendTo($('body')); | ||
$dialog.find('.dialog-header-options').dropdown({ | ||
|
@@ -62,10 +59,10 @@ function showContentHistoryDetail(issueBaseUrl, commentId, historyId, itemTitleH | |
_csrf: csrfToken, | ||
}, | ||
}).done((resp) => { | ||
$dialog.find('.content').html(resp.diffHtml); | ||
$dialog.find('.comment-diff-data').removeClass('is-loading').html(resp.diffHtml); | ||
// there is only one option "item[data-option-item=delete]", so the dropdown can be entirely shown/hidden. | ||
if (resp.canSoftDelete) { | ||
$dialog.find('.dialog-header-options').show(); | ||
$dialog.find('.dialog-header-options').removeClass('hide'); | ||
} | ||
}); | ||
}, | ||
|
@@ -79,7 +76,7 @@ function showContentHistoryMenu(issueBaseUrl, $item, commentId) { | |
const $headerLeft = $item.find('.comment-header-left'); | ||
const menuHtml = ` | ||
<div class="ui pointing dropdown top left content-history-menu" data-comment-id="${commentId}"> | ||
<a>• ${i18nTextEdited} ${svg('octicon-triangle-down', 17)}</a> | ||
• <a>${i18nTextEdited} ${svg('octicon-triangle-down', 14, 'dropdown icon')}</a> | ||
wxiaoguang marked this conversation as resolved.
Show resolved
Hide resolved
|
||
<div class="menu"> | ||
</div> | ||
</div>`; | ||
|
Uh oh!
There was an error while loading. Please reload this page.