diff --git a/src/pages/ChatPage.scss b/src/pages/ChatPage.scss
index a21cafb..0ee0d6c 100644
--- a/src/pages/ChatPage.scss
+++ b/src/pages/ChatPage.scss
@@ -4440,18 +4440,23 @@
// 折叠群入口样式
.session-item.fold-entry {
- background: var(--card-inner-bg, rgba(0,0,0,0.03));
+ cursor: pointer;
+ transition: background-color 0.2s;
+
+ &:hover {
+ background: var(--hover-bg, rgba(0,0,0,0.05));
+ }
.fold-entry-avatar {
width: 48px;
height: 48px;
border-radius: 8px;
- background: var(--primary-color, #07c160);
+ background: #fff;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
- color: #fff;
+ color: #fa9d3b;
}
.session-name {
diff --git a/src/pages/ChatPage.tsx b/src/pages/ChatPage.tsx
index 0eec7d4..40a311d 100644
--- a/src/pages/ChatPage.tsx
+++ b/src/pages/ChatPage.tsx
@@ -356,18 +356,19 @@ const SessionItem = React.memo(function SessionItem({
if (isFoldEntry) {
return (
onSelect(session)}
>
-
+
- 折叠的群聊
+ 折叠的聊天
+ {timeText}
- {session.summary || ''}
+ {session.summary || '暂无消息'}
@@ -2966,10 +2967,51 @@ function ChatPage(props: ChatPageProps) {
setFilteredSessions([])
return
}
- const visible = sessions.filter(s => {
+
+ // 检查是否有折叠的群聊
+ const foldedGroups = sessions.filter(s => s.isFolded && !s.username.toLowerCase().includes('placeholder_foldgroup'))
+ const hasFoldedGroups = foldedGroups.length > 0
+
+ let visible = sessions.filter(s => {
if (s.isFolded && !s.username.toLowerCase().includes('placeholder_foldgroup')) return false
return true
})
+
+ // 如果有折叠的群聊,但列表中没有入口,则插入入口
+ if (hasFoldedGroups && !visible.some(s => s.username.toLowerCase().includes('placeholder_foldgroup'))) {
+ // 找到最新的折叠消息
+ const latestFolded = foldedGroups.reduce((latest, current) => {
+ const latestTime = latest.sortTimestamp || latest.lastTimestamp || latest.timestamp
+ const currentTime = current.sortTimestamp || current.lastTimestamp || current.timestamp
+ return currentTime > latestTime ? current : latest
+ })
+
+ const foldEntry: ChatSession = {
+ username: 'placeholder_foldgroup',
+ displayName: '折叠的聊天',
+ summary: `${latestFolded.displayName || latestFolded.username}: ${latestFolded.summary}`,
+ timestamp: latestFolded.timestamp,
+ sortTimestamp: latestFolded.sortTimestamp || latestFolded.lastTimestamp || latestFolded.timestamp,
+ lastTimestamp: latestFolded.lastTimestamp || latestFolded.sortTimestamp || latestFolded.timestamp,
+ unreadCount: foldedGroups.reduce((sum, s) => sum + (s.unreadCount || 0), 0),
+ isMuted: false,
+ isFolded: false,
+ isGroup: true
+ }
+
+ // 按时间戳插入到正确位置
+ const foldTime = foldEntry.sortTimestamp || foldEntry.lastTimestamp || foldEntry.timestamp
+ const insertIndex = visible.findIndex(s => {
+ const sTime = s.sortTimestamp || s.lastTimestamp || s.timestamp
+ return sTime < foldTime
+ })
+ if (insertIndex === -1) {
+ visible.push(foldEntry)
+ } else {
+ visible.splice(insertIndex, 0, foldEntry)
+ }
+ }
+
if (!searchKeyword.trim()) {
setFilteredSessions(visible)
return