GeezerVison is showing github.com — fix(web): a full prompt stash no longer discards your oldest prompt (… · patroza/t3code@e75534b
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: apps/web/src/components/chat/useComposerStash.ts +16-24Lines changed: 16 additions & 24 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -603,7 +603,7 @@ export function useComposerStash(input: { | 603 | 603 | // crash or closed tab mid-encode still leaves the prompt recoverable, | 604 | 604 | // while clearing before the async image work means edits typed during | 605 | 605 | // encoding are not wiped. | 606 | | - const { evicted, written, durable } = stashEntryToQueue({ | | 606 | + const { full, written, durable } = stashEntryToQueue({ | 607 | 607 | id: entryId, | 608 | 608 | createdAt: new Date().toISOString(), | 609 | 609 | prompt, | @@ -615,9 +615,21 @@ export function useComposerStash(input: { | 615 | 615 | ...(stashedRecords.length > 0 ? { records: stashedRecords } : {}), | 616 | 616 | }); | 617 | 617 |
| 618 | | - // If it was rejected (quota) the store has already rolled itself back, | 619 | | - // so leave the composer untouched rather than making it the second | 620 | | - // casualty of a reload. | | 618 | + // A full or rejected write kept nothing, so leave the composer untouched. | | 619 | + if (full) { | | 620 | + toastManager.add({ | | 621 | + type: "warning", | | 622 | + title: m(msg("Stash is full")), | | 623 | + description: m( | | 624 | + msg( | | 625 | + "The stash holds {max} prompts. Restore or delete one to make room; the composer was left as-is.", | | 626 | + { max: MAX_STASH_ENTRIES }, | | 627 | + ), | | 628 | + ), | | 629 | + data: { hideCopyButton: true }, | | 630 | + }); | | 631 | + return; | | 632 | + } | 621 | 633 | if (!written) { | 622 | 634 | toastManager.add({ | 623 | 635 | type: "error", | @@ -665,26 +677,6 @@ export function useComposerStash(input: { | 665 | 677 | setComposerTrigger(null); | 666 | 678 | pulseStashBadge(); | 667 | 679 |
| 668 | | - if (evicted) { | 669 | | - for (const file of evicted.files ?? []) { | 670 | | - releasePersistedAttachmentUpload({ | 671 | | - id: file.id, | 672 | | - environmentId: file.environmentId, | 673 | | - attachmentId: file.attachmentId, | 674 | | - }); | 675 | | - } | 676 | | - toastManager.add({ | 677 | | - type: "warning", | 678 | | - title: m(msg("Oldest stashed prompt discarded")), | 679 | | - description: m( | 680 | | - msg("The stash holds {max} prompts; the oldest was removed to make room.", { | 681 | | - max: MAX_STASH_ENTRIES, | 682 | | - }), | 683 | | - ), | 684 | | - data: { hideCopyButton: true }, | 685 | | - }); | 686 | | - } | 687 | | - | 688 | 680 | // Images are re-encoded for the stash rather than stored verbatim: the | 689 | 681 | // composer allows up to 10MB per image, but localStorage gives the whole | 690 | 682 | // origin ~5MB. | |
Collapse file Copy file name to clipboardExpand all lines: apps/web/src/i18n/translations/de.json +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 4939 | 4939 | "3f5c37167aa5034f": "Der Browserspeicher hat das Schreiben abgelehnt, daher wurde das Eingabefeld unverändert gelassen. Gib Websitedaten frei und versuche es erneut.", | 4940 | 4940 | "41ba6c0b5c5e8b22": "Abgelegter Prompt übersteht kein Neuladen", | 4941 | 4941 | "94d7f150b3f7b291": "Der Browserspeicher ist nicht verfügbar, daher wird diese Ablage nur für diese Sitzung im Arbeitsspeicher gehalten.", | 4942 | | - "f421c24666cd8c71": "Ältester abgelegter Prompt verworfen", | 4943 | | - "1123f816ea2a6e3e": "Die Ablage fasst {max} Prompts; der älteste wurde entfernt, um Platz zu schaffen.", | 4944 | 4942 | "c3a8f9b1b2e7d588": "Abgelegte Bilder wurden nicht gespeichert", | 4945 | 4943 | "fc3feba263971bce": "Der Prompt wurde abgelegt, aber der Browserspeicher hat seine Bilder abgelehnt. Sie fehlen, wenn du neu lädst.", | 4946 | 4944 | "9e36559d0fa0cca8": "Abgelegte Bilder wurden nicht angehängt", | | 12990 | 12988 | "99451a5d2d40440f": "Zurückgezogen von {by}.", | 12991 | 12989 | "3ee30a50b70fffab": "Zurückgezogen von {by}: {reason}", | 12992 | 12990 | "92e129bf413a1220": "zurückgezogen", | 12993 | | - "800966eb58181745": "Prüfe, welche Sprachen das Modell unterstützt…" | | 12991 | + "800966eb58181745": "Prüfe, welche Sprachen das Modell unterstützt…", | | 12992 | + "410dded6e21c280d": "Ablage ist voll", | | 12993 | + "1af8d12ac21cb183": "Die Ablage fasst {max} Prompts. Stelle einen wieder her oder lösche einen, um Platz zu schaffen; das Eingabefeld wurde unverändert gelassen." | 12994 | 12994 | } |
Collapse file Copy file name to clipboardExpand all lines: apps/web/src/i18n/translations/en.json +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 4938 | 4938 | "3f5c37167aa5034f": "Browser storage rejected the write, so the composer was left as-is. Free up site data and try again.", | 4939 | 4939 | "41ba6c0b5c5e8b22": "Stashed prompt will not survive a reload", | 4940 | 4940 | "94d7f150b3f7b291": "Browser storage is unavailable, so this stash is kept in memory only for this session.", | 4941 | | - "f421c24666cd8c71": "Oldest stashed prompt discarded", | 4942 | | - "1123f816ea2a6e3e": "The stash holds {max} prompts; the oldest was removed to make room.", | 4943 | 4941 | "c3a8f9b1b2e7d588": "Stashed images were not saved", | 4944 | 4942 | "fc3feba263971bce": "The prompt was stashed, but browser storage rejected its images. They will be missing if you reload.", | 4945 | 4943 | "9e36559d0fa0cca8": "Stashed images did not attach", | | 12999 | 12997 | "99451a5d2d40440f": "Withdrawn by {by}.", | 13000 | 12998 | "3ee30a50b70fffab": "Withdrawn by {by}: {reason}", | 13001 | 12999 | "92e129bf413a1220": "withdrawn", | 13002 | | - "800966eb58181745": "Checking which languages the model supports…" | | 13000 | + "800966eb58181745": "Checking which languages the model supports…", | | 13001 | + "410dded6e21c280d": "Stash is full", | | 13002 | + "1af8d12ac21cb183": "The stash holds {max} prompts. Restore or delete one to make room; the composer was left as-is." | 13003 | 13003 | } |
Collapse file Copy file name to clipboardExpand all lines: apps/web/src/i18n/translations/es.json +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 4936 | 4936 | "3f5c37167aa5034f": "El almacenamiento del navegador rechazó la escritura, así que el cuadro de mensaje se quedó como estaba. Libera datos del sitio y vuelve a intentarlo.", | 4937 | 4937 | "41ba6c0b5c5e8b22": "El prompt del stash no sobrevivirá a una recarga", | 4938 | 4938 | "94d7f150b3f7b291": "El almacenamiento del navegador no está disponible, así que este stash solo se guarda en memoria durante esta sesión.", | 4939 | | - "f421c24666cd8c71": "Se descartó el prompt más antiguo del stash", | 4940 | | - "1123f816ea2a6e3e": "El stash admite {max} prompts; se quitó el más antiguo para hacer sitio.", | 4941 | 4939 | "c3a8f9b1b2e7d588": "Las imágenes del stash no se guardaron", | 4942 | 4940 | "fc3feba263971bce": "El prompt se guardó en el stash, pero el almacenamiento del navegador rechazó sus imágenes. Faltarán si recargas.", | 4943 | 4941 | "9e36559d0fa0cca8": "Las imágenes del stash no se adjuntaron", | | 12985 | 12983 | "99451a5d2d40440f": "Retirada por {by}.", | 12986 | 12984 | "3ee30a50b70fffab": "Retirada por {by}: {reason}", | 12987 | 12985 | "92e129bf413a1220": "retirada", | 12988 | | - "800966eb58181745": "Comprobando qué idiomas admite el modelo…" | | 12986 | + "800966eb58181745": "Comprobando qué idiomas admite el modelo…", | | 12987 | + "410dded6e21c280d": "El stash está lleno", | | 12988 | + "1af8d12ac21cb183": "El stash admite {max} prompts. Restaura o elimina uno para hacer sitio; el campo de texto se dejó como estaba." | 12989 | 12989 | } |
Collapse file Copy file name to clipboardExpand all lines: apps/web/src/i18n/translations/fr.json +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 4937 | 4937 | "3f5c37167aa5034f": "Le stockage du navigateur a refusé l’écriture ; la zone de saisie a donc été laissée telle quelle. Libérez des données de site et réessayez.", | 4938 | 4938 | "41ba6c0b5c5e8b22": "Le prompt mis de côté ne survivra pas à un rechargement", | 4939 | 4939 | "94d7f150b3f7b291": "Le stockage du navigateur est indisponible ; cette réserve est donc gardée en mémoire pour cette session uniquement.", | 4940 | | - "f421c24666cd8c71": "Le plus ancien prompt mis de côté a été supprimé", | 4941 | | - "1123f816ea2a6e3e": "La réserve contient {max} prompts ; le plus ancien a été supprimé pour faire de la place.", | 4942 | 4940 | "c3a8f9b1b2e7d588": "Les images mises de côté n’ont pas été enregistrées", | 4943 | 4941 | "fc3feba263971bce": "Le prompt a été mis de côté, mais le stockage du navigateur a refusé ses images. Elles manqueront si vous rechargez.", | 4944 | 4942 | "9e36559d0fa0cca8": "Les images mises de côté n’ont pas été jointes", | | 12990 | 12988 | "99451a5d2d40440f": "Retirée par {by}.", | 12991 | 12989 | "3ee30a50b70fffab": "Retirée par {by} : {reason}", | 12992 | 12990 | "92e129bf413a1220": "retirée", | 12993 | | - "800966eb58181745": "Vérification des langues prises en charge par le modèle…" | | 12991 | + "800966eb58181745": "Vérification des langues prises en charge par le modèle…", | | 12992 | + "410dded6e21c280d": "La réserve est pleine", | | 12993 | + "1af8d12ac21cb183": "La réserve contient {max} prompts. Restaurez-en ou supprimez-en un pour faire de la place ; la zone de saisie a été laissée telle quelle." | 12994 | 12994 | } |
Collapse file Copy file name to clipboardExpand all lines: apps/web/src/i18n/translations/ja.json +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 4925 | 4925 | "3f5c37167aa5034f": "ブラウザーのストレージが書き込みを拒否したため、入力欄はそのままです。サイトのデータを空けて、もう一度お試しください。", | 4926 | 4926 | "41ba6c0b5c5e8b22": "退避したプロンプトは再読み込みすると失われます", | 4927 | 4927 | "94d7f150b3f7b291": "ブラウザーのストレージを利用できないため、この退避はこのセッションの間だけメモリに保持されます。", | 4928 | | - "f421c24666cd8c71": "最も古い退避したプロンプトを破棄しました", | 4929 | | - "1123f816ea2a6e3e": "退避できるプロンプトは {max} 件までです。空きを作るため、最も古いものを削除しました。", | 4930 | 4928 | "c3a8f9b1b2e7d588": "退避した画像は保存されませんでした", | 4931 | 4929 | "fc3feba263971bce": "プロンプトは退避されましたが、ブラウザーのストレージが画像を拒否しました。再読み込みすると画像は失われます。", | 4932 | 4930 | "9e36559d0fa0cca8": "退避した画像は添付されませんでした", | | 12926 | 12924 | "99451a5d2d40440f": "{by} が取り下げました。", | 12927 | 12925 | "3ee30a50b70fffab": "{by} が取り下げました: {reason}", | 12928 | 12926 | "92e129bf413a1220": "取り下げ済み", | 12929 | | - "800966eb58181745": "モデルが対応している言語を確認しています…" | | 12927 | + "800966eb58181745": "モデルが対応している言語を確認しています…", | | 12928 | + "410dded6e21c280d": "退避がいっぱいです", | | 12929 | + "1af8d12ac21cb183": "退避できるプロンプトは {max} 件までです。空きを作るには、どれかを復元するか削除してください。入力欄はそのままにしてあります。" | 12930 | 12930 | } |
Collapse file Copy file name to clipboardExpand all lines: apps/web/src/i18n/translations/ko.json +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 4922 | 4922 | "3f5c37167aa5034f": "브라우저 저장소가 쓰기를 거부해서 입력창을 그대로 두었습니다. 사이트 데이터를 정리한 후 다시 시도하세요.", | 4923 | 4923 | "41ba6c0b5c5e8b22": "임시 저장한 프롬프트는 새로 고치면 사라집니다", | 4924 | 4924 | "94d7f150b3f7b291": "브라우저 저장소를 사용할 수 없어 이 임시 저장함은 이번 세션 동안 메모리에만 유지됩니다.", | 4925 | | - "f421c24666cd8c71": "가장 오래된 임시 저장 프롬프트 삭제됨", | 4926 | | - "1123f816ea2a6e3e": "임시 저장함에는 프롬프트를 {max}개까지 저장할 수 있어 가장 오래된 항목을 삭제했습니다.", | 4927 | 4925 | "c3a8f9b1b2e7d588": "임시 저장한 이미지가 저장되지 않았습니다", | 4928 | 4926 | "fc3feba263971bce": "프롬프트는 임시 저장되었지만 브라우저 저장소가 이미지를 거부했습니다. 새로 고치면 이미지가 사라집니다.", | 4929 | 4927 | "9e36559d0fa0cca8": "임시 저장한 이미지가 첨부되지 않았습니다", | | 12923 | 12921 | "99451a5d2d40440f": "{by}에서 철회했습니다.", | 12924 | 12922 | "3ee30a50b70fffab": "{by}에서 철회했습니다: {reason}", | 12925 | 12923 | "92e129bf413a1220": "철회됨", | 12926 | | - "800966eb58181745": "모델이 지원하는 언어를 확인하는 중…" | | 12924 | + "800966eb58181745": "모델이 지원하는 언어를 확인하는 중…", | | 12925 | + "410dded6e21c280d": "임시 저장함이 가득 찼습니다", | | 12926 | + "1af8d12ac21cb183": "임시 저장함에는 프롬프트를 {max}개까지 저장할 수 있습니다. 공간을 만들려면 하나를 복원하거나 삭제하세요. 입력란은 그대로 두었습니다." | 12927 | 12927 | } |
Collapse file Copy file name to clipboardExpand all lines: apps/web/src/i18n/translations/pt-BR.json +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 4936 | 4936 | "3f5c37167aa5034f": "O armazenamento do navegador rejeitou a gravação, então o editor de mensagens ficou como estava. Libere dados do site e tente novamente.", | 4937 | 4937 | "41ba6c0b5c5e8b22": "O prompt guardado não vai sobreviver a uma recarga", | 4938 | 4938 | "94d7f150b3f7b291": "O armazenamento do navegador não está disponível, então estes guardados ficam só na memória durante esta sessão.", | 4939 | | - "f421c24666cd8c71": "Prompt guardado mais antigo descartado", | 4940 | | - "1123f816ea2a6e3e": "Os guardados comportam {max} prompts; o mais antigo foi removido para abrir espaço.", | 4941 | 4939 | "c3a8f9b1b2e7d588": "As imagens guardadas não foram salvas", | 4942 | 4940 | "fc3feba263971bce": "O prompt foi guardado, mas o armazenamento do navegador rejeitou as imagens. Elas vão faltar se você recarregar.", | 4943 | 4941 | "9e36559d0fa0cca8": "As imagens guardadas não foram anexadas", | | 12990 | 12988 | "99451a5d2d40440f": "Retirada por {by}.", | 12991 | 12989 | "3ee30a50b70fffab": "Retirada por {by}: {reason}", | 12992 | 12990 | "92e129bf413a1220": "retirada", | 12993 | | - "800966eb58181745": "Verificando quais idiomas o modelo suporta…" | | 12991 | + "800966eb58181745": "Verificando quais idiomas o modelo suporta…", | | 12992 | + "410dded6e21c280d": "Os guardados estão cheios", | | 12993 | + "1af8d12ac21cb183": "Os guardados comportam {max} prompts. Restaure ou exclua um para abrir espaço; o campo de texto ficou como estava." | 12994 | 12994 | } |
Collapse file Copy file name to clipboardExpand all lines: apps/web/src/i18n/translations/ru.json +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 4936 | 4936 | "3f5c37167aa5034f": "Хранилище браузера отклонило запись, поэтому поле ввода не изменилось. Освободите данные сайта и повторите попытку.", | 4937 | 4937 | "41ba6c0b5c5e8b22": "Спрятанный промпт не сохранится после перезагрузки", | 4938 | 4938 | "94d7f150b3f7b291": "Хранилище браузера недоступно, поэтому тайник хранится в памяти только в этом сеансе.", | 4939 | | - "f421c24666cd8c71": "Самый старый спрятанный промпт удалён", | 4940 | | - "1123f816ea2a6e3e": "В тайнике помещается промптов: {max}; самый старый удалён, чтобы освободить место.", | 4941 | 4939 | "c3a8f9b1b2e7d588": "Спрятанные изображения не сохранены", | 4942 | 4940 | "fc3feba263971bce": "Промпт спрятан, но хранилище браузера отклонило его изображения. После перезагрузки их не будет.", | 4943 | 4941 | "9e36559d0fa0cca8": "Спрятанные изображения не прикрепились", | | 12990 | 12988 | "99451a5d2d40440f": "Отозван: {by}.", | 12991 | 12989 | "3ee30a50b70fffab": "Отозван ({by}): {reason}", | 12992 | 12990 | "92e129bf413a1220": "отозван", | 12993 | | - "800966eb58181745": "Проверяем, какие языки поддерживает модель…" | | 12991 | + "800966eb58181745": "Проверяем, какие языки поддерживает модель…", | | 12992 | + "410dded6e21c280d": "Тайник заполнен", | | 12993 | + "1af8d12ac21cb183": "В тайнике помещается промптов: {max}. Восстановите или удалите один, чтобы освободить место; поле ввода осталось без изменений." | 12994 | 12994 | } |
Collapse file Copy file name to clipboardExpand all lines: apps/web/src/i18n/translations/sv.json +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 4937 | 4937 | "3f5c37167aa5034f": "Webbläsarens lagring avvisade skrivningen, så inmatningsfältet lämnades som det var. Frigör webbplatsdata och försök igen.", | 4938 | 4938 | "41ba6c0b5c5e8b22": "Den undanlagda prompten överlever inte en omladdning", | 4939 | 4939 | "94d7f150b3f7b291": "Webbläsarens lagring är inte tillgänglig, så undanlagda promptar finns bara i minnet under den här sessionen.", | 4940 | | - "f421c24666cd8c71": "Den äldsta undanlagda prompten kastades", | 4941 | | - "1123f816ea2a6e3e": "Du kan lägga undan högst {max} promptar; den äldsta togs bort för att göra plats.", | 4942 | 4940 | "c3a8f9b1b2e7d588": "Undanlagda bilder sparades inte", | 4943 | 4941 | "fc3feba263971bce": "Prompten lades undan, men webbläsarens lagring avvisade dess bilder. De saknas om du laddar om.", | 4944 | 4942 | "9e36559d0fa0cca8": "Undanlagda bilder bifogades inte", | | 12997 | 12995 | "99451a5d2d40440f": "Återkallad av {by}.", | 12998 | 12996 | "3ee30a50b70fffab": "Återkallad av {by}: {reason}", | 12999 | 12997 | "92e129bf413a1220": "återkallad", | 13000 | | - "800966eb58181745": "Kontrollerar vilka språk modellen stöder…" | | 12998 | + "800966eb58181745": "Kontrollerar vilka språk modellen stöder…", | | 12999 | + "410dded6e21c280d": "Undanlagringen är full", | | 13000 | + "1af8d12ac21cb183": "Du kan lägga undan högst {max} promptar. Återställ eller ta bort en för att göra plats; inmatningsfältet lämnades som det var." | 13001 | 13001 | } |
|