feat: Chat Folder (#766)

# PR Checklist
- [x] Have you checked if it works normally in all models? *Ignore this
if it doesn't use models.*
- [x] Have you checked if it works normally in all web, local, and node
hosted versions? If it doesn't, have you blocked it in those versions?
- [x] Have you added type definitions?

# Description

<img width="369" alt="스크린샷 2025-02-19 오후 5 11 42"
src="https://github.com/user-attachments/assets/f6819d88-e417-47d4-9f69-888e9aab21f7"
/>
<img width="369" alt="스크린샷 2025-02-19 오후 5 11 54"
src="https://github.com/user-attachments/assets/b867f97e-f9bb-4964-ba9e-a34171e79ffe"
/>

이 PR은 챗을 분류하는 폴더를 추가합니다. 폴더에는 색상을 넣을 수 있습니다.

This PR adds a folder to categorize chats. Folders can be colored. I'm
open to any feedback or suggestions.
This commit is contained in:
kwaroran
2025-03-05 05:37:42 +09:00
committed by GitHub
4 changed files with 439 additions and 147 deletions

View File

@@ -32,7 +32,9 @@ export function createNewGroup(){
note: '',
name: 'Chat 1',
localLore: []
}], chatPage: 0,
}],
chatFolders: [],
chatPage: 0,
viewScreen: 'none',
globalLore: [],
characters: [],
@@ -402,6 +404,11 @@ export async function importChat(){
return
}
if(db.characters[selectedID].chatFolders
.filter(folder => folder.id === newChat.folderId).length === 0) {
newChat.folderId = null
}
db.characters[selectedID].chats.unshift(newChat)
setDatabase(db)
alertNormal(language.successImport)
@@ -585,6 +592,7 @@ export function createBlankChar():character{
name: 'Chat 1',
localLore: []
}],
chatFolders: [],
chatPage: 0,
emotionImages: [],
bias: [],

View File

@@ -979,6 +979,7 @@ export interface character{
desc:string
notes:string
chats:Chat[]
chatFolders: ChatFolder[]
chatPage: number
viewScreen: 'emotion'|'none'|'imggen'|'vn',
bias: [string, number][]
@@ -1117,6 +1118,7 @@ export interface groupChat{
image?:string
firstMessage:string
chats:Chat[]
chatFolders: ChatFolder[]
chatPage: number
name:string
viewScreen: 'single'|'multiple'|'none'|'emp',
@@ -1324,6 +1326,14 @@ export interface Chat{
bindedPersona?:string
fmIndex?:number
hypaV3Data?:SerializableHypaV3Data
folderId?:string
}
export interface ChatFolder{
id:string
name?:string
color?:string
folded:boolean
}
export interface Message{

View File

@@ -1015,4 +1015,7 @@ export const sortableOptions = {
delay: 300, // time in milliseconds to define when the sorting should start
delayOnTouchOnly: true,
filter: '.no-sort',
onMove: (event) => {
return event.related.className.indexOf('no-sort') === -1
}
} as const