From eb8421ba9864cd58b0cf246cdffc6d45f6949372 Mon Sep 17 00:00:00 2001 From: "hermes-seaeye[bot]" <307254004+hermes-seaeye[bot]@users.noreply.github.com> Date: Fri, 7 Aug 2026 02:42:42 +0000 Subject: [PATCH] fmt(js): `npm run fix` on merge (#80725) Co-authored-by: github-actions[bot] --- apps/desktop/src/app/chat/sidebar/order.test.ts | 16 ++-------------- .../src/app/chat/sidebar/sessions-section.tsx | 1 + .../src/components/assistant-ui/thread/list.tsx | 7 ++----- .../src/components/chat/disclosure-row.tsx | 4 +--- apps/desktop/src/lib/render-weight.test.ts | 13 +++++++++++-- 5 files changed, 17 insertions(+), 24 deletions(-) diff --git a/apps/desktop/src/app/chat/sidebar/order.test.ts b/apps/desktop/src/app/chat/sidebar/order.test.ts index 911d451fc685d..6a12d8e086892 100644 --- a/apps/desktop/src/app/chat/sidebar/order.test.ts +++ b/apps/desktop/src/app/chat/sidebar/order.test.ts @@ -111,13 +111,7 @@ describe('orderRowsWithinGroups', () => { it('reorders within a group without moving the dividers', () => { const rows = [session('a'), session('b'), divider('yesterday'), session('c'), session('d')] - expect(ids(orderRowsWithinGroups(rows, ['b', 'a', 'd', 'c']))).toEqual([ - 'b', - 'a', - '--yesterday--', - 'd', - 'c' - ]) + expect(ids(orderRowsWithinGroups(rows, ['b', 'a', 'd', 'c']))).toEqual(['b', 'a', '--yesterday--', 'd', 'c']) }) it('never moves a row across a date divider', () => { @@ -125,13 +119,7 @@ describe('orderRowsWithinGroups', () => { // stay there — chronology owns the groups, the drag only ranks inside one. const rows = [session('a'), session('b'), divider('lastWeek'), session('c'), session('d')] - expect(ids(orderRowsWithinGroups(rows, ['d', 'c', 'b', 'a']))).toEqual([ - 'b', - 'a', - '--lastWeek--', - 'd', - 'c' - ]) + expect(ids(orderRowsWithinGroups(rows, ['d', 'c', 'b', 'a']))).toEqual(['b', 'a', '--lastWeek--', 'd', 'c']) }) it('leaves rows the order does not name in their recency slot', () => { diff --git a/apps/desktop/src/app/chat/sidebar/sessions-section.tsx b/apps/desktop/src/app/chat/sidebar/sessions-section.tsx index 12ba16134f6d5..c5bb1ad2b4b93 100644 --- a/apps/desktop/src/app/chat/sidebar/sessions-section.tsx +++ b/apps/desktop/src/app/chat/sidebar/sessions-section.tsx @@ -221,6 +221,7 @@ export function SidebarSessionsSection({ // The flat recents/pinned list is the only place sessions reorder by hand; // grouped/tree views always sort by creation date and never drag. const sessionsDraggable = sortable && !!onReorderSessions + // Only Pinned arrives pre-ordered as a flat sequence. Recents keeps its // recency sort — the drag order is layered on per date group below, so the // buckets stay truthful and a reorder never costs the list its dividers. diff --git a/apps/desktop/src/components/assistant-ui/thread/list.tsx b/apps/desktop/src/components/assistant-ui/thread/list.tsx index 691f8f9323a24..a2409ad80947b 100644 --- a/apps/desktop/src/components/assistant-ui/thread/list.tsx +++ b/apps/desktop/src/components/assistant-ui/thread/list.tsx @@ -145,11 +145,7 @@ export function buildGroups(signature: string): MessageGroup[] { // Walk turns newest-first, summing their render weights until the budget is met; // everything before the first kept turn is hidden. `minVisible` turns are kept // regardless of weight. Returns the index of that first visible group. -export function firstVisibleGroupIndex( - groups: readonly MessageGroup[], - budget: number, - minVisible = 0 -): number { +export function firstVisibleGroupIndex(groups: readonly MessageGroup[], budget: number, minVisible = 0): number { let firstVisible = groups.length for (let i = groups.length - 1, weight = 0; i >= 0; i--) { @@ -381,6 +377,7 @@ const ThreadMessageListInner: FC = ({ renderBudget, renderBudget >= RENDER_BUDGET ? MIN_VISIBLE_GROUPS : 0 ) + const visibleGroups = hiddenCount > 0 ? groups.slice(hiddenCount) : groups // Where the always-rendered live tail begins. Derived from the WEIGHTED diff --git a/apps/desktop/src/components/chat/disclosure-row.tsx b/apps/desktop/src/components/chat/disclosure-row.tsx index 7180d2610d0ea..f07faa4bcf5f0 100644 --- a/apps/desktop/src/components/chat/disclosure-row.tsx +++ b/apps/desktop/src/components/chat/disclosure-row.tsx @@ -66,9 +66,7 @@ export function DisclosureRow({ {action} )} - {trailing && ( - {trailing} - )} + {trailing && {trailing}} ) } diff --git a/apps/desktop/src/lib/render-weight.test.ts b/apps/desktop/src/lib/render-weight.test.ts index 096c7212a3d83..4ae73a6fc8305 100644 --- a/apps/desktop/src/lib/render-weight.test.ts +++ b/apps/desktop/src/lib/render-weight.test.ts @@ -72,7 +72,12 @@ describe('messagePaintWeight', () => { it('prices an image card flat, however long its data URL', () => { const card = (chars: number) => [ - { type: 'tool-call', toolName: 'image_generate', args: {}, result: { image: `data:image/png;base64,${'A'.repeat(chars)}` } } + { + type: 'tool-call', + toolName: 'image_generate', + args: {}, + result: { image: `data:image/png;base64,${'A'.repeat(chars)}` } + } ] expect(messagePaintWeight(card(10_000_000))).toBe(messagePaintWeight(card(80))) @@ -80,7 +85,11 @@ describe('messagePaintWeight', () => { it('charges nothing for a row that renders nothing', () => { const hoisted = [ - { type: 'tool-call', toolName: 'todo', args: { todos: Array.from({ length: 40 }, (_, i) => ({ content: `t${i}` })) } }, + { + type: 'tool-call', + toolName: 'todo', + args: { todos: Array.from({ length: 40 }, (_, i) => ({ content: `t${i}` })) } + }, { type: 'tool-call', toolName: 'react_to_message', args: { emoji: '❤️' } } ]