Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,28 +31,27 @@ export class ChatPullRequestContentPart extends Disposable implements IChatConte

this.domNode = dom.$('.chat-pull-request-content-part');
const container = dom.append(this.domNode, dom.$('.container'));
const icon = dom.append(container, dom.$('.icon'));
const contentContainer = dom.append(container, dom.$('.content-container'));

const titleContainer = dom.append(contentContainer, dom.$('p.title-container'));
const titleContainer = dom.append(contentContainer, dom.$('.title-container'));
const icon = dom.append(titleContainer, dom.$('.icon'));
icon.classList.add(...ThemeIcon.asClassNameArray(Codicon.gitPullRequest));
const titleElement = dom.append(titleContainer, dom.$('.title'));
titleElement.textContent = this.pullRequestContent.title;
const linkElement: HTMLAnchorElement = dom.append(titleContainer, dom.$('a.link'));
linkElement.textContent = this.pullRequestContent.linkTag;
this._register(addDisposableListener(linkElement, 'click', (e) => {
titleElement.textContent = `${this.pullRequestContent.title} - ${this.pullRequestContent.author}`;

const descriptionElement = dom.append(contentContainer, dom.$('.description'));
const descriptionWrapper = dom.append(descriptionElement, dom.$('.description-wrapper'));
descriptionWrapper.textContent = this.pullRequestContent.description;

const seeMoreContainer = dom.append(descriptionElement, dom.$('.see-more'));
const seeMore: HTMLAnchorElement = dom.append(seeMoreContainer, dom.$('a'));
seeMore.textContent = localize('chatPullRequest.seeMore', 'See more');
this._register(addDisposableListener(seeMore, 'click', (e) => {
e.preventDefault();
e.stopPropagation();
this.openerService.open(this.pullRequestContent.uri);
}));
linkElement.href = this.pullRequestContent.uri.toString();

const metaElement = dom.append(contentContainer, dom.$('.meta'));
const authorElement = dom.append(metaElement, dom.$('.author'));
authorElement.textContent = localize('chatPullRequest.author', 'by {0}', this.pullRequestContent.author);

const descriptionElement = dom.append(contentContainer, dom.$('.description'));
descriptionElement.textContent = this.pullRequestContent.description;
seeMore.href = this.pullRequestContent.uri.toString();
}

hasSameContent(other: IChatRendererContent, followingContent: IChatRendererContent[], element: ChatTreeItem): boolean {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,9 @@

.chat-pull-request-content-part {
border: 1px solid var(--vscode-chat-requestBorder);
border-radius: 4px;
}

.chat-pull-request-content-part .container {
padding: 12px 12px 8px;
display: flex;
flex-direction: row;
border-radius: 6px;
margin: 4px 0;
overflow: hidden;
}

.chat-pull-request-content-part .container .icon {
Expand All @@ -24,49 +20,50 @@
flex-direction: column;
}

.chat-pull-request-content-part .title-container {
flex-direction: row;
display: flex;
gap: 4px;
font-size: large;
padding-bottom: 2px;
margin: unset;
}

.chat-pull-request-content-part .title-container .link {
color: var(--vscode-textLink-foreground);
flex-shrink: 0;
white-space: nowrap;
}

.chat-pull-request-content-part .title-container .icon.codicon {
font-size: large;
}
.chat-pull-request-content-part {

.chat-pull-request-content-part .author {
padding-bottom: 8px;
}
.title-container {
display: flex;
font-size: 13px;
padding: 8px 12px;
border-bottom: 1px solid var(--vscode-chat-requestBorder);
}

.chat-pull-request-content-part .description {
display: -webkit-box;
line-clamp: 2;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
position: relative;
}
.description .see-more {
display: none;
position: absolute;
right: 12px;
top: 26px;

a {
color: var(--vscode-textLink-foreground);
text-decoration: underline;
cursor: pointer;
}
}

.description {
position: relative;
padding: 8px 12px;
background: var(--vscode-editor-background);

.chat-pull-request-content-part .description::after {
content: "";
position: absolute;
left: 0;
right: 0;
bottom: 0;
height: 4em;
/* Adjust as needed */
pointer-events: none;
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--vscode-sideBar-background));
.description-wrapper {
/* This mask fades out the end of the second line of text so the "see more" message can be displayed over it. */
mask-image:
linear-gradient(to right, rgba(0, 0, 0, 1) calc(100% - 80px), rgba(0, 0, 0, 0) calc(100% - 57px)), linear-gradient(to top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) 20px, rgba(0, 0, 0, 1) 2px, rgba(0, 0, 0, 1) 100%);
mask-repeat: no-repeat, no-repeat;
pointer-events: none;
max-height: 40px;
}

.see-more {
display: block;
}
}
}
Loading