From 236accedc498afc6aa8f279fb8753a16e878ea63 Mon Sep 17 00:00:00 2001 From: CodeNebula <121377123+gaojunran@users.noreply.github.com> Date: Sun, 23 Aug 2026 05:53:19 -0700 Subject: [PATCH] fix(ui): make timeline dialog fit small screens (#3090) * fix(ui): make timeline dialog fit small screens On phones the timeline dialog squeezed the message list to a couple of rows: header, search box, and the fixed Actions/help block consumed almost all of the 70vh dialog height, and the description text could end up underneath the search box. The dialog no longer scrolls as a whole. The header and search stay fixed (shrink-0), the message list is the only scrollable region and takes the remaining height (min-h-0 flex-1), the dialog is taller on small screens (85dvh), the Actions/help footer collapses to a single action row on phones, and the description is hidden on phones only. Message timestamps no longer wrap either: the time column grows from a fixed 64px minimum and forces nowrap, so "11:14 PM" stays on one line. * fix(ui): keep dialog-level scroll fallback in timeline overflow-y-visible removed the reusable dialog's built-in scrolling fallback: the timeline's header, search, and footer are all shrink-0, so under constrained layouts (very short desktop windows, enlarged text) the fixed controls could leave the popup with no way to reach them once the message list collapsed to zero. Revert to overflow-y-auto. The list is still the only flex-1 min-h-0 child and absorbs space first, so normal mobile and desktop layouts do not scroll; only when fixed content exceeds the dialog height does the popup scroll again, keeping every control reachable. --- .../ui/src/components/chat/TimelineDialog.tsx | 102 ++++++++++-------- 1 file changed, 58 insertions(+), 44 deletions(-) diff --git a/packages/ui/src/components/chat/TimelineDialog.tsx b/packages/ui/src/components/chat/TimelineDialog.tsx index 88a03d45..45e0f9f4 100644 --- a/packages/ui/src/components/chat/TimelineDialog.tsx +++ b/packages/ui/src/components/chat/TimelineDialog.tsx @@ -223,20 +223,48 @@ export const TimelineDialog: React.FC = ({ if (!currentSessionId) return null; + const turnActions = ( + <> + + / + + + ); + return ( - - + + {t('chat.timeline.title')} - - {t('chat.timeline.description')} - + {!isMobile && ( + + {t('chat.timeline.description')} + + )} -
+
= ({
{canLoadEarlier && onLoadEarlier && ( -
+
)} -
+
{filteredMessages.length === 0 ? (
{searchQuery ? t('chat.timeline.empty.search') : t('chat.timeline.empty.session')} @@ -312,7 +340,7 @@ export const TimelineDialog: React.FC = ({ onMouseEnter={() => setSelectedIndex(index)} > {messageTime} @@ -373,45 +401,31 @@ export const TimelineDialog: React.FC = ({ )}
-
-

{t('chat.timeline.actions.title')}

-
- - / - + {isMobile ? ( +
+ {turnActions}
-
-
- {t('chat.timeline.help.clickMessage')} + ) : ( +
+

{t('chat.timeline.actions.title')}

+
+ {turnActions}
-
- - {t('chat.timeline.help.undoToPoint')} -
-
- - {t('chat.timeline.help.createSessionFromHere')} +
+
+ {t('chat.timeline.help.clickMessage')} +
+
+ + {t('chat.timeline.help.undoToPoint')} +
+
+ + {t('chat.timeline.help.createSessionFromHere')} +
-
+ )}
);