Skip to content

Commit

Permalink
Merge branch 'master' into 8151-course-chat-smaller-display-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dogi authored Jan 30, 2025
2 parents 5b54cb1 + d129497 commit 7170af2
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 37 deletions.
2 changes: 1 addition & 1 deletion src/app/chat/chat-sidebar/chat-sidebar.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,6 @@
<i class="material-icons">{{ drawer.opened && deviceType !== deviceTypes.DESKTOP ? 'chevron_left' : 'chevron_right' }}</i>
</button>
</div>
<planet-chat-window></planet-chat-window>
<planet-chat-window [isEditing]="isEditing"></planet-chat-window>
</div>
</mat-drawer-container>
9 changes: 7 additions & 2 deletions src/app/chat/chat-window/chat-window.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export class ChatWindowComponent implements OnInit, OnDestroy, AfterViewInit {
};
providers: AIProvider[] = [];
@Input() context: any;
@Input() isEditing: boolean;
@Input() conversations: any[] | null = null;
@ViewChild('chatInput') chatInput: ElementRef;
@ViewChild('chat') chatContainer: ElementRef;
Expand Down Expand Up @@ -98,7 +99,9 @@ export class ChatWindowComponent implements OnInit, OnDestroy, AfterViewInit {
.subscribe((conversationId) => {
this.selectedConversationId = conversationId;
this.fetchConversation(this.selectedConversationId?._id);
this.focusInput();
if (!this.isEditing) {
this.focusInput();
}
}, error => {
console.error('Error subscribing to selectedConversationId$', error);
});
Expand All @@ -111,7 +114,9 @@ export class ChatWindowComponent implements OnInit, OnDestroy, AfterViewInit {
this.provider = {
name: aiService
};
this.focusInput();
if (!this.isEditing) {
this.focusInput();
}
}));
}

Expand Down
17 changes: 0 additions & 17 deletions src/app/chat/chat-window/chat-window.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,3 @@
right: 8px;
transform: translateY(-50%);
}

.conversation-query {
text-align: left;
padding: 8px;
border-radius: 5px;
background-color: #{$primary};
color: white;
}

.conversation-response {
margin: 8px 16px;
}

.conversation-error {
color: #ff0000;
font-style: italic;
}
17 changes: 0 additions & 17 deletions src/app/news/news-list-item.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,6 @@ mat-card-content {
padding: 40px;
}

.conversation-query {
text-align: left;
padding: 8px;
border-radius: 5px;
background-color: #{$primary};
color: white;
}

.conversation-response {
margin: 8px 16px;
}

.conversation-error {
color: #ff0000;
font-style: italic;
}

@media (max-width: $screen-md) {
.chat-container {
padding: 20px;
Expand Down
24 changes: 24 additions & 0 deletions src/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,30 @@ body {
}

// Styles for the chat-output directive
.conversation-query {
text-align: left;
padding: 8px;
border-radius: 5px;
background-color: #{$primary};
color: white;
}

.chat-link {
color: white !important;
&:visited {
color: white !important;
}
}

.conversation-response {
margin: 8px 16px;
}

.conversation-error {
color: #ff0000;
font-style: italic;
}

.code-block {
position: relative;
background-color: #2d2d2d;
Expand Down

0 comments on commit 7170af2

Please sign in to comment.