style(frontend): adjust padding and margins for improved layout in AgentList, Chat, and KnowledgeBaseList components

- Removed unnecessary margins and adjusted padding in AgentList.vue, Chat.vue, and KnowledgeBaseList.vue to enhance the visual layout.
- Updated scrollbar styles to utilize system defaults for a more consistent user experience across components.
- Ensured that sticky headers align properly with the container edges by modifying padding settings.
This commit is contained in:
wizardchen
2026-06-10 19:23:45 +08:00
committed by lyingbug
parent 1c31d649a7
commit ba492aa9f5
3 changed files with 32 additions and 11 deletions
+7 -3
View File
@@ -1538,7 +1538,7 @@ defineExpose({
<style scoped lang="less">
.agent-list-container {
margin: 0 16px 0 0;
margin: 0;
height: 100%;
box-sizing: border-box;
flex: 1;
@@ -1552,7 +1552,8 @@ defineExpose({
display: flex;
flex-direction: column;
min-width: 0;
padding: 20px 28px 0 28px;
// 右侧不留 padding,让滚动条贴到内容区最右缘;内边距改到 header / main 内部
padding: 20px 0 0 28px;
}
.agent-list-main {
@@ -1561,7 +1562,9 @@ defineExpose({
overflow-y: auto;
overflow-x: hidden;
// 同 KB 列表:顶部去掉 padding,让 sticky 分组标题贴到容器最顶。
padding: 0 0 8px;
padding: 0 28px 8px 0;
scrollbar-width: auto;
scrollbar-color: auto;
}
.agent-list-main-loading {
@@ -1589,6 +1592,7 @@ defineExpose({
align-items: center;
justify-content: space-between;
margin-bottom: 16px;
padding-right: 28px;
.header-title {
display: flex;
+19 -5
View File
@@ -1593,7 +1593,8 @@ onBeforeRouteUpdate((to, from, next) => {
<style lang="less" scoped>
.chat {
font-size: 20px;
padding: 20px;
// 右侧不留 padding,滚动条贴到内容区最右缘
padding: 20px 0 20px 20px;
box-sizing: border-box;
flex: 1;
// The parent .platform-route-outlet is a flex column with min-height:0
@@ -1647,11 +1648,23 @@ onBeforeRouteUpdate((to, from, next) => {
min-height: 0;
width: 100%;
overflow-y: auto;
// 使用系统原生滚动条(macOS 滚动时自动显示 overlay 滚动条,类似 ChatGPT)
scrollbar-width: auto;
scrollbar-color: auto;
}
&::-webkit-scrollbar {
width: 0;
height: 0;
color: transparent;
// 深色模式下 theme.css 对 * 做了 webkit 滚动条着色,这里恢复为系统默认
:global(:root[theme-mode="dark"]) .chat_scroll_box {
&::-webkit-scrollbar-thumb {
background-color: initial !important;
}
&::-webkit-scrollbar-thumb:hover {
background-color: initial !important;
}
&::-webkit-scrollbar-track {
background-color: initial !important;
}
}
@@ -1752,6 +1765,7 @@ onBeforeRouteUpdate((to, from, next) => {
width: 100%;
max-width: 800px;
box-sizing: border-box;
padding-right: 20px;
&.is-embedded {
max-width: 100%;
@@ -1737,7 +1737,7 @@ const handleUploadFinishedEvent = (event: Event) => {
<style scoped lang="less">
.kb-list-container {
margin: 0 16px 0 0;
margin: 0;
height: 100%;
box-sizing: border-box;
flex: 1;
@@ -1751,7 +1751,7 @@ const handleUploadFinishedEvent = (event: Event) => {
display: flex;
flex-direction: column;
min-width: 0;
padding: 20px 28px 0 28px;
padding: 20px 0 0 28px;
}
.header {
@@ -1759,6 +1759,7 @@ const handleUploadFinishedEvent = (event: Event) => {
align-items: center;
justify-content: space-between;
margin-bottom: 16px;
padding-right: 28px;
.header-title {
display: flex;
@@ -1800,7 +1801,9 @@ const handleUploadFinishedEvent = (event: Event) => {
overflow-x: hidden;
// 顶部不留 padding,sticky 的分组标题 (top: 0) 才能贴到容器最顶;
// 底部 padding 保留,避免最后一行卡片紧贴边。
padding: 0 0 8px;
padding: 0 28px 8px 0;
scrollbar-width: auto;
scrollbar-color: auto;
}
.kb-list-main-loading {