diff --git a/client/src/components/Chat/Input/PendingSteerChips.tsx b/client/src/components/Chat/Input/PendingSteerChips.tsx
index dc820c6d0e..04078e80ee 100644
--- a/client/src/components/Chat/Input/PendingSteerChips.tsx
+++ b/client/src/components/Chat/Input/PendingSteerChips.tsx
@@ -1,7 +1,7 @@
import { memo, useMemo, useRef, useState, useCallback } from 'react';
import { useAtomValue } from 'jotai';
import { useRecoilValue } from 'recoil';
-import { useToastContext } from '@librechat/client';
+import { TooltipAnchor, useToastContext } from '@librechat/client';
import {
X,
Zap,
@@ -77,6 +77,33 @@ function QuoteCount({ count, label }: { count: number; label: string }) {
);
}
+/**
+ * The one fact a queued row needs to convey ("did my message vanish?" it did
+ * not) rides the clock as a hover hint and its accessible name while a run is
+ * pending, instead of a caption row that costs composer height at rest. The
+ * anchor is a tab stop with a visible ring so keyboard users reach the same
+ * hint: the tooltip opens on focus-visible as well as on hover.
+ */
+function QueuedIcon({ warning, hint }: { warning: boolean; hint?: string }) {
+ if (warning) {
+ return ;
+ }
+ if (!hint) {
+ return ;
+ }
+ return (
+
+
+
+ );
+}
+
function QueuedRow({
message,
steering,
@@ -209,11 +236,10 @@ function QueuedRow({
return (
- {isRejected || isUnconfirmed || isIndeterminate ? (
-
- ) : (
-
- )}
+
{message.text}
@@ -463,8 +489,6 @@ function PendingSteerChips({
return (
- {/* The list owns only listitem rows; the caption lives beside it so the
- * ARIA list structure stays valid for assistive tech. */}
))}
- {/* One caption for the whole queued group: the single fact users need
- * ("did my message vanish?" it did not), shown only while a run is
- * actually pending — after it, rows drain or convert on their own. */}
- {queued.length > 0 && steering.duringRunActive && (
-
- {localize('com_ui_steer_queued_info')}
-
- )}
);
}
diff --git a/client/src/components/Chat/Input/__tests__/PendingSteerChips.test.tsx b/client/src/components/Chat/Input/__tests__/PendingSteerChips.test.tsx
index 9947d7f34f..e757c562bd 100644
--- a/client/src/components/Chat/Input/__tests__/PendingSteerChips.test.tsx
+++ b/client/src/components/Chat/Input/__tests__/PendingSteerChips.test.tsx
@@ -23,6 +23,7 @@ jest.mock('@librechat/client', () => {
const { createSteerMorphIconMock } = jest.requireActual('~/../test/mockMorphIcon');
return {
useToastContext: () => ({ showToast: mockShowToast }),
+ TooltipAnchor: jest.requireActual('@librechat/client').TooltipAnchor,
MorphIcon: createSteerMorphIconMock(),
};
});
@@ -653,34 +654,55 @@ describe('PendingSteerChips — queued interrupt-now', () => {
);
});
-describe('PendingSteerChips — queued caption', () => {
+describe('PendingSteerChips — queued hint', () => {
beforeEach(() => {
jest.clearAllMocks();
});
const queuedItem = { id: 'q1', text: 'follow up later', createdAt: 1 };
+ const hintName = 'com_ui_steer_queued_info';
- it('explains when queued messages will send while a run is active', () => {
+ it('explains when a queued message will send as a hover hint on its clock icon', async () => {
renderChips([queuedItem], { steering: { duringRunActive: true } });
- expect(screen.getByTestId('queued-caption')).toHaveTextContent('com_ui_steer_queued_info');
+ const clock = screen.getByRole('img', { name: hintName });
+ fireEvent.mouseEnter(clock);
+ /** Ariakit only counts a pointer as moving when consecutive events differ
+ * in screen coordinates (its NODE_ENV=test shortcut is off under CI's
+ * NODE_ENV), and it opens the tooltip on a timer after that. */
+ fireEvent.mouseMove(clock, { screenX: 10, screenY: 10 });
+ fireEvent.mouseMove(clock, { screenX: 20, screenY: 20 });
+ const tooltip = await screen.findByRole('tooltip', {}, { timeout: 3000 });
+ expect(tooltip).toHaveTextContent(hintName);
});
- it('renders one caption for the whole group, not one per row', () => {
+ it('reaches the same hint from the keyboard: the clock is a tab stop and opens on focus', async () => {
+ const user = userEvent.setup();
+ renderChips([queuedItem], { steering: { duringRunActive: true } });
+ const clock = screen.getByRole('img', { name: hintName });
+ await user.tab();
+ expect(clock).toHaveFocus();
+ const tooltip = await screen.findByRole('tooltip');
+ expect(tooltip).toHaveTextContent(hintName);
+ });
+
+ it('renders no always-visible caption, so the hint costs no composer height at rest', () => {
+ renderChips([queuedItem], { steering: { duringRunActive: true } });
+ expect(screen.queryByText(hintName)).toBeNull();
+ expect(screen.queryByRole('tooltip')).toBeNull();
+ });
+
+ it('keeps the hint inside each queued row as its icon, never as a stray child of the list', () => {
renderChips([queuedItem, { id: 'q2', text: 'and another', createdAt: 2 }], {
steering: { duringRunActive: true },
});
- expect(screen.getAllByTestId('queued-caption')).toHaveLength(1);
+ const rows = screen.getAllByTestId('queued-message-row');
+ const clocks = screen.getAllByRole('img', { name: hintName });
+ expect(clocks).toHaveLength(2);
+ rows.forEach((row, index) => expect(row).toContainElement(clocks[index]));
});
- it('keeps the caption beside the ARIA list, never as a non-listitem child of it', () => {
- renderChips([queuedItem], { steering: { duringRunActive: true } });
- const list = screen.getByRole('list', { name: 'com_ui_queued_messages' });
- expect(list).not.toContainElement(screen.getByTestId('queued-caption'));
- expect(list).toContainElement(screen.getByTestId('queued-message-row'));
- });
-
- it('omits the caption once the run is over, when rows drain on their own terms', () => {
+ it('omits the hint once the run is over, when rows drain on their own terms', () => {
renderChips([queuedItem], { steering: { duringRunActive: false } });
- expect(screen.queryByTestId('queued-caption')).toBeNull();
+ expect(screen.queryByRole('img', { name: hintName })).toBeNull();
});
});