Skip to content

Commit

Permalink
remove StrEnum, fix rendering issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mbektas committed Jan 5, 2025
1 parent 399ddf0 commit 8ea2c16
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 27 deletions.
8 changes: 4 additions & 4 deletions notebook_intelligence/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@
import sys
from typing import Callable, Dict
from dataclasses import dataclass
from enum import Enum, StrEnum
from enum import Enum

class RequestDataType(StrEnum):
class RequestDataType(str, Enum):
ChatRequest = 'chat-request'
ChatUserInput = 'chat-user-input'
ClearChatHistory = 'clear-chat-history'
RunUICommandResponse = 'run-ui-command-response'
GenerateCode = 'generate-code'

class BackendMessageType(StrEnum):
class BackendMessageType(str, Enum):
StreamMessage = 'stream-message'
StreamEnd = 'stream-end'
RunUICommand = 'run-ui-command'

class ResponseStreamDataType(StrEnum):
class ResponseStreamDataType(str, Enum):
LLMRaw = 'llm-raw'
Markdown = 'markdown'
MarkdownPart = 'markdown-part'
Expand Down
46 changes: 23 additions & 23 deletions src/chat-sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -853,30 +853,30 @@ function SidebarComponent(props: any) {
)}

{ghLoginStatus === GitHubCopilotLoginStatus.LoggedIn &&
chatMessages.length === 0 ? (
<div className="sidebar-messages">
<div className="sidebar-greeting">
Welcome! How can I assist you today?
(chatMessages.length === 0 ? (
<div className="sidebar-messages">
<div className="sidebar-greeting">
Welcome! How can I assist you today?
</div>
</div>
</div>
) : (
<div className="sidebar-messages">
{chatMessages.map((msg, index) => (
<ChatResponse
key={`key-${index}`}
message={msg}
openFile={props.openFile}
getApp={props.getApp}
showGenerating={
index === chatMessages.length - 1 &&
msg.from === 'copilot' &&
copilotRequestInProgress
}
/>
))}
<div ref={messagesEndRef} />
</div>
)}
) : (
<div className="sidebar-messages">
{chatMessages.map((msg, index) => (
<ChatResponse
key={`key-${index}`}
message={msg}
openFile={props.openFile}
getApp={props.getApp}
showGenerating={
index === chatMessages.length - 1 &&
msg.from === 'copilot' &&
copilotRequestInProgress
}
/>
))}
<div ref={messagesEndRef} />
</div>
))}
{ghLoginStatus === GitHubCopilotLoginStatus.LoggedIn && (
<div className="sidebar-user-input">
<textarea
Expand Down

0 comments on commit 8ea2c16

Please sign in to comment.