diff --git a/packages/app/src/runtime/i18n/en.ts b/packages/app/src/runtime/i18n/en.ts index 608c7092c71..4b19a15fca1 100644 --- a/packages/app/src/runtime/i18n/en.ts +++ b/packages/app/src/runtime/i18n/en.ts @@ -768,7 +768,8 @@ export const dict = { "session.queue.steerTooltip": "Send without interrupting", "session.queue.remove": "Remove", "session.queue.reorder": "Reorder queued prompt", - "session.queue.attachments": "+ attachments", + "session.queue.attachments.one": "Plus {{count}} attachment", + "session.queue.attachments.other": "Plus {{count}} attachments", "session.timeline.working": "Working", "session.timeline.notice.finished": "{{actor}} finished", "session.timeline.notice.failed": "{{actor}} failed", diff --git a/packages/app/src/session/composer/queue-panel.tsx b/packages/app/src/session/composer/queue-panel.tsx index cfc4362ff62..ac23f8ecc38 100644 --- a/packages/app/src/session/composer/queue-panel.tsx +++ b/packages/app/src/session/composer/queue-panel.tsx @@ -23,10 +23,12 @@ export function SessionQueuePanel(props: { queue: SessionQueueView }) { 0}>
4, "pb-[18px]": count() <= 4 }} > 3}> -
+
{language.plural("session.queue.count", count())}
@@ -58,10 +60,17 @@ export function SessionQueuePanel(props: { queue: SessionQueueView }) { > {/* Keyed on row IDs so store updates move row elements instead of remounting them, which would kill an in-flight drag. */} + {/* Four 32px rows, four 1px gaps, and half a row hint at more queued prompts. */}
3 }} + classList={{ "max-h-[148px] overflow-y-auto": count() > 4 }} + style={{ + "mask-image": + count() > 4 + ? "linear-gradient(to bottom, transparent, black 8px, black calc(100% - 12px), transparent)" + : undefined, + }} > row.id)}> {(id, index) => } @@ -98,7 +107,7 @@ function SessionQueueRow(props: { queue: SessionQueueView; id: string; index: nu
} -
+
- - {language.t("session.queue.attachments")} + + {language.plural("session.queue.attachments", entry.attachments)}
diff --git a/packages/app/src/session/composer/queue.test.ts b/packages/app/src/session/composer/queue.test.ts index c28d386a532..5f6f2a20cf1 100644 --- a/packages/app/src/session/composer/queue.test.ts +++ b/packages/app/src/session/composer/queue.test.ts @@ -24,20 +24,20 @@ const queued = [ describe("queuedPromptRows", () => { test("keeps the edited prompt to one row while its replacement is admitted", () => { expect(queuedPromptRows(queued, { original: "msg_original", replacement: "msg_replacement" })).toEqual([ - { id: "msg_replacement", text: "edited", attachments: false }, + { id: "msg_replacement", text: "edited", attachments: 0 }, ]) }) test("keeps the original visible until its replacement appears", () => { expect(queuedPromptRows([queued[0]], { original: "msg_original", replacement: "msg_replacement" })).toEqual([ - { id: "msg_original", text: "original", attachments: false }, + { id: "msg_original", text: "original", attachments: 0 }, ]) }) test("retains unrelated queue entries", () => { expect(queuedPromptRows(queued)).toEqual([ - { id: "msg_original", text: "original", attachments: false }, - { id: "msg_replacement", text: "edited", attachments: false }, + { id: "msg_original", text: "original", attachments: 0 }, + { id: "msg_replacement", text: "edited", attachments: 0 }, ]) }) @@ -47,8 +47,8 @@ describe("queuedPromptRows", () => { expect( queuedPromptRows([queued[0], other, queued[1]], { original: "msg_original", replacement: "msg_replacement" }), ).toEqual([ - { id: "msg_other", text: "other", attachments: false }, - { id: "msg_replacement", text: "edited", attachments: false }, + { id: "msg_other", text: "other", attachments: 0 }, + { id: "msg_replacement", text: "edited", attachments: 0 }, ]) }) }) diff --git a/packages/app/src/session/composer/queue.ts b/packages/app/src/session/composer/queue.ts index 07a01036d88..540779cc943 100644 --- a/packages/app/src/session/composer/queue.ts +++ b/packages/app/src/session/composer/queue.ts @@ -237,7 +237,7 @@ export function queuedPromptRows(items: QueuedPrompt[], replacement?: { original .map((item) => ({ id: item.id, text: queuedPromptText(item), - attachments: (item.payload.files?.length ?? 0) > 0, + attachments: item.payload.files?.length ?? 0, })) }