HypaV2 context deletion safety (#680)
# PR Checklist
- [x] Did you check if it works normally in all models? *ignore this
when it dosen't uses models*
- [] Did you check if it works normally in all of web, local and node
hosted versions? if it dosen't, did you blocked it in those versions? <<
Checked on browser only, works fine
- [x] Did you added a type def?
# Description
HypaV2 data's large type definition update.
```ts
mainChunks: { // summary itself
id: number;
text: string;
chatMemos: Set<string>; // UUIDs of summarized chats
lastChatMemo: string;
}[];
chunks: { // split mainChunks for retrieval or something. Although quite uncomfortable logic, so maybe I will delete it soon.
mainChunkID: number;
text:string;
}[];
```
With this, ensure that mainChunks is relevant on chat context change by
deletion
If there is no UUID in the chat context, but it exists on chatMemos on
certain mainChunk, removes it.
Changed index.svelte.ts to update args on each call to ensure hypav2 to
stay adaptive on this change without refreshing the page
Also changed mainChunks to be pushed instead of unshifted
This commit is contained in:
@@ -465,6 +465,7 @@
|
||||
}}>
|
||||
<PencilIcon size={20}/>
|
||||
</button>
|
||||
<!-- 이 버튼이 수정 버튼. edit() 함수를 주목할 것-->
|
||||
<button class="ml-2 hover:text-blue-500 transition-colors button-icon-remove" onclick={(e) => rm(e, false)} use:longpress={(e) => rm(e, true)}>
|
||||
<TrashIcon size={20}/>
|
||||
</button>
|
||||
|
||||
@@ -287,20 +287,14 @@
|
||||
</div>
|
||||
{#if generationInfoMenuIndex === 0}
|
||||
<div class="flex flex-col gap-2 w-full">
|
||||
{#each DBState.db.characters[$selectedCharID].chats[DBState.db.characters[$selectedCharID].chatPage].hypaV2Data.chunks as chunk}
|
||||
{#each DBState.db.characters[$selectedCharID].chats[DBState.db.characters[$selectedCharID].chatPage].hypaV2Data.chunks as chunk, i}
|
||||
<TextAreaInput bind:value={chunk.text} />
|
||||
{/each}
|
||||
|
||||
<Button onclick={() => {
|
||||
DBState.db.characters[$selectedCharID].chats[DBState.db.characters[$selectedCharID].chatPage].hypaV2Data.chunks.push({
|
||||
text: '',
|
||||
targetId: 'all'
|
||||
})
|
||||
DBState.db.characters[$selectedCharID].chats[DBState.db.characters[$selectedCharID].chatPage].hypaV2Data.chunks = DBState.db.characters[$selectedCharID].chats[DBState.db.characters[$selectedCharID].chatPage].hypaV2Data.chunks
|
||||
}}>+</Button>
|
||||
<!-- Adding non-bound chunk is not okay, change the user flow to edit existing ones. -->
|
||||
</div>
|
||||
{:else}
|
||||
{#each DBState.db.characters[$selectedCharID].chats[DBState.db.characters[$selectedCharID].chatPage].hypaV2Data.chunks as chunk, i}
|
||||
{#each DBState.db.characters[$selectedCharID].chats[DBState.db.characters[$selectedCharID].chatPage].hypaV2Data.mainChunks as chunk, i} <!-- Summarized should be mainChunks, afaik. Be aware of that chunks are created with mainChunks, however this editing would not change related chunks. -->
|
||||
<div class="flex flex-col p-2 rounded-md border-darkborderc border">
|
||||
{#if i === 0}
|
||||
<span class="text-green-500">Active</span>
|
||||
|
||||
Reference in New Issue
Block a user