feat: improve HypaV3 (#727)

# 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
- fix: handle null case for firstMessage in HypaV3 modal
- fix: resolve mobile dual-action translation in HypaV3 modal
  - Implements shift+click (desktop) and double tap (mobile) for
regenerating translations while maintaining regular click/tap for cached
translations.
- feat: add auto-scroll to translations in HypaV3 modal
- feat: add settings button to HypaV3 modal header
- feat: add cut-after button in HypaV3 summary header
- feat: add HypaV2 to V3 conversion in HypaV3 modal
- feat: add process regex script option in HypaV3 modal
  - when enabled, reroll function will process regex script.
- fix: improve HypaV3 modal responsive for mobile
- feat: add search button in HypaV3 modal
This commit is contained in:
kwaroran
2025-01-26 22:44:06 +09:00
committed by GitHub
4 changed files with 807 additions and 261 deletions

View File

@@ -317,8 +317,6 @@
</div>
{/each}
{/if}
{:else if $alertStore.type === "hypaV3"}
<HypaV3Modal />
{:else if $alertStore.type === 'addchar'}
<div class="w-2xl flex flex-col max-w-full">
@@ -639,6 +637,10 @@
</div>
{/if}
{#if $alertStore.type === "hypaV3"}
<HypaV3Modal />
{/if}
<style>
.break-any{
word-break: normal;

File diff suppressed because it is too large Load Diff

View File

@@ -491,7 +491,6 @@
<span class="text-textcolor mt-4">{language.SuperMemory} {language.model}</span>
<SelectInput className="mt-2 mb-2" bind:value={DBState.db.supaModelType}>
<OptionInput value="distilbart">distilbart-cnn-6-6 (Free/Local)</OptionInput>
<OptionInput value="instruct35">OpenAI 3.5 Turbo Instruct</OptionInput>
<OptionInput value="subModel">{language.submodel}</OptionInput>
</SelectInput>
{#if DBState.db.supaModelType === "instruct35"}
@@ -520,6 +519,9 @@
<div class="flex mb-2">
<Check name="Preserve Orphaned Memory" bind:check={DBState.db.hypaV3Settings.preserveOrphanedMemory} />
</div>
<div class="flex mb-2">
<Check name="Process Regex Script (Reroll Only)" bind:check={DBState.db.hypaV3Settings.processRegexScript} />
</div>
{:else if (DBState.db.supaModelType !== 'none' && DBState.db.hypav2 === false && DBState.db.hypaV3 === false)}
<span class="mb-2 text-textcolor2 text-sm text-wrap break-words max-w-full">{language.supaDesc}</span>
<span class="text-textcolor mt-4">{language.SuperMemory} {language.model}</span>

View File

@@ -477,7 +477,8 @@ export function setDatabase(data:Database){
recentMemoryRatio: data.hypaV3Settings?.recentMemoryRatio ?? 0.4,
similarMemoryRatio: data.hypaV3Settings?.similarMemoryRatio ?? 0.4,
enableSimilarityCorrection: data.hypaV3Settings?.enableSimilarityCorrection ?? false,
preserveOrphanedMemory: data.hypaV3Settings?.preserveOrphanedMemory ?? false
preserveOrphanedMemory: data.hypaV3Settings?.preserveOrphanedMemory ?? false,
processRegexScript: data.hypaV3Settings?.processRegexScript ?? false
}
changeLanguage(data.language)
setDatabaseLite(data)
@@ -890,6 +891,7 @@ export interface Database{
similarMemoryRatio: number
enableSimilarityCorrection: boolean
preserveOrphanedMemory: boolean
processRegexScript: boolean
}
}