Skip to content

Commit 081bcad

Browse files
fix(session): remove duplicate new messages indicator (anomalyco#480)
1 parent 0f11673 commit 081bcad

1 file changed

Lines changed: 0 additions & 45 deletions

File tree

‎packages/app/src/app/pages/session.tsx‎

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,6 @@ export default function SessionView(props: SessionViewProps) {
186186
const [agentOptions, setAgentOptions] = createSignal<Agent[]>([]);
187187
const [autoScrollEnabled, setAutoScrollEnabled] = createSignal(false);
188188
const [scrollOnNextUpdate, setScrollOnNextUpdate] = createSignal(false);
189-
const [unreadCount, setUnreadCount] = createSignal(0);
190189

191190
const agentLabel = createMemo(() => props.selectedSessionAgent ?? "Default agent");
192191
const workspaceLabel = (workspace: WorkspaceInfo) =>
@@ -605,27 +604,6 @@ export default function SessionView(props: SessionViewProps) {
605604
),
606605
);
607606

608-
createEffect(
609-
on(
610-
() => props.messages.length,
611-
(current, previous) => {
612-
if (previous == null) return;
613-
if (current < previous) {
614-
setUnreadCount(0);
615-
return;
616-
}
617-
if (current > previous && !autoScrollEnabled()) {
618-
setUnreadCount((count) => count + (current - previous));
619-
}
620-
},
621-
),
622-
);
623-
624-
createEffect(() => {
625-
if (autoScrollEnabled()) {
626-
setUnreadCount(0);
627-
}
628-
});
629607

630608
const triggerFlyout = (
631609
sourceEl: Element | null,
@@ -997,12 +975,6 @@ export default function SessionView(props: SessionViewProps) {
997975
});
998976
};
999977

1000-
const jumpToLatest = () => {
1001-
setScrollOnNextUpdate(true);
1002-
scrollToLatest("smooth");
1003-
setUnreadCount(0);
1004-
};
1005-
1006978
return (
1007979
<div class="flex h-screen w-full bg-dls-surface text-dls-text font-sans overflow-hidden">
1008980
<aside class="w-64 hidden md:flex flex-col bg-dls-sidebar border-r border-dls-border p-4">
@@ -1563,23 +1535,6 @@ export default function SessionView(props: SessionViewProps) {
15631535
attachmentsDisabledReason={attachmentsDisabledReason()}
15641536
/>
15651537

1566-
<Show when={unreadCount() > 0}>
1567-
<div class="fixed bottom-24 right-6 z-40">
1568-
<button
1569-
type="button"
1570-
onClick={jumpToLatest}
1571-
class="flex items-center gap-2 rounded-full border border-gray-6 bg-gray-2/90 px-3 py-2 text-xs text-gray-11 shadow-lg shadow-gray-12/10 transition-all hover:text-gray-12 hover:border-gray-7"
1572-
aria-label="Jump to latest message"
1573-
>
1574-
<span>New messages</span>
1575-
<span class="rounded-full bg-gray-12/10 px-2 py-0.5 text-[10px] font-semibold text-gray-12">
1576-
{unreadCount()}
1577-
</span>
1578-
<ChevronDown size={12} class="text-gray-9" />
1579-
</button>
1580-
</div>
1581-
</Show>
1582-
15831538
</main>
15841539

15851540
<aside class="w-56 hidden md:flex flex-col bg-dls-sidebar border-l border-dls-border p-4">

0 commit comments

Comments
 (0)