Skip to content

Commit d6e0c6f

Browse files
committed
refactor: Update chat tree styles for improved layout and responsiveness, including width adjustments and overflow handling
1 parent 0cdc202 commit d6e0c6f

1 file changed

Lines changed: 27 additions & 91 deletions

File tree

src/renderer/src/components/layout/sidebar_items/chat/tree-styles.css

Lines changed: 27 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,32 @@
22
overflow: hidden;
33
}
44

5+
/* Ant Design Tree 样式覆盖 */
6+
.chat-history-tree .ant-tree-treenode {
7+
width: 100%;
8+
}
9+
10+
.chat-history-tree .ant-tree-node-content-wrapper {
11+
flex: 1;
12+
min-width: 0;
13+
overflow: hidden;
14+
}
15+
16+
.chat-history-tree .ant-tree-title {
17+
width: 100%;
18+
overflow: hidden;
19+
}
20+
521
.tree-node {
622
position: relative;
723
display: flex;
824
align-items: center;
9-
justify-content: space-between;
1025
padding: 4px 8px;
1126
border-radius: 4px;
1227
transition: all 0.2s;
1328
cursor: pointer;
14-
}
15-
16-
.tree-node:hover {
17-
background-color: #f5f5f5;
29+
width: 100%;
30+
box-sizing: border-box;
1831
}
1932

2033
.tree-node-content {
@@ -23,17 +36,15 @@
2336
flex: 1;
2437
min-width: 0;
2538
gap: 8px;
26-
}
27-
28-
.tree-node-icon {
29-
flex-shrink: 0;
30-
color: #666;
39+
overflow: hidden;
3140
}
3241

3342
.tree-node-title {
3443
flex: 1;
3544
min-width: 0;
3645
overflow: hidden;
46+
text-overflow: ellipsis;
47+
white-space: nowrap;
3748
}
3849

3950
.tree-node-actions {
@@ -42,91 +53,16 @@
4253
gap: 4px;
4354
opacity: 0;
4455
transition: opacity 0.2s;
56+
flex-shrink: 0;
57+
margin-left: 8px;
4558
}
4659

4760
.tree-node:hover .tree-node-actions {
4861
opacity: 1;
4962
}
5063

51-
.tree-node-folder {
52-
font-weight: 500;
53-
}
54-
55-
.tree-node-chat {
56-
font-weight: normal;
57-
}
58-
59-
/* Antd Tree customizations */
60-
.ant-tree .ant-tree-node-content-wrapper {
61-
padding: 0;
62-
}
63-
64-
.ant-tree .ant-tree-title {
65-
width: 100%;
66-
}
67-
68-
.ant-tree .ant-tree-node-selected {
69-
background-color: #e6f7ff !important;
70-
}
71-
72-
.ant-tree .ant-tree-node-selected .tree-node {
73-
background-color: #e6f7ff;
74-
}
75-
76-
77-
@keyframes pulse {
78-
0% {
79-
opacity: 1;
80-
}
81-
50% {
82-
opacity: 0.7;
83-
}
84-
100% {
85-
opacity: 1;
86-
}
87-
}
88-
89-
/* 拖拽相关样式 */
90-
.ant-tree-drag-over {
91-
background-color: #e6f7ff !important;
92-
}
93-
94-
.ant-tree-drag-over-gap-top {
95-
border-top: 2px solid #1890ff !important;
96-
}
97-
98-
.ant-tree-drag-over-gap-bottom {
99-
border-bottom: 2px solid #1890ff !important;
100-
}
101-
102-
.ant-tree-draggable-icon {
103-
color: #1890ff;
104-
cursor: grab;
105-
}
106-
107-
.ant-tree-draggable-icon:active {
108-
cursor: grabbing;
109-
}
110-
111-
.ant-tree .ant-tree-node-content-wrapper.ant-tree-node-selected {
112-
background-color: #e6f7ff;
113-
}
114-
115-
/* 拖拽时的ghost样式 */
116-
.ant-tree-drag-ghost {
117-
opacity: 0.5;
118-
background-color: #f0f0f0;
119-
border: 1px dashed #d9d9d9;
120-
border-radius: 4px;
121-
padding: 4px 8px;
122-
}
123-
124-
/* 拖拽提示样式 */
125-
.ant-tree-drop-indicator {
126-
height: 2px;
127-
background-color: #1890ff;
128-
position: absolute;
129-
left: 0;
130-
right: 0;
131-
z-index: 1;
64+
.tree-node-icon {
65+
display: flex;
66+
align-items: center;
67+
flex-shrink: 0;
13268
}

0 commit comments

Comments
 (0)