Skip to content

Commit

Permalink
Adding timestamp to comment. fixes eclipse-theia#11702
Browse files Browse the repository at this point in the history
* Adds timestamp comment optional property
* Timestamp displayed in comment thread widget if defined

Contributed by STMicroelectronics

Signed-off-by: Remi SCHNEKENBURGER <rschnekenburger@eclipsesource.com>
  • Loading branch information
rschnekenbu committed Dec 6, 2022
1 parent 1cc8376 commit 2df36ae
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/plugin-ext/src/common/plugin-api-rpc-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,7 @@ export interface Comment {
readonly contextValue?: string;
readonly label?: string;
readonly mode?: CommentMode;
readonly timeStamp?: Date;
}

export enum CommentThreadCollapsibleState {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,7 @@ export class ReviewComment<P extends ReviewComment.Props = ReviewComment.Props>
<div className={'review-comment-contents'}>
<div className={'comment-title monaco-mouse-cursor-text'}>
<strong className={'author'}>{comment.userName}</strong>
<small className={'timestamp'}>{comment.timeStamp}</small>
<span className={'isPending'}>{comment.label}</span>
<div className={'theia-comments-inline-actions-container'}>
<div className={'theia-comments-inline-actions'} role={'toolbar'}>
Expand Down
6 changes: 6 additions & 0 deletions packages/plugin-ext/src/main/browser/style/comments.css
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,12 @@
line-height: var(--theia-content-line-height);
}

.monaco-editor .review-widget .body .review-comment .review-comment-contents .timestamp {
line-height: var(--theia-content-line-height);
margin: 0 5px 0 5px;
padding: 0 2px 0 2px;
}

.monaco-editor .review-widget .body .review-comment .review-comment-contents .isPending {
margin: 0 5px 0 5px;
padding: 0 2px 0 2px;
Expand Down
1 change: 1 addition & 0 deletions packages/plugin-ext/src/plugin/comments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,7 @@ function convertToModeComment(thread: ExtHostCommentThread, commentController: C
userName: theiaComment.author.name,
userIconPath: iconPath,
label: theiaComment.label,
timeStamp: theiaComment.timeStamp
};
}

Expand Down
5 changes: 5 additions & 0 deletions packages/plugin/src/theia.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12084,6 +12084,11 @@ export module '@theia/plugin' {
* Label will be rendered next to authorName if exists.
*/
label?: string;

/**
* Optional timestamp.
*/
timeStamp?: Date;
}

/**
Expand Down

0 comments on commit 2df36ae

Please sign in to comment.