Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.
fix(web-app): keep Continue visible on a stopped reply
James Dam3a0b47bcdceb
diff --git a/web-app/src/containers/MessageItem.tsx b/web-app/src/containers/MessageItem.tsxindex 94ec9cc53..44208f261 100644--- a/web-app/src/containers/MessageItem.tsx+++ b/web-app/src/containers/MessageItem.tsx@@ -772,6 +772,24 @@ export const MessageItem = memo()}>{copyButton}+ {/* Shown at rest: it only appears on a stopped reply, and it is+ the one way to resume it. */}+ {selectedModel &&+ onContinue &&+ !isStreaming &&+ isLastMessage &&+ canContinue && (+ <Button+ variant="ghost"+ size="icon-xs"+ data-testid="continue-message"+ onClick={handleContinue}+ title={t('chat:actions.continue')}+ aria-label={t('chat:actions.continue')}+ >+ <IconPlayerPlay size={16} aria-hidden="true" />+ </Button>+ )}{/* Shown at rest when there are versions (copy is then showntoo, so the pair sits at the leading edge together). */}{versionNav}@@ -789,22 +807,6 @@ export const MessageItem = memo(<DeleteMessageDialog onDelete={handleDelete} />)}- {selectedModel &&- onContinue &&- !isStreaming &&- isLastMessage &&- canContinue && (- <Button- variant="ghost"- size="icon-xs"- data-testid="continue-message"- onClick={handleContinue}- title={t('chat:actions.continue')}- >- <IconPlayerPlay size={16} />- </Button>- )}-{selectedModel &&onRegenerate &&!isStreaming &&diff --git a/web-app/src/containers/__tests__/MessageItem.test.tsx b/web-app/src/containers/__tests__/MessageItem.test.tsxindex 25b5e2886..d4a865bd8 100644--- a/web-app/src/containers/__tests__/MessageItem.test.tsx+++ b/web-app/src/containers/__tests__/MessageItem.test.tsx@@ -878,6 +878,25 @@ describe('MessageItem', () => {expect(prev.closest('[class*="opacity-0"]')).toBeNull()})+ it('keeps Continue visible at rest on a stopped reply', () => {+ render(+ <MessageItem+ message={makeMsg({ metadata: { createdAt: new Date(), stopped: true } }) as any}+ isFirstMessage+ isLastMessage+ status={'ready' as any}+ onContinue={vi.fn()}+ onRegenerate={vi.fn()}+ />+ )+ // The only way to resume a stopped reply is not hidden behind hover...+ const cont = screen.getByTestId('continue-message')+ expect(cont.closest('[class*="opacity-0"]')).toBeNull()+ // ...while regenerate stays with the other hover-revealed actions.+ const regen = screen.getByTestId('regenerate-message')+ expect(regen.closest('[class*="opacity-0"]')).not.toBeNull()+ })+it('shows every action on a touch device', () => {touchRef.current = truerenderAssistant()