feat(core): render session title in ai session history (#13147)
Close [AI-331](https://linear.app/affine-design/issue/AI-331) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Improvements** * Session history now displays the session title (or "New chat" if unavailable) instead of the session ID for a clearer user experience. * **Performance** * Recent copilot chat session lists now load faster by excluding message details from the initial query. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
@@ -11,7 +11,7 @@ query getCopilotRecentSessions(
|
|||||||
options: {
|
options: {
|
||||||
fork: false
|
fork: false
|
||||||
sessionOrder: desc
|
sessionOrder: desc
|
||||||
withMessages: true
|
withMessages: false
|
||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
...PaginatedCopilotChats
|
...PaginatedCopilotChats
|
||||||
|
|||||||
@@ -1073,7 +1073,7 @@ export const getCopilotRecentSessionsQuery = {
|
|||||||
copilot(workspaceId: $workspaceId) {
|
copilot(workspaceId: $workspaceId) {
|
||||||
chats(
|
chats(
|
||||||
pagination: {first: $limit}
|
pagination: {first: $limit}
|
||||||
options: {fork: false, sessionOrder: desc, withMessages: true}
|
options: {fork: false, sessionOrder: desc, withMessages: false}
|
||||||
) {
|
) {
|
||||||
...PaginatedCopilotChats
|
...PaginatedCopilotChats
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -225,7 +225,7 @@ export class AISessionHistory extends WithDisposable(ShadowlessElement) {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<div class="ai-session-title">
|
<div class="ai-session-title">
|
||||||
${session.sessionId}
|
${session.title || 'New chat'}
|
||||||
<affine-tooltip .offsetX=${60}>
|
<affine-tooltip .offsetX=${60}>
|
||||||
Click to open this chat
|
Click to open this chat
|
||||||
</affine-tooltip>
|
</affine-tooltip>
|
||||||
|
|||||||
Reference in New Issue
Block a user