Skip to content

Commit

Permalink
feat: improve prompt cell output display
Browse files Browse the repository at this point in the history
  • Loading branch information
sunshinesmilelk authored and BroKun committed Jan 22, 2024
1 parent 7a8b983 commit 3fac6a2
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 64 deletions.
2 changes: 0 additions & 2 deletions packages/libro-prompt-cell/src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { FormatterPromptMagicContribution } from './libro-formatter-prompt-magic
import { LibroPromptCellCommandContribution } from './prompt-cell-command-contribution.js';
import { PromptCellContribution } from './prompt-cell-contribution.js';
import { LibroPromptCellModel } from './prompt-cell-model.js';
import { LibroPromptOutputArea } from './prompt-cell-output-area.js';
import { LibroPromptCellModelFactory } from './prompt-cell-protocol.js';
import { PromptScript } from './prompt-cell-script.js';
import { LibroPromptCellView } from './prompt-cell-view.js';
Expand All @@ -18,7 +17,6 @@ export const LibroPromptCellModule = ManaModule.create()
PromptScript,
LibroPromptCellView,
LibroPromptCellModel,
LibroPromptOutputArea,
LibroPromptOutputMimeTypeContribution,
LibroPromptCellCommandContribution,
FormatterPromptMagicContribution,
Expand Down
59 changes: 0 additions & 59 deletions packages/libro-prompt-cell/src/prompt-cell-output-area.tsx

This file was deleted.

5 changes: 3 additions & 2 deletions packages/libro-prompt-cell/src/prompt-cell-view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import type {
LibroCell,
CellViewOptions,
} from '@difizen/libro-core';
import { LibroOutputArea } from '@difizen/libro-core';
import {
CellService,
LibroExecutableCellView,
LibroOutputArea,
LibroViewTracker,
EditorStatus,
LirboContextKey,
Expand Down Expand Up @@ -487,7 +487,8 @@ export class LibroPromptCellView extends LibroExecutableCellView {
handleQueryResponse = (response: KernelMessage.IIOPubMessage) => {
const msgType = response.header.msg_type;
switch (msgType) {
case 'execute_result': {
case 'execute_result':
case 'display_data': {
const payload = response as KernelMessage.IExecuteResultMsg;
let content: string = payload.content.data['text/plain'] as string;
if (content.slice(0, 1) === "'" || content.slice(0, 1) === '"') {
Expand Down
2 changes: 1 addition & 1 deletion packages/libro-prompt-cell/src/prompt-output-render.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const PromptOutputRender: React.FC<{
return null;
}

const { data } = model.data['application/vnd.libro.prompt+json'] as IMimeBundle;
const data = model.data['application/vnd.libro.prompt+json'] as IMimeBundle;

if (!data) {
return null;
Expand Down

0 comments on commit 3fac6a2

Please sign in to comment.