feat: add validation

Also revoked potentially problematic feature(add hypav2data chunk)
TODO:
1. On mid-context editing, currently that is not considered as deletion. Do have optional editedChatIndex to latter dive in more.
2. re-roll mainChunks(re-summarization) functionalities added, but not able to access it.
This commit is contained in:
LightningHyperBlaze45654
2024-12-01 13:00:00 -08:00
parent 835664a7aa
commit 60d4e33893
4 changed files with 230 additions and 142 deletions

View File

@@ -291,16 +291,10 @@
<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 -> mainChunks
<div class="flex flex-col p-2 rounded-md border-darkborderc border">
{#if i === 0}
<span class="text-green-500">Active</span>