Skip to content

Commit c09cfc1

Browse files
Copilotalexr00
andcommitted
Collapse outdated comments instead of hiding them completely
Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
1 parent 8e29e17 commit c09cfc1

2 files changed

Lines changed: 10 additions & 39 deletions

File tree

webviews/components/timeline.tsx

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -247,26 +247,20 @@ function CommentThread({ thread, event }: { thread: IComment[]; event: ReviewEve
247247
}
248248
};
249249

250-
// For outdated comments, show a minimal timeline item
251-
if (isOutdated) {
252-
return (
253-
<div key={event.id} className="diff-container">
254-
<div className="outdated-comment">
255-
<span className="outdated-comment-label">This comment was marked as outdated.</span>
256-
{nbsp}
257-
<a href={comment.htmlUrl} target="_blank" rel="noopener noreferrer">View in GitHub</a>
258-
</div>
259-
</div>
260-
);
261-
}
262-
263250
return (
264251
<div key={event.id} className="diff-container">
265252
<div className="resolved-container">
266253
<div>
267-
<a className="diffPath" onClick={() => openDiff(comment)}>
268-
{comment.path}
269-
</a>
254+
{comment.position === null ? (
255+
<span>
256+
<span>{comment.path}</span>
257+
<span className="outdatedLabel">Outdated</span>
258+
</span>
259+
) : (
260+
<a className="diffPath" onClick={() => openDiff(comment)}>
261+
{comment.path}
262+
</a>
263+
)}
270264
{!resolved && !revealed ? <span className="unresolvedLabel">Unresolved</span> : null}
271265
</div>
272266
<button className="secondary" onClick={() => setRevealed(!revealed)}>

webviews/editorWebview/index.css

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -418,29 +418,6 @@ body .resolved-container .unresolvedLabel {
418418
margin-left: 5px;
419419
}
420420

421-
body .outdated-comment {
422-
padding: 12px 16px;
423-
background: var(--vscode-editor-background);
424-
border: 1px solid var(--vscode-panel-border);
425-
border-radius: 4px;
426-
margin: 8px 0;
427-
color: var(--vscode-descriptionForeground);
428-
font-size: 13px;
429-
}
430-
431-
body .outdated-comment .outdated-comment-label {
432-
font-style: italic;
433-
}
434-
435-
body .outdated-comment a {
436-
color: var(--vscode-textLink-foreground);
437-
text-decoration: none;
438-
}
439-
440-
body .outdated-comment a:hover {
441-
text-decoration: underline;
442-
}
443-
444421
body .diff .diffPath {
445422
margin-right: 4px;
446423
}

0 commit comments

Comments
 (0)