wip(app): i18n

This commit is contained in:
Adam
2026-01-20 10:43:43 -06:00
parent be493e8be0
commit 0f2e8ea2b4
15 changed files with 110 additions and 89 deletions

View File

@@ -53,10 +53,11 @@ function textPartValue(parts: Part[]) {
* Extract prompt content from message parts for restoring into the prompt input.
* This is used by undo to restore the original user prompt.
*/
export function extractPromptFromParts(parts: Part[], opts?: { directory?: string }): Prompt {
export function extractPromptFromParts(parts: Part[], opts?: { directory?: string; attachmentName?: string }): Prompt {
const textPart = textPartValue(parts)
const text = textPart?.text ?? ""
const directory = opts?.directory
const attachmentName = opts?.attachmentName ?? "attachment"
const toRelative = (path: string) => {
if (!directory) return path
@@ -104,7 +105,7 @@ export function extractPromptFromParts(parts: Part[], opts?: { directory?: strin
images.push({
type: "image",
id: filePart.id,
filename: filePart.filename ?? "attachment",
filename: filePart.filename ?? attachmentName,
mime: filePart.mime,
dataUrl: filePart.url,
})