bobbai00 commented on code in PR #4020: URL: https://github.com/apache/texera/pull/4020#discussion_r2562501702
########## frontend/src/app/workspace/component/agent-panel/agent-chat/agent-chat.component.scss: ########## @@ -0,0 +1,279 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +.agent-chat-container { + display: flex; + flex-direction: column; + height: 100%; + width: 100%; + background: white; +} + +.chat-toolbar { + display: flex; + justify-content: flex-end; + align-items: center; + padding: 8px 12px; + border-bottom: 1px solid #f0f0f0; + background: white; +} + +.chat-toolbar-controls { + display: flex; + width: 100%; + align-items: center; + justify-content: space-between; + gap: 24px; +} + +.toolbar-item { + display: flex; + align-items: center; + flex-shrink: 0; +} + +.chat-toolbar-buttons { + display: flex; + gap: 4px; + align-items: center; + margin-left: 8px; +} + +.chat-content-wrapper { + flex: 1; + overflow: hidden; + display: flex; + flex-direction: column; +} + +.messages-container { + flex: 1; + overflow-y: auto; + padding: 12px; + display: flex; + flex-direction: column; + gap: 8px; +} + +.message { + display: flex; + flex-direction: column; + gap: 2px; + max-width: 85%; + + &.user-message { + align-self: flex-end; + + .message-content { + background: #1890ff; + color: white; + + ::ng-deep { + code { + background: rgba(255, 255, 255, 0.2); + color: white; + } + + strong { + color: white; + } + } + } + } + + &.ai-message { + align-self: flex-start; + + .message-content { + background: #f5f5f5; + color: #262626; + } + } + + &.loading-message { + .message-content { + background: #e6f7ff; + border: 1px solid #91d5ff; + } + } +} + +.message-header { + display: flex; + align-items: center; + gap: 6px; + padding: 0 8px; + font-size: 12px; + color: #8c8c8c; + + i { + font-size: 14px; + } +} + +.message-content { + padding: 8px 12px; + border-radius: 6px; + line-height: 1.5; + word-wrap: break-word; + white-space: pre-wrap; // Preserves whitespace and line breaks + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; Review Comment: removed ########## frontend/src/app/workspace/component/agent-panel/agent-chat/agent-chat.component.scss: ########## @@ -0,0 +1,279 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +.agent-chat-container { + display: flex; + flex-direction: column; + height: 100%; + width: 100%; + background: white; +} + +.chat-toolbar { + display: flex; + justify-content: flex-end; + align-items: center; + padding: 8px 12px; + border-bottom: 1px solid #f0f0f0; + background: white; +} + +.chat-toolbar-controls { + display: flex; + width: 100%; + align-items: center; + justify-content: space-between; + gap: 24px; +} + +.toolbar-item { + display: flex; + align-items: center; + flex-shrink: 0; +} + +.chat-toolbar-buttons { + display: flex; + gap: 4px; + align-items: center; + margin-left: 8px; +} + +.chat-content-wrapper { + flex: 1; + overflow: hidden; + display: flex; + flex-direction: column; +} + +.messages-container { + flex: 1; + overflow-y: auto; + padding: 12px; + display: flex; + flex-direction: column; + gap: 8px; +} + +.message { + display: flex; + flex-direction: column; + gap: 2px; + max-width: 85%; + + &.user-message { + align-self: flex-end; + + .message-content { + background: #1890ff; + color: white; + + ::ng-deep { + code { + background: rgba(255, 255, 255, 0.2); + color: white; + } + + strong { + color: white; + } + } + } + } + + &.ai-message { + align-self: flex-start; + + .message-content { + background: #f5f5f5; + color: #262626; + } + } + + &.loading-message { + .message-content { + background: #e6f7ff; + border: 1px solid #91d5ff; + } + } +} + +.message-header { + display: flex; + align-items: center; + gap: 6px; + padding: 0 8px; + font-size: 12px; + color: #8c8c8c; + + i { + font-size: 14px; + } +} + +.message-content { + padding: 8px 12px; + border-radius: 6px; + line-height: 1.5; + word-wrap: break-word; + white-space: pre-wrap; // Preserves whitespace and line breaks + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; + font-size: 14px; + + // Style for markdown content + ::ng-deep markdown { + display: block; + + // Reset whitespace handling for markdown + white-space: normal; + + // Style markdown elements + p { + margin: 0 0 8px 0; + + &:last-child { + margin-bottom: 0; + } + } + + code { + background: rgba(0, 0, 0, 0.06); + padding: 2px 6px; + border-radius: 3px; + font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; Review Comment: removed -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
