Commit 309f3b9f by Apple\Apple

💄 style(ui): hide scrollbars across chat interface and request editor

Hide y-axis scrollbars to provide a cleaner UI experience while maintaining
scroll functionality through mouse wheel and keyboard navigation.

Changes include:
- Hide scrollbars in CustomRequestEditor TextArea component
- Hide scrollbars in chat container and all related chat components
- Hide scrollbars in thinking content areas
- Add cross-browser compatibility for scrollbar hiding
- Maintain scroll functionality while improving visual aesthetics

Components affected:
- CustomRequestEditor.js: Added custom-request-textarea class
- index.css: Updated scrollbar styles for chat, thinking, and editor areas

The interface now provides a more streamlined appearance consistent with
modern UI design patterns while preserving all interactive capabilities.
parent ec4dbcd7
...@@ -39,7 +39,7 @@ const ChatArea = ({ ...@@ -39,7 +39,7 @@ const ChatArea = ({
return ( return (
<Card <Card
className="!rounded-2xl h-full" className="!rounded-2xl h-full"
bodyStyle={{ padding: 0, height: 'calc(100vh - 101px)', display: 'flex', flexDirection: 'column', overflow: 'hidden' }} bodyStyle={{ padding: 0, height: 'calc(100vh - 108px)', display: 'flex', flexDirection: 'column', overflow: 'hidden' }}
> >
{/* 聊天头部 */} {/* 聊天头部 */}
{styleState.isMobile ? ( {styleState.isMobile ? (
......
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { import {
Card,
TextArea, TextArea,
Typography, Typography,
Button, Button,
Switch, Switch,
Banner, Banner,
Tag,
} from '@douyinfe/semi-ui'; } from '@douyinfe/semi-ui';
import { import {
Code, Code,
...@@ -104,11 +102,6 @@ const CustomRequestEditor = ({ ...@@ -104,11 +102,6 @@ const CustomRequestEditor = ({
<Typography.Text strong className="text-sm"> <Typography.Text strong className="text-sm">
自定义请求体模式 自定义请求体模式
</Typography.Text> </Typography.Text>
{customRequestMode && (
<Tag color="green" size="small" shape='circle'>
已启用
</Tag>
)}
</div> </div>
<Switch <Switch
checked={customRequestMode} checked={customRequestMode}
...@@ -171,7 +164,7 @@ const CustomRequestEditor = ({ ...@@ -171,7 +164,7 @@ const CustomRequestEditor = ({
onChange={handleValueChange} onChange={handleValueChange}
placeholder='{"model": "gpt-4o", "messages": [...], ...}' placeholder='{"model": "gpt-4o", "messages": [...], ...}'
autosize={{ minRows: 8, maxRows: 20 }} autosize={{ minRows: 8, maxRows: 20 }}
className={`!rounded-lg font-mono text-sm ${!isValid ? '!border-red-500' : ''}`} className={`custom-request-textarea !rounded-lg font-mono text-sm ${!isValid ? '!border-red-500' : ''}`}
style={{ style={{
fontFamily: 'Consolas, Monaco, "Courier New", monospace', fontFamily: 'Consolas, Monaco, "Courier New", monospace',
lineHeight: '1.5', lineHeight: '1.5',
......
...@@ -183,25 +183,37 @@ code { ...@@ -183,25 +183,37 @@ code {
overflow-x: hidden !important; overflow-x: hidden !important;
} }
.semi-chat-container { /* 隐藏所有聊天相关区域的滚动条 */
overflow-x: hidden !important; .semi-chat::-webkit-scrollbar,
.semi-chat-chatBox::-webkit-scrollbar,
.semi-chat-chatBox-wrap::-webkit-scrollbar,
.semi-chat-chatBox-content::-webkit-scrollbar,
.semi-chat-content::-webkit-scrollbar,
.semi-chat-list::-webkit-scrollbar {
display: none;
} }
.semi-chat-container::-webkit-scrollbar { .semi-chat,
width: 4px; .semi-chat-chatBox,
.semi-chat-chatBox-wrap,
.semi-chat-chatBox-content,
.semi-chat-content,
.semi-chat-list {
-ms-overflow-style: none;
scrollbar-width: none;
} }
.semi-chat-container::-webkit-scrollbar-thumb { .semi-chat-container {
background: rgba(0, 0, 0, 0.1); overflow-x: hidden !important;
border-radius: 2px;
} }
.semi-chat-container::-webkit-scrollbar-thumb:hover { .semi-chat-container::-webkit-scrollbar {
background: rgba(0, 0, 0, 0.15); display: none;
} }
.semi-chat-container::-webkit-scrollbar-track { .semi-chat-container {
background: transparent; -ms-overflow-style: none;
scrollbar-width: none;
} }
/* 隐藏模型设置区域的滚动条 */ /* 隐藏模型设置区域的滚动条 */
...@@ -216,26 +228,31 @@ code { ...@@ -216,26 +228,31 @@ code {
/* 思考内容区域滚动条样式 */ /* 思考内容区域滚动条样式 */
.thinking-content-scroll::-webkit-scrollbar { .thinking-content-scroll::-webkit-scrollbar {
width: 6px; display: none;
height: 6px;
} }
.thinking-content-scroll::-webkit-scrollbar-thumb { .thinking-content-scroll {
background: rgba(0, 0, 0, 0.2); -ms-overflow-style: none;
border-radius: 3px; scrollbar-width: none;
} }
.thinking-content-scroll::-webkit-scrollbar-thumb:hover { /* 隐藏请求体 JSON TextArea 的滚动条 */
background: rgba(0, 0, 0, 0.3); .custom-request-textarea .semi-input::-webkit-scrollbar {
display: none;
} }
.thinking-content-scroll::-webkit-scrollbar-track { .custom-request-textarea .semi-input {
background: transparent; -ms-overflow-style: none;
scrollbar-width: none;
} }
.thinking-content-scroll { .custom-request-textarea textarea::-webkit-scrollbar {
scrollbar-width: thin; display: none;
scrollbar-color: rgba(0, 0, 0, 0.2) transparent; }
.custom-request-textarea textarea {
-ms-overflow-style: none;
scrollbar-width: none;
} }
/* 调试面板标签样式 */ /* 调试面板标签样式 */
......
...@@ -363,7 +363,7 @@ const Playground = () => { ...@@ -363,7 +363,7 @@ const Playground = () => {
flexShrink: 0, flexShrink: 0,
minWidth: styleState.isMobile ? '100%' : 320, minWidth: styleState.isMobile ? '100%' : 320,
maxWidth: styleState.isMobile ? '100%' : 320, maxWidth: styleState.isMobile ? '100%' : 320,
height: styleState.isMobile ? 'auto' : 'calc(100vh - 100px)', height: styleState.isMobile ? 'auto' : 'calc(100vh - 106px)',
overflow: 'auto', overflow: 'auto',
position: styleState.isMobile ? 'fixed' : 'relative', position: styleState.isMobile ? 'fixed' : 'relative',
zIndex: styleState.isMobile ? 1000 : 1, zIndex: styleState.isMobile ? 1000 : 1,
...@@ -400,7 +400,7 @@ const Playground = () => { ...@@ -400,7 +400,7 @@ const Playground = () => {
)} )}
<Layout.Content className="relative flex-1 overflow-hidden"> <Layout.Content className="relative flex-1 overflow-hidden">
<div className="sm:px-4 overflow-hidden flex flex-col lg:flex-row gap-2 sm:gap-4 h-[calc(100vh-100px)]"> <div className="sm:px-4 overflow-hidden flex flex-col lg:flex-row gap-2 sm:gap-4 h-[calc(100vh-106px)]">
<div className="flex-1 flex flex-col"> <div className="flex-1 flex flex-col">
<ChatArea <ChatArea
chatRef={chatRef} chatRef={chatRef}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment