Closed as not planned
Description
Background
Every call to initRepoIssueContentHistory
loads all histories data. In many cases (eg: dynamic loading, edited content), we only need to load some histories.
Solution
I think it can be done mostly in frontend, then we do not need to change backend code (no more dependencies or coupling, no need to make template files more complex)
initRepoIssueContentHistory()
=>attachRepoIssueContentHistory(targetCommentId=null)
GET /content-history/overview
=>POST /content-history/overview
with{commentIdList: [...] }
, only query the overview information forcommentIdList
- If targetCommentId==null, attachRepoIssueContentHistory would collect all history-menu-not-attached comment IDs, and send to backend to query overview.
- Then re-calling
attachRepoIssueContentHistory(null)
won't send redundant requests, we can call it safely at any time (Improvement) - If a content is edited, we can call
attachRepoIssueContentHistory(commentId)
to do a refresh and show the history menu (Improvement)
Originally posted by @wxiaoguang in #17819 (comment)