Skip to content

Commit

Permalink
On cell chat
Browse files Browse the repository at this point in the history
  • Loading branch information
rebornix committed Nov 14, 2023
1 parent 9c7cdf4 commit ecd4f38
Show file tree
Hide file tree
Showing 12 changed files with 761 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ import { IEditorWorkerService } from 'vs/editor/common/services/editorWorker';

const defaultAriaLabel = localize('aria-label', "Inline Chat Input");

const _inputEditorOptions: IEditorConstructionOptions = {
export const _inputEditorOptions: IEditorConstructionOptions = {
padding: { top: 2, bottom: 2 },
overviewRulerLanes: 0,
glyphMargin: false,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
.monaco-workbench .notebookOverlay .cell-chat-part .cell-chat-container {
padding: 8px 12px 0px 8px;
}

.monaco-workbench .notebookOverlay .cell-chat-part .cell-chat-container .body {
display: flex;
}

.monaco-workbench .notebookOverlay .cell-chat-part .cell-chat-container .body .content {
display: flex;
box-sizing: border-box;
outline: 1px solid var(--vscode-inlineChatInput-border);
outline-offset: -1px;
border-radius: 2px;
}

.monaco-workbench .notebookOverlay .cell-chat-part .cell-chat-container .body .content.synthetic-focus {
outline: 1px solid var(--vscode-inlineChatInput-focusBorder);
}

.monaco-workbench .notebookOverlay .cell-chat-part .cell-chat-container .body .content .input {
display: flex;
align-items: center;
justify-content: space-between;
padding: 2px 2px 2px 6px;
background-color: var(--vscode-inlineChatInput-background);
cursor: text;
}

.monaco-workbench .notebookOverlay .cell-chat-part .cell-chat-container .body .content .input .monaco-editor-background {
background-color: var(--vscode-inlineChatInput-background);
}

.monaco-workbench .notebookOverlay .cell-chat-part .cell-chat-container .body .content .input .editor-placeholder {
position: absolute;
z-index: 1;
color: var(--vscode-inlineChatInput-placeholderForeground);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}

.monaco-workbench .notebookOverlay .cell-chat-part .cell-chat-container .body .content .input .editor-placeholder.hidden {
display: none;
}

.monaco-workbench .notebookOverlay .cell-chat-part .cell-chat-container .body .content .input .editor-container {
vertical-align: middle;
}
.monaco-workbench .notebookOverlay .cell-chat-part .cell-chat-container .body .toolbar {
display: flex;
flex-direction: column;
align-self: stretch;
padding-right: 4px;
border-top-right-radius: 2px;
border-bottom-right-radius: 2px;
background: var(--vscode-inlineChatInput-background);
}

.monaco-workbench .notebookOverlay .cell-chat-part .cell-chat-container .body .toolbar .actions-container {
display: flex;
flex-direction: row;
gap: 4px;
}

/* progress */

.monaco-workbench .notebookOverlay .cell-chat-part .cell-chat-container .progress {
position: relative;
}

.monaco-workbench .notebookOverlay .cell-chat-part .cell-chat-container .progress .monaco-progress-container {
top: 0;
}

/* status */

.monaco-workbench .notebookOverlay .cell-chat-part .cell-chat-container .status {
height: 22px;
margin: 4px;
}


.monaco-workbench .notebookOverlay .cell-chat-part .cell-chat-container .status span {
overflow: hidden;
color: var(--vscode-descriptionForeground);
font-size: 11px;
align-self: baseline;
display: flex;
}
7 changes: 6 additions & 1 deletion src/vs/workbench/contrib/notebook/browser/notebookBrowser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ export enum CellLayoutState {

export interface CodeCellLayoutInfo {
readonly fontInfo: FontInfo | null;
readonly chatHeight: number;
readonly editorHeight: number;
readonly editorWidth: number;
readonly estimatedHasHorizontalScrolling: boolean;
Expand All @@ -189,6 +190,7 @@ export interface CodeCellLayoutInfo {

export interface CodeCellLayoutChangeEvent {
readonly source?: string;
readonly chatHeight?: boolean;
readonly editorHeight?: boolean;
readonly commentHeight?: boolean;
readonly outputHeight?: boolean;
Expand All @@ -200,6 +202,7 @@ export interface CodeCellLayoutChangeEvent {

export interface MarkupCellLayoutInfo {
readonly fontInfo: FontInfo | null;
readonly chatHeight: number;
readonly editorWidth: number;
readonly editorHeight: number;
readonly statusBarHeight: number;
Expand Down Expand Up @@ -249,6 +252,7 @@ export interface ICellViewModel extends IGenericCellViewModel {
readonly mime: string;
cellKind: CellKind;
lineNumbers: 'on' | 'off' | 'inherit';
chatHeight: number;
focusMode: CellFocusMode;
outputIsHovered: boolean;
getText(): string;
Expand Down Expand Up @@ -798,7 +802,8 @@ export enum CellEditState {
export enum CellFocusMode {
Container,
Editor,
Output
Output,
ChatInput
}

export enum CursorAtBoundary {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/

import 'vs/css!./media/notebook';
import 'vs/css!./media/notebookCellChat';
import 'vs/css!./media/notebookCellEditorHint';
import 'vs/css!./media/notebookCellInsertToolbar';
import 'vs/css!./media/notebookCellStatusBar';
Expand Down
Loading

0 comments on commit ecd4f38

Please sign in to comment.