@celljs/ta-web 4.23.0 → 4.24.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. package/esm/browser/assistant/assistant-chat-list.js +3 -1
  2. package/esm/browser/components/app-nav.d.ts +3 -1
  3. package/esm/browser/components/app-nav.js +10 -10
  4. package/esm/browser/components/app-shell-state.d.ts +1 -0
  5. package/esm/browser/components/app-shell-state.js +21 -1
  6. package/esm/browser/components/app-view.js +20 -14
  7. package/esm/browser/components/chat-home-util.d.ts +7 -0
  8. package/esm/browser/components/chat-home-util.js +10 -0
  9. package/esm/browser/components/chat-home.js +3 -3
  10. package/esm/browser/components/chat-list-hooks.d.ts +2 -0
  11. package/esm/browser/components/chat-list-hooks.js +6 -0
  12. package/esm/browser/components/chat-list-row.js +2 -2
  13. package/esm/browser/components/chat-list-util.d.ts +15 -3
  14. package/esm/browser/components/chat-list-util.js +26 -4
  15. package/esm/browser/components/chat-list.js +6 -5
  16. package/esm/browser/components/chat-seen.d.ts +4 -3
  17. package/esm/browser/components/chat-seen.js +6 -5
  18. package/esm/browser/components/chats-dot.d.ts +30 -0
  19. package/esm/browser/components/chats-dot.js +32 -0
  20. package/esm/browser/components/cloud-sign-in-view.d.ts +1 -1
  21. package/esm/browser/components/host-view.d.ts +1 -1
  22. package/esm/browser/components/list-motion.d.ts +44 -0
  23. package/esm/browser/components/list-motion.js +197 -0
  24. package/esm/browser/components/partner-row.js +1 -1
  25. package/esm/browser/components/settings-files.d.ts +7 -0
  26. package/esm/browser/components/settings-files.js +61 -0
  27. package/esm/browser/components/settings-more.js +2 -0
  28. package/esm/browser/components/side-lists.d.ts +7 -0
  29. package/esm/browser/components/side-lists.js +16 -0
  30. package/esm/browser/components/sortable.js +15 -0
  31. package/esm/browser/components/tool-view.js +23 -7
  32. package/esm/browser/components/workbench-tabs.d.ts +1 -0
  33. package/esm/browser/components/workbench-tabs.js +8 -3
  34. package/esm/browser/components/workbench-toggle.d.ts +5 -0
  35. package/esm/browser/components/workbench-toggle.js +10 -0
  36. package/esm/browser/extension/web-api-contributions.d.ts +2 -1
  37. package/esm/browser/extension/web-api-partners.d.ts +9 -1
  38. package/esm/browser/extension/web-view-util.d.ts +5 -0
  39. package/esm/browser/extension/web-view-util.js +8 -0
  40. package/esm/browser/i18n/locales.d.ts +10 -2
  41. package/esm/browser/i18n/messages-ja.js +9 -1
  42. package/esm/browser/i18n/messages-zh-tw.js +9 -1
  43. package/esm/browser/i18n/messages.d.ts +9 -1
  44. package/esm/browser/i18n/messages.js +18 -2
  45. package/esm/browser/partners/partners-util.d.ts +6 -0
  46. package/esm/browser/partners/partners-util.js +9 -0
  47. package/esm/browser/partners/partners-view.js +4 -1
  48. package/esm/browser/style/base.d.ts +1 -1
  49. package/esm/browser/style/base.js +5 -0
  50. package/esm/browser/style/chat-list.d.ts +1 -1
  51. package/esm/browser/style/chat-list.js +2 -0
  52. package/esm/browser/style/conversation.d.ts +1 -1
  53. package/esm/browser/style/conversation.js +3 -0
  54. package/esm/browser/style/device.js +4 -1
  55. package/esm/browser/style/layout.d.ts +1 -1
  56. package/esm/browser/style/layout.js +20 -6
  57. package/esm/browser/style/pages.d.ts +1 -1
  58. package/esm/browser/style/pages.js +8 -0
  59. package/esm/browser/style/shell.d.ts +1 -1
  60. package/esm/browser/style/shell.js +7 -2
  61. package/esm/browser/style/surfaces.d.ts +1 -1
  62. package/esm/browser/style/surfaces.js +1 -0
  63. package/esm/browser/util/process.d.ts +3 -1
  64. package/esm/browser/util/process.js +27 -0
  65. package/lib/browser/assistant/assistant-chat-list.js +3 -1
  66. package/lib/browser/components/app-nav.d.ts +3 -1
  67. package/lib/browser/components/app-nav.js +8 -8
  68. package/lib/browser/components/app-shell-state.d.ts +1 -0
  69. package/lib/browser/components/app-shell-state.js +21 -1
  70. package/lib/browser/components/app-view.js +19 -13
  71. package/lib/browser/components/chat-home-util.d.ts +7 -0
  72. package/lib/browser/components/chat-home-util.js +10 -0
  73. package/lib/browser/components/chat-home.js +3 -3
  74. package/lib/browser/components/chat-list-hooks.d.ts +2 -0
  75. package/lib/browser/components/chat-list-hooks.js +7 -0
  76. package/lib/browser/components/chat-list-row.js +2 -2
  77. package/lib/browser/components/chat-list-util.d.ts +15 -3
  78. package/lib/browser/components/chat-list-util.js +26 -4
  79. package/lib/browser/components/chat-list.js +5 -4
  80. package/lib/browser/components/chat-seen.d.ts +4 -3
  81. package/lib/browser/components/chat-seen.js +6 -5
  82. package/lib/browser/components/chats-dot.d.ts +31 -0
  83. package/lib/browser/components/chats-dot.js +68 -0
  84. package/lib/browser/components/cloud-sign-in-view.d.ts +1 -1
  85. package/lib/browser/components/host-view.d.ts +1 -1
  86. package/lib/browser/components/list-motion.d.ts +45 -0
  87. package/lib/browser/components/list-motion.js +234 -0
  88. package/lib/browser/components/partner-row.js +1 -1
  89. package/lib/browser/components/settings-files.d.ts +8 -0
  90. package/lib/browser/components/settings-files.js +97 -0
  91. package/lib/browser/components/settings-more.js +2 -0
  92. package/lib/browser/components/side-lists.d.ts +7 -0
  93. package/lib/browser/components/side-lists.js +16 -0
  94. package/lib/browser/components/sortable.js +15 -0
  95. package/lib/browser/components/tool-view.js +23 -7
  96. package/lib/browser/components/workbench-tabs.d.ts +1 -0
  97. package/lib/browser/components/workbench-tabs.js +7 -2
  98. package/lib/browser/components/workbench-toggle.d.ts +5 -0
  99. package/lib/browser/components/workbench-toggle.js +11 -0
  100. package/lib/browser/extension/web-api-contributions.d.ts +2 -1
  101. package/lib/browser/extension/web-api-partners.d.ts +9 -1
  102. package/lib/browser/extension/web-view-util.d.ts +5 -0
  103. package/lib/browser/extension/web-view-util.js +8 -0
  104. package/lib/browser/i18n/locales.d.ts +10 -2
  105. package/lib/browser/i18n/messages-ja.js +9 -1
  106. package/lib/browser/i18n/messages-zh-tw.js +9 -1
  107. package/lib/browser/i18n/messages.d.ts +9 -1
  108. package/lib/browser/i18n/messages.js +18 -2
  109. package/lib/browser/partners/partners-util.d.ts +6 -0
  110. package/lib/browser/partners/partners-util.js +9 -0
  111. package/lib/browser/partners/partners-view.js +4 -1
  112. package/lib/browser/style/base.d.ts +1 -1
  113. package/lib/browser/style/base.js +5 -0
  114. package/lib/browser/style/chat-list.d.ts +1 -1
  115. package/lib/browser/style/chat-list.js +2 -0
  116. package/lib/browser/style/conversation.d.ts +1 -1
  117. package/lib/browser/style/conversation.js +3 -0
  118. package/lib/browser/style/device.js +4 -1
  119. package/lib/browser/style/layout.d.ts +1 -1
  120. package/lib/browser/style/layout.js +20 -6
  121. package/lib/browser/style/pages.d.ts +1 -1
  122. package/lib/browser/style/pages.js +8 -0
  123. package/lib/browser/style/shell.d.ts +1 -1
  124. package/lib/browser/style/shell.js +7 -2
  125. package/lib/browser/style/surfaces.d.ts +1 -1
  126. package/lib/browser/style/surfaces.js +1 -0
  127. package/lib/browser/util/process.d.ts +3 -1
  128. package/lib/browser/util/process.js +27 -0
  129. package/package.json +7 -7
@@ -39,6 +39,7 @@ function useChatHome(onPicked) {
39
39
  const items = React.useSyncExternalStore(host.home.subscribe, host.home.items, host.home.items);
40
40
  const allPartners = React.useSyncExternalStore(host.partners.subscribe, host.partners.partners, host.partners.partners);
41
41
  const partners = React.useMemo(() => PartnersUtil.chats(allPartners), [allPartners]);
42
+ const partnerSessions = React.useMemo(() => PartnersUtil.sessions(allPartners), [allPartners]);
42
43
  // Its preview and whether it works, as one string: the same line stays the same value.
43
44
  const watch = React.useCallback((listener) => { var _a; var _b; return (_b = (_a = view === null || view === void 0 ? void 0 : view.subscribePreview) === null || _a === void 0 ? void 0 : _a.call(view, listener)) !== null && _b !== void 0 ? _b : (() => undefined); }, [view]);
44
45
  const read = () => {
@@ -71,6 +72,7 @@ function useChatHome(onPicked) {
71
72
  },
72
73
  items,
73
74
  partners,
75
+ partnerSessions,
74
76
  shownItem,
75
77
  openItem: entry => {
76
78
  latest.current();
@@ -85,7 +87,7 @@ function useChatHome(onPicked) {
85
87
  },
86
88
  remove: removed => void WebTaskUtil.remove(removed, notices, t),
87
89
  };
88
- }, [listed, line, name, shown, view, items, partners, shownItem, tasks, host, state, notices, t]);
90
+ }, [listed, line, name, shown, view, items, partners, partnerSessions, shownItem, tasks, host, state, notices, t]);
89
91
  }
90
92
  /** The list of chats with what the double knows of them: its tasks marked, a conversation to hand it; its home over them. */
91
93
  export function AssistantChatList(props) {
@@ -35,13 +35,15 @@ export interface RailProps {
35
35
  onDismissAsks?(): void;
36
36
  /** A chat said something unseen: the amber dot on the double's entry, as on a phone's first tab; dragged away, all seen. */
37
37
  onSeeAll?(): void;
38
+ /** A double click where nothing is: the sidebar and the workbench both go, or both come back. */
39
+ onToggleSides?(): void;
38
40
  }
39
41
  /**
40
42
  * The navigation on the left, as the tabs of a phone: the logo; the lists of the sidebar; the pages, and Discover
41
43
  * once some are under it; the account with the settings at the bottom. A page's menu (a right click) puts it under
42
44
  * Discover; that of the double talks to it, and that of the chats opens a new one (entryMenu).
43
45
  */
44
- export declare function Rail({ lists, list, onList, navigation, current, onPage, onDiscover, onSettings, settingsShown, surfaces, surface, onSurface, holds, asks, onDismissAsks, onSeeAll, }: RailProps): React.JSX.Element;
46
+ export declare function Rail({ lists, list, onList, navigation, current, onPage, onDiscover, onSettings, settingsShown, surfaces, surface, onSurface, holds, asks, onDismissAsks, onSeeAll, onToggleSides, }: RailProps): React.JSX.Element;
45
47
  /** A sidebar view of a web extension, under its title or its own top bar. */
46
48
  export declare function SidebarView({ view }: {
47
49
  view: WebViewEntry;
@@ -6,19 +6,18 @@ import { ExtensionBoundary } from '../extension/extension-view.js';
6
6
  import { WebLabelUtil } from '../extension/web-extension-protocol.js';
7
7
  import { useSettings, useWebExtensions, useWorkbench } from '../hooks.js';
8
8
  import { useT } from '../i18n/use-t.js';
9
- import { ShortcutUtil } from '../settings/agent-settings.js';
10
9
  import { NavigationUtil } from '../settings/navigation.js';
11
10
  import { AccountMenu } from './account-menu.js';
12
11
  import { AsksBadge } from './asks-badge.js';
13
12
  import { ConnectionBanner } from './connection-bar.js';
14
13
  import { useContextMenu } from './context-menu.js';
15
14
  import { Dino } from './dino.js';
16
- import { IconButton, SidebarRight } from './icon.js';
15
+ import { IconButton } from './icon.js';
17
16
  import { DISCOVER, entryHold, hasDiscover, places } from './nav-places.js';
18
17
  import { PageStackContext } from './phone-shell.js';
19
18
  import { DinoFace } from './ta-avatar.js';
20
19
  import { UnseenDrop } from './unseen-drop.js';
21
- import { WorkbenchToggle, WorkbenchToggleContext } from './workbench-toggle.js';
20
+ import { WorkbenchToggle } from './workbench-toggle.js';
22
21
  /* The navigation of the app: the rail, a sidebar view, a page of the main area. */
23
22
  /** Where the pages of the rail go on this device: a phone has the room its tabs leave. */
24
23
  export function useNavigation(views) {
@@ -49,7 +48,7 @@ function RailItem({ label, place, active, onClick, onContextMenu, onPointerDown,
49
48
  * once some are under it; the account with the settings at the bottom. A page's menu (a right click) puts it under
50
49
  * Discover; that of the double talks to it, and that of the chats opens a new one (entryMenu).
51
50
  */
52
- export function Rail({ lists, list, onList, navigation, current, onPage, onDiscover, onSettings, settingsShown, surfaces, surface, onSurface, holds, asks, onDismissAsks, onSeeAll, }) {
51
+ export function Rail({ lists, list, onList, navigation, current, onPage, onDiscover, onSettings, settingsShown, surfaces, surface, onSurface, holds, asks, onDismissAsks, onSeeAll, onToggleSides, }) {
53
52
  const t = useT();
54
53
  const [{ server }] = useWorkbench();
55
54
  const [menu, openMenu] = useContextMenu();
@@ -63,9 +62,12 @@ export function Rail({ lists, list, onList, navigation, current, onPage, onDisco
63
62
  React.createElement(Glyph, { size: 20, strokeWidth: 1.6 })));
64
63
  };
65
64
  const discover = hasDiscover(navigation) || current === DISCOVER;
66
- // The workbench from anywhere, a page or the settings too, as the launcher and the board.
67
- const workbench = React.useContext(WorkbenchToggleContext);
68
- return (React.createElement("nav", { className: "ta-rail", "aria-label": t('ta.menu') },
65
+ return (React.createElement("nav", { className: "ta-rail", "aria-label": t('ta.menu'), onDoubleClick: event => {
66
+ var _a, _b;
67
+ if (onToggleSides && !((_b = (_a = event.target).closest) === null || _b === void 0 ? void 0 : _b.call(_a, 'button, a, [role="button"], input'))) {
68
+ onToggleSides();
69
+ }
70
+ } },
69
71
  React.createElement("div", { className: "ta-rail-logo", title: server ? `Ta v${server.version}` : 'Ta' },
70
72
  React.createElement(Dino, { size: 26 })),
71
73
  React.createElement("div", { className: "ta-rail-items" },
@@ -77,9 +79,7 @@ export function Rail({ lists, list, onList, navigation, current, onPage, onDisco
77
79
  navigation.nav.map(view => item(view)),
78
80
  discover && (React.createElement(RailItem, { label: t('ta.discover'), place: "discover", active: !settingsShown && current === DISCOVER, onClick: onDiscover, onContextMenu: event => openMenu(event, [settingsItem]) },
79
81
  React.createElement(Compass, { size: 20, strokeWidth: 1.6 })))),
80
- (workbench || surfaces.launcher || surfaces.board) && (React.createElement("div", { className: "ta-rail-tools" },
81
- workbench && (React.createElement(RailItem, { label: `${t('ta.workbench')} (${ShortcutUtil.keys('Mod+J').join(ShortcutUtil.isMac() ? '' : '+')})`, active: workbench.open, onClick: workbench.toggle },
82
- React.createElement(SidebarRight, { size: 20, strokeWidth: 1.6 }))),
82
+ (surfaces.launcher || surfaces.board) && (React.createElement("div", { className: "ta-rail-tools" },
83
83
  surfaces.launcher && (React.createElement(SurfaceButton, { label: t('ta.launcher'), active: surface === 'launcher', onClick: () => onSurface(surface === 'launcher' ? undefined : 'launcher') },
84
84
  React.createElement(Grip, { size: 20, strokeWidth: 1.6 }))),
85
85
  surfaces.board && (React.createElement(SurfaceButton, { label: t('ta.board'), active: surface === 'board', onClick: () => onSurface(surface === 'board' ? undefined : 'board') },
@@ -73,6 +73,7 @@ export declare function useAppShell(): {
73
73
  sideShown: boolean;
74
74
  showList: (id: string) => void;
75
75
  toggleWorkbench: () => void;
76
+ toggleSides: () => void;
76
77
  picking: React.RefObject<() => void>;
77
78
  chatsBusy: boolean;
78
79
  deciding: number;
@@ -7,6 +7,7 @@ import { useChat } from '../chat/chat-view.js';
7
7
  import { useBackLayer, useNoBackLayer } from '../device/back-stack.js';
8
8
  import { useDevice } from '../device/device.js';
9
9
  import { WebTaskUtil } from '../extension/web-tasks.js';
10
+ import { WebViewUtil } from '../extension/web-view-util.js';
10
11
  import { TaFiles } from '../files/files-protocol.js';
11
12
  import { useCodeScan, useNotices, useOpenLink, usePersisted, useSettings, useWebExtensions, useWorkbench } from '../hooks.js';
12
13
  import { useT } from '../i18n/use-t.js';
@@ -200,7 +201,7 @@ export function useAppShell() {
200
201
  setSettings(undefined);
201
202
  setTabPage(undefined);
202
203
  };
203
- const tools = [...(hasCards ? [cardsTool] : []), ...extensions.views.filter(candidate => candidate.location === 'panel')];
204
+ const tools = [...(hasCards ? [cardsTool] : []), ...WebViewUtil.tools(extensions.views)];
204
205
  const openTool = (id) => (id === CARDS_ID ? openCards() : host.openView(id));
205
206
  // The workbench: the tabs open, or the tools that open there.
206
207
  const editors = extensions.editors.length > 0 || tools.length > 0;
@@ -385,6 +386,24 @@ export function useAppShell() {
385
386
  editor.reveal();
386
387
  }
387
388
  };
389
+ // A double click on the rail where nothing is: both sides go, or come back if neither shows.
390
+ const toggleSides = () => {
391
+ const workbench = !!editors && showEditors;
392
+ if (sideShown || workbench) {
393
+ if (sideShown) {
394
+ toggleSide();
395
+ }
396
+ if (workbench) {
397
+ toggleRight();
398
+ }
399
+ }
400
+ else {
401
+ toggleSide();
402
+ if (editors) {
403
+ toggleWorkbench();
404
+ }
405
+ }
406
+ };
388
407
  // Cmd/Ctrl+Shift+T: the conversation last taken out of the list, back in it and shown, as it is picked there.
389
408
  const picking = React.useRef(() => undefined);
390
409
  const reopenChat = React.useCallback(() => {
@@ -462,6 +481,7 @@ export function useAppShell() {
462
481
  sideShown,
463
482
  showList,
464
483
  toggleWorkbench,
484
+ toggleSides,
465
485
  picking,
466
486
  chatsBusy,
467
487
  deciding,
@@ -10,7 +10,6 @@ import { usePersisted } from '../hooks.js';
10
10
  import { SIGN_IN_EVENT } from '../notices/notices.js';
11
11
  import { SharedPageUtil } from '../share/shared-link.js';
12
12
  import { SharedPage } from '../share/shared-page.js';
13
- import { WorkbenchUtil } from '../workbench-util.js';
14
13
  import { AppContexts } from './app-contexts.js';
15
14
  import { PageView, Rail, SidebarView } from './app-nav.js';
16
15
  import { LOGIN_LATER, RAIL } from './app-shell-hooks.js';
@@ -18,9 +17,9 @@ import { useAppShell } from './app-shell-state.js';
18
17
  import { AuthUtil, LoginPage, useAuthProviders } from './auth-view.js';
19
18
  import { BoardSurface } from './board.js';
20
19
  import { ChatAskUtil } from './chat-asks.js';
21
- import { ChatIconUtil } from './chat-icon.js';
22
20
  import { ChatListUtil } from './chat-list-util.js';
23
21
  import { ChatSeenUtil, SEEN_CHATS } from './chat-seen.js';
22
+ import { useChatsDot } from './chats-dot.js';
24
23
  import { ConnectionBar } from './connection-bar.js';
25
24
  import { CustomHost } from './custom-host.js';
26
25
  import { DeviceSignInPage } from './device-sign-in-page.js';
@@ -49,7 +48,7 @@ import { ShareHost } from './share-dialog.js';
49
48
  import { DOUBLE_PAGE, SideListUtil } from './side-lists.js';
50
49
  import { paneStyle, Sash } from './split-pane.js';
51
50
  import { SurfaceFlyout } from './surface-flyout.js';
52
- import { WorkbenchToggleContext } from './workbench-toggle.js';
51
+ import { SidebarPane, WorkbenchToggleContext } from './workbench-toggle.js';
53
52
  import { SignIn } from './workbench-view.js';
54
53
  /**
55
54
  * ta on the web, laid out as an IDE: the navigation, a sidebar (the chats, or a sidebar view of a web
@@ -61,7 +60,7 @@ import { SignIn } from './workbench-view.js';
61
60
  function AppShell() {
62
61
  var _a, _b, _c;
63
62
  var _d, _e;
64
- const { t, workbench, extensions, host, store, pending, chat, setSideId, removedChats, chatsByDirectory, setChatsByDirectory, foldedChats, setFoldedChats, pinnedChats, setPinnedChats, letGoAsks, setLetGoAsks, navOpen, setNavOpen, phone, screenOpen, setScreenOpen, surface, setSurface, surfaces, settings, setSettings, settingsOpened, tabPage, setTabPage, openSettings, closeSettings, settingsShown, toggleRight, maximized, setMaximized, chatSettings, readArchived, sidebar, editor, online, fileUrl, openLink, activeEditor, view, sideView, side, showPage, lists, tools, openTool, editors, showEditors, navigation, codeScan, notices, railCurrent, tabView, screenPage, seenChats, looking, state, sideShown, showList, toggleWorkbench, picking, chatsBusy, setChatsBusy, deciding, } = useAppShell();
63
+ const { t, workbench, extensions, host, store, pending, chat, setSideId, removedChats, chatsByDirectory, setChatsByDirectory, foldedChats, setFoldedChats, pinnedChats, setPinnedChats, letGoAsks, setLetGoAsks, navOpen, setNavOpen, phone, screenOpen, setScreenOpen, surface, setSurface, surfaces, settings, setSettings, settingsOpened, tabPage, setTabPage, openSettings, closeSettings, settingsShown, toggleRight, maximized, setMaximized, chatSettings, readArchived, sidebar, editor, online, fileUrl, openLink, activeEditor, view, sideView, side, showPage, lists, tools, openTool, editors, showEditors, navigation, codeScan, notices, railCurrent, tabView, screenPage, seenChats, looking, state, sideShown, showList, toggleWorkbench, toggleSides, picking, chatsBusy, setChatsBusy, deciding, } = useAppShell();
65
64
  const [providers, reloadProviders] = useAuthProviders(online);
66
65
  const [later, setLater] = usePersisted(LOGIN_LATER);
67
66
  /** A call failed for want of a sign-in (SIGN_IN_EVENT): the page of sign-in, even if the user put it off. */
@@ -78,6 +77,20 @@ function AppShell() {
78
77
  // Where Ta's agents read the page to be, and go (docs/design/ta-app-use.md 3): set below as it renders.
79
78
  const screenShell = useScreenNavigator();
80
79
  const inCall = useCallGoingOn();
80
+ // The chats' tab, and the double's on the rail, have the amber dot while a row of the double's list has one, as a
81
+ // messenger's; what waits for the user to decide is counted there until answered.
82
+ const { listed: listedChats, unseen: chatsUnseen } = useChatsDot({
83
+ sessions: workbench.sessions,
84
+ saved: workbench.saved,
85
+ removed: removedChats,
86
+ pinned: pinnedChats,
87
+ letGo: letGoAsks,
88
+ archiveDays: chatSettings.chatArchiveDays,
89
+ seen: seenChats,
90
+ looking,
91
+ extensions,
92
+ host,
93
+ });
81
94
  if (workbench.status === 'signed-out') {
82
95
  return workbench.leaving ? React.createElement("div", { className: "ta-signin" }) : React.createElement(SignIn, { error: workbench.error });
83
96
  }
@@ -94,9 +107,7 @@ function AppShell() {
94
107
  }, onProviders: reloadProviders }));
95
108
  }
96
109
  // What the columns beside the conversation and the editors take, so that the editors never take more than the conversation.
97
- const sideWidths = {
98
- '--ta-left': `${RAIL + (sideShown ? sidebar.size : 0)}px`,
99
- };
110
+ const sideWidths = { '--ta-left': `${RAIL + (sideShown ? sidebar.size : 0)}px` };
100
111
  const classes = ['ta-app', navOpen && 'ta-nav-open', showEditors && 'ta-editors-open', showEditors && maximized && 'ta-workbench-max'];
101
112
  const toggle = editors ? { open: showEditors, toggle: toggleWorkbench } : undefined;
102
113
  const picked = () => {
@@ -216,11 +227,6 @@ function AppShell() {
216
227
  picked();
217
228
  },
218
229
  });
219
- // The chats' tab, and the double's on the rail, have the amber dot of the rows listed while one said something unseen,
220
- // as a messenger's, but those quiet (a call); what waits for the user to decide is counted there until answered.
221
- const listedChats = ChatListUtil.entries(workbench.sessions, workbench.saved, removedChats, undefined, WorkbenchUtil.daysAgo(Date.now(), chatSettings.chatArchiveDays), ChatListUtil.keptFiles(workbench.saved, pinnedChats, letGoAsks), ChatIconUtil.archiveSince(extensions.chatIcons, Date.now())).listed;
222
- const inFront = looking ? workbench.sessions.find(session => session.sessionId === looking) : undefined;
223
- const chatsUnseen = ChatSeenUtil.anyUnseen(ChatIconUtil.loud(extensions.chatIcons, listedChats), seenChats, inFront && ChatListUtil.file(inFront));
224
230
  // Dragged away, the dot of the chats: all seen.
225
231
  const seeAllChats = () => state.set(SEEN_CHATS, ChatSeenUtil.seeAll(state.get(SEEN_CHATS), listedChats, Date.now()));
226
232
  // Dragged away, the count of the double: what the conversations ask let go; the double's own tasks wait on.
@@ -340,8 +346,8 @@ function AppShell() {
340
346
  setSettings(undefined);
341
347
  setNavOpen(false);
342
348
  setTabPage('discover');
343
- }, onSettings: openSettings, settingsShown: settings !== undefined, surfaces: surfaces, surface: surface, onSurface: setSurface, holds: holds, asks: deciding, onDismissAsks: letGoAllAsks, onSeeAll: chatsUnseen ? seeAllChats : undefined }),
344
- sideShown && (React.createElement("div", { className: "ta-sidebar", style: paneStyle(sidebar) },
349
+ }, onSettings: openSettings, settingsShown: settings !== undefined, surfaces: surfaces, surface: surface, onSurface: setSurface, holds: holds, asks: deciding, onDismissAsks: letGoAllAsks, onSeeAll: chatsUnseen ? seeAllChats : undefined, onToggleSides: toggleSides }),
350
+ sideShown && (React.createElement(SidebarPane, { style: paneStyle(sidebar) },
345
351
  sideList,
346
352
  React.createElement(Sash, { pane: sidebar, side: "start", label: t('ta.layout.sidebar') })))),
347
353
  React.createElement("main", { className: "ta-main" },
@@ -16,6 +16,8 @@ export interface ChatHome {
16
16
  * list by their time as any conversation (docs/design/ta-partners.md).
17
17
  */
18
18
  partners: readonly WebPartnerEntry[];
19
+ /** The conversations of pi that are partners' (PartnersUtil.sessions): listed once closed too, seen elsewhere till then. */
20
+ partnerSessions: ReadonlyMap<string, number>;
19
21
  /** The key of the row whose page is in front, as a conversation of the list is (WebExtensionsState.pageFrom). */
20
22
  shownItem?: string;
21
23
  /** Opens a row: a page it shows is shown beside the list (TaWebExtensions.openHome). */
@@ -104,6 +106,11 @@ export declare namespace ChatHomeUtil {
104
106
  };
105
107
  /** It ended after the user last opened it (once the seen were kept): an amber dot, as a conversation's unread. */
106
108
  function unseen(task: WebTaskEntry, seen: ChatSeen): boolean;
109
+ /**
110
+ * Whether a row of the double's list that is no conversation of pi has the amber dot: a row of its home, a
111
+ * conversation with a partner (a group chat, a chat of two), a task that is no conversation.
112
+ */
113
+ function anyUnseen(items: readonly WebHomeEntry[], partners: readonly WebPartnerEntry[], tasks: readonly WebTaskEntry[], seen: ChatSeen): boolean;
107
114
  /** Whether one of `texts` has the query (any case); all match an empty one. */
108
115
  function matches(query: string, ...texts: (string | undefined)[]): boolean;
109
116
  /**
@@ -100,6 +100,16 @@ export var ChatHomeUtil;
100
100
  return seen.since > 0 && WebTaskUtil.ended(task) && task.endedAt !== undefined && task.endedAt > ((_a = seen.at[seenKey(task)]) !== null && _a !== void 0 ? _a : seen.since);
101
101
  }
102
102
  ChatHomeUtil.unseen = unseen;
103
+ /**
104
+ * Whether a row of the double's list that is no conversation of pi has the amber dot: a row of its home, a
105
+ * conversation with a partner (a group chat, a chat of two), a task that is no conversation.
106
+ */
107
+ function anyUnseen(items, partners, tasks, seen) {
108
+ return (ChatHomeUtil.items(items).some(item => item.unseen) ||
109
+ PartnersUtil.chats(partners).some(PartnersUtil.unseen) ||
110
+ ChatHomeUtil.tasks(tasks).rows.some(task => unseen(task, seen)));
111
+ }
112
+ ChatHomeUtil.anyUnseen = anyUnseen;
103
113
  /** Whether one of `texts` has the query (any case); all match an empty one. */
104
114
  function matches(query, ...texts) {
105
115
  const needle = query.trim().toLowerCase();
@@ -35,7 +35,7 @@ export function ChatDoubleItem({ home, counts, unseen, now }) {
35
35
  const asks = counts.waiting > 0;
36
36
  const fresh = counts.fresh > 0 || unseen;
37
37
  const items = double.menu ? ChatHomeUtil.menu(double.menu()) : [];
38
- return (React.createElement(SwipeRow, { as: "li", className: `ta-chat-row ta-chat-double ta-chat-home-double${double.shown ? ' ta-selected' : ''}`, "data-unseen": fresh && !asks ? '' : undefined, "data-asks": asks ? '' : undefined, overlay: menu, onContextMenu: items.length ? event => openMenu(event, items) : undefined },
38
+ return (React.createElement(SwipeRow, { as: "li", className: `ta-chat-row ta-chat-double ta-chat-home-double${double.shown ? ' ta-selected' : ''}`, "data-row": "double", "data-unseen": fresh && !asks ? '' : undefined, "data-asks": asks ? '' : undefined, overlay: menu, onContextMenu: items.length ? event => openMenu(event, items) : undefined },
39
39
  React.createElement("button", { type: "button", className: "ta-chat-item", title: double.name, "aria-current": double.shown ? 'true' : undefined, onClick: double.open },
40
40
  React.createElement("span", { className: "ta-chat-avatar-box" },
41
41
  React.createElement(DinoFace, { className: "ta-chat-face", mood: asks ? 'attention' : double.busy || counts.running > 0 ? 'working' : 'idle', size: 38 }),
@@ -69,7 +69,7 @@ export function ChatHomeItem({ row, time, home, selected, pinned, onPin, }) {
69
69
  };
70
70
  const pin = { label: t(pinned ? 'ta.chat.unpin' : 'ta.chat.pin'), run: () => onPin(!pinned) };
71
71
  const current = selected || home.shownItem === item.key;
72
- return (React.createElement(SwipeRow, { as: "li", className: `ta-chat-row ta-chat-home-item${current ? ' ta-selected' : ''}`, "data-unseen": item.unseen ? '' : undefined, actions: [{ key: 'pin', ...pin }], overlay: menu, onContextMenu: event => openMenu(event, ContextMenuUtil.sections([{ label: t('ta.chat.open'), run: open }], [pin])) },
72
+ return (React.createElement(SwipeRow, { as: "li", className: `ta-chat-row ta-chat-home-item${current ? ' ta-selected' : ''}`, "data-row": row.key, "data-unseen": item.unseen ? '' : undefined, actions: [{ key: 'pin', ...pin }], overlay: menu, onContextMenu: event => openMenu(event, ContextMenuUtil.sections([{ label: t('ta.chat.open'), run: open }], [pin])) },
73
73
  React.createElement("button", { type: "button", className: "ta-chat-item", title: item.title, "aria-current": current ? 'true' : undefined, onClick: open },
74
74
  React.createElement("span", { className: "ta-chat-avatar-box" },
75
75
  Own && !opening ? (React.createElement("span", { className: "ta-chat-face", style: { width: 38, height: 38 }, "aria-hidden": "true" },
@@ -103,7 +103,7 @@ export const ChatTaskItem = React.memo(function ChatTaskItem({ task, home, unsee
103
103
  const remove = task.remove ? () => home.remove([task]) : undefined;
104
104
  const items = () => ChatHomeUtil.taskMenu(task, { label: t('ta.chat.open'), run: open }, remove && { label: t('ta.task.remove'), run: remove, danger: true });
105
105
  const ended = task.status === 'failed' || task.status === 'stopped' ? task.status : undefined;
106
- return (React.createElement(SwipeRow, { as: "li", className: "ta-chat-row ta-chat-task", "data-unseen": unseen && !asks ? '' : undefined, "data-asks": asks ? '' : undefined, actions: remove ? [{ key: 'remove', label: t('ta.chat.removeShort'), danger: true, run: remove }] : undefined, overlay: menu, onContextMenu: event => openMenu(event, items()) },
106
+ return (React.createElement(SwipeRow, { as: "li", className: "ta-chat-row ta-chat-task", "data-row": ChatHomeUtil.seenKey(task), "data-unseen": unseen && !asks ? '' : undefined, "data-asks": asks ? '' : undefined, actions: remove ? [{ key: 'remove', label: t('ta.chat.removeShort'), danger: true, run: remove }] : undefined, overlay: menu, onContextMenu: event => openMenu(event, items()) },
107
107
  React.createElement("button", { type: "button", className: "ta-chat-item", title: task.title, onClick: open },
108
108
  React.createElement("span", { className: "ta-chat-avatar-box" },
109
109
  React.createElement(TaskIcon, { task: task, size: 38 }),
@@ -28,3 +28,5 @@ export declare function useMinute(): number;
28
28
  export declare function usePageEnd(more: boolean, root: React.RefObject<HTMLElement | null>, end: React.RefObject<HTMLElement | null>, onEnd: () => void,
29
29
  /** What the page drawn is: observed again as it changes. */
30
30
  page: string): void;
31
+ /** A conversation that comes to the top, is pinned or let go slides to its place in the list and in a folder opened, as the others make room. */
32
+ export declare function useChatListMotion(list: React.RefObject<HTMLElement | null>, folder: React.RefObject<HTMLElement | null>): void;
@@ -3,6 +3,7 @@ import * as React from 'react';
3
3
  import { TaState } from '../state/state-protocol.js';
4
4
  import { ChatHomeUtil } from './chat-home-util.js';
5
5
  import { ChatListUtil, PIN_OFFERED, PINNED } from './chat-list-util.js';
6
+ import { useListMotion } from './list-motion.js';
6
7
  /**
7
8
  * What comes as a row of its own (a folder, a row of the home) is pinned the first time it is there, once on any
8
9
  * device (PIN_OFFERED): unpinned by the user, it stays so. Read from the server first, not to write over its pins.
@@ -78,4 +79,9 @@ page) {
78
79
  return () => observer.disconnect();
79
80
  }, [more, page, root, end]);
80
81
  }
82
+ /** A conversation that comes to the top, is pinned or let go slides to its place in the list and in a folder opened, as the others make room. */
83
+ export function useChatListMotion(list, folder) {
84
+ useListMotion(list);
85
+ useListMotion(folder);
86
+ }
81
87
  //# sourceMappingURL=chat-list-hooks.js.map
@@ -90,7 +90,7 @@ export function ChatFolderItem({ folder, time, selected, unseen, pinned, onOpen,
90
90
  const working = folder.sessions.some(session => ChatListUtil.isOpen(session) && session.isStreaming);
91
91
  const pin = { label: t(pinned ? 'ta.chat.unpin' : 'ta.chat.pin'), run: () => onPin(!pinned) };
92
92
  const [menu, openMenu] = useContextMenu();
93
- return (React.createElement(SwipeRow, { as: "li", className: `ta-chat-row ta-chat-folder${selected ? ' ta-selected' : ''}`, "data-unseen": unseen.length > 0 ? '' : undefined, actions: [{ key: 'pin', ...pin }], overlay: menu, onContextMenu: event => openMenu(event, ContextMenuUtil.sections([{ label: t('ta.chat.open'), run: onOpen }], [pin])) },
93
+ return (React.createElement(SwipeRow, { as: "li", className: `ta-chat-row ta-chat-folder${selected ? ' ta-selected' : ''}`, "data-row": folder.key, "data-unseen": unseen.length > 0 ? '' : undefined, actions: [{ key: 'pin', ...pin }], overlay: menu, onContextMenu: event => openMenu(event, ContextMenuUtil.sections([{ label: t('ta.chat.open'), run: onOpen }], [pin])) },
94
94
  React.createElement("button", { type: "button", className: "ta-chat-item", title: `${folder.title} (${folder.sessions.length})`, "aria-current": selected ? 'true' : undefined, onClick: onOpen },
95
95
  React.createElement("span", { className: "ta-chat-avatar-box" },
96
96
  React.createElement(ChatIconTile, { found: folder.icon, size: 38 }),
@@ -158,7 +158,7 @@ export const ChatItem = React.memo(function ChatItem({ session, source, selected
158
158
  // Its directory too for one of a package's group, as a run of a scheduled task, not the package's name.
159
159
  const place = who || session.group ? MessageUtil.basename(session.cwd) : source.label;
160
160
  const ended = task === 'failed' || task === 'stopped' ? task : undefined;
161
- return (React.createElement(SwipeRow, { as: "li", className: `ta-chat-row${selected ? ' ta-selected' : ''}${who ? ` ta-chat-${who.kind}` : ''}`, "data-unseen": unseen && !asks ? '' : undefined, "data-asks": asks ? '' : undefined, actions: swipe, overlay: menu, onContextMenu: onContextMenu },
161
+ return (React.createElement(SwipeRow, { as: "li", className: `ta-chat-row${selected ? ' ta-selected' : ''}${who ? ` ta-chat-${who.kind}` : ''}`, "data-row": ChatListUtil.key(session), "data-unseen": unseen && !asks ? '' : undefined, "data-asks": asks ? '' : undefined, actions: swipe, overlay: menu, onContextMenu: onContextMenu },
162
162
  React.createElement("button", { type: "button", className: `ta-chat-item${compact ? ' ta-compact' : ''}${removing ? ' ta-pending' : ''}`, title: `${title}\n${source.title}`, "aria-current": selected ? 'true' : undefined, onClick: onSelect, ...ScreenUtil.item(ChatListUtil.file(session)) }, compact ? (React.createElement("span", { className: "ta-chat-text" },
163
163
  React.createElement("span", { className: "ta-chat-line" },
164
164
  who && React.createElement(ChatAvatar, { session: session, source: source, who: who, size: 20, mood: mood }),
@@ -5,6 +5,7 @@ import { type StateSpec } from '../state/state-protocol.js';
5
5
  import { type LetGoAsks } from './chat-asks.js';
6
6
  import type { ChatHomeRow, ChatTaskRow } from './chat-home-util.js';
7
7
  import type { ChatFolderIcon } from './chat-icon.js';
8
+ import { type ChatSeen } from './chat-seen.js';
8
9
  /** Where a conversation belongs: the directory of the user's own, or the package that opened it. */
9
10
  export interface ChatSource {
10
11
  /** `dir:<cwd>` or `pkg:<package>`. */
@@ -130,14 +131,25 @@ export declare namespace ChatListUtil {
130
131
  pinned: T[];
131
132
  rest: T[];
132
133
  };
134
+ /**
135
+ * Whether a row said something the user has not seen (ChatSeenUtil.unseen): a saved one answers no more, and what
136
+ * a partner's conversation said till it was seen elsewhere (PartnersUtil.sessions) is seen.
137
+ */
138
+ function unseen(session: ChatEntry, seen: ChatSeen, shown?: string, partnerSessions?: ReadonlyMap<string, number>): boolean;
139
+ /**
140
+ * Which saved conversations of a package's group the list has (`entries`): those that fold into a folder of the
141
+ * list (WebChatIcon.folder), and those of partners (an agent's, PartnersUtil.sessions), the double's list having
142
+ * every conversation with a partner. ta serve opens either again with its group and role, from its file.
143
+ */
144
+ function groupListed(folderOf: ((session: TaSavedSessionInfo) => unknown) | undefined, partnerSessions: ReadonlyMap<string, number> | undefined): ((session: TaSavedSessionInfo) => boolean) | undefined;
133
145
  /**
134
146
  * The open sessions and the saved ones, those archived and those taken out apart. A saved conversation of a
135
- * package's group is not listed: its package opens it again, with its role; unless it folds into a folder of the
136
- * list (`folderOf`, WebChatIcon.folder), which opens it as the package does. An open one is always listed,
147
+ * package's group is not listed: its package opens it again, with its role; unless `listed` has it (groupListed:
148
+ * one that folds into a folder of the list, a partner's). An open one is always listed,
137
149
  * however old, and so is one pinned; a saved one not updated `since` is archived (a ta serve of before lists
138
150
  * them with the others), or not updated since what `sooner` says of it (ChatIconUtil.archiveSince).
139
151
  */
140
- function entries(sessions: TaSessionInfo[], saved: TaSavedSessionInfo[], removed: string[], archived?: TaSavedSessionInfo[], since?: number, pinned?: readonly string[], sooner?: (session: TaSavedSessionInfo) => number | undefined, folderOf?: (session: TaSavedSessionInfo) => unknown): {
152
+ function entries(sessions: TaSessionInfo[], saved: TaSavedSessionInfo[], removed: string[], archived?: TaSavedSessionInfo[], since?: number, pinned?: readonly string[], sooner?: (session: TaSavedSessionInfo) => number | undefined, listed?: (session: TaSavedSessionInfo) => unknown): {
141
153
  listed: ChatEntry[];
142
154
  archived: ChatEntry[];
143
155
  removed: ChatEntry[];
@@ -2,6 +2,7 @@ import { TA_CHAT_PINNED, TaLocation } from '@celljs/ta-protocol';
2
2
  import { StateUtil } from '../state/state-protocol.js';
3
3
  import { MessageUtil } from '../util/message.js';
4
4
  import { ChatAskUtil } from './chat-asks.js';
5
+ import { ChatSeenUtil } from './chat-seen.js';
5
6
  import { PresenceUtil } from './people.js';
6
7
  import { SecretTextUtil } from './secret-text.js';
7
8
  /** The list by directory or package, else by day; in any browser. */
@@ -177,19 +178,40 @@ export var ChatListUtil;
177
178
  return { pinned: rows.filter(row => keys.has(pinKey(row))), rest: rows.filter(row => !keys.has(pinKey(row))) };
178
179
  }
179
180
  ChatListUtil.pinnedApart = pinnedApart;
181
+ /**
182
+ * Whether a row said something the user has not seen (ChatSeenUtil.unseen): a saved one answers no more, and what
183
+ * a partner's conversation said till it was seen elsewhere (PartnersUtil.sessions) is seen.
184
+ */
185
+ function unseen(session, seen, shown, partnerSessions) {
186
+ const at = file(session);
187
+ return ChatSeenUtil.unseen({ ...session, isStreaming: isOpen(session) && session.isStreaming }, at, seen, shown, partnerSessions === null || partnerSessions === void 0 ? void 0 : partnerSessions.get(at));
188
+ }
189
+ ChatListUtil.unseen = unseen;
190
+ /**
191
+ * Which saved conversations of a package's group the list has (`entries`): those that fold into a folder of the
192
+ * list (WebChatIcon.folder), and those of partners (an agent's, PartnersUtil.sessions), the double's list having
193
+ * every conversation with a partner. ta serve opens either again with its group and role, from its file.
194
+ */
195
+ function groupListed(folderOf, partnerSessions) {
196
+ if (!folderOf && !(partnerSessions === null || partnerSessions === void 0 ? void 0 : partnerSessions.size)) {
197
+ return undefined;
198
+ }
199
+ return session => !!(folderOf === null || folderOf === void 0 ? void 0 : folderOf(session)) || !!(partnerSessions === null || partnerSessions === void 0 ? void 0 : partnerSessions.has(session.sessionFile));
200
+ }
201
+ ChatListUtil.groupListed = groupListed;
180
202
  /**
181
203
  * The open sessions and the saved ones, those archived and those taken out apart. A saved conversation of a
182
- * package's group is not listed: its package opens it again, with its role; unless it folds into a folder of the
183
- * list (`folderOf`, WebChatIcon.folder), which opens it as the package does. An open one is always listed,
204
+ * package's group is not listed: its package opens it again, with its role; unless `listed` has it (groupListed:
205
+ * one that folds into a folder of the list, a partner's). An open one is always listed,
184
206
  * however old, and so is one pinned; a saved one not updated `since` is archived (a ta serve of before lists
185
207
  * them with the others), or not updated since what `sooner` says of it (ChatIconUtil.archiveSince).
186
208
  */
187
- function entries(sessions, saved, removed, archived = [], since, pinned = [], sooner, folderOf) {
209
+ function entries(sessions, saved, removed, archived = [], since, pinned = [], sooner, listed) {
188
210
  const open = new Set(sessions.map(session => session.sessionFile));
189
211
  const out = new Set(removed);
190
212
  const seen = new Set();
191
213
  const closed = [...saved, ...archived].filter(session => {
192
- if ((session.group && !(folderOf === null || folderOf === void 0 ? void 0 : folderOf(session))) || open.has(session.sessionFile) || seen.has(session.sessionFile)) {
214
+ if ((session.group && !(listed === null || listed === void 0 ? void 0 : listed(session))) || open.has(session.sessionFile) || seen.has(session.sessionFile)) {
193
215
  return false;
194
216
  }
195
217
  seen.add(session.sessionFile);
@@ -14,10 +14,9 @@ import { ChatBusyUtil } from './chat-busy.js';
14
14
  import { ChatHomeItem, ChatHomeTop, ChatTaskItem } from './chat-home.js';
15
15
  import { ChatHomeUtil } from './chat-home-util.js';
16
16
  import { ChatIconTile, ChatIconUtil } from './chat-icon.js';
17
- import { useMinute, useOfferPins, usePageEnd, useReadArchive } from './chat-list-hooks.js';
17
+ import { useChatListMotion, useMinute, useOfferPins, usePageEnd, useReadArchive } from './chat-list-hooks.js';
18
18
  import { ChatFolderItem, ChatItem } from './chat-list-row.js';
19
19
  import { CHAT_PAGE, ChatListUtil } from './chat-list-util.js';
20
- import { ChatSeenUtil } from './chat-seen.js';
21
20
  import { EmptyState } from './empty-state.js';
22
21
  import { HostTag } from './host-tag.js';
23
22
  import { Icon, IconButton } from './icon.js';
@@ -104,9 +103,11 @@ export function ChatList({ sessions, saved, removed: removedFiles, archived: arc
104
103
  const sooner = React.useMemo(() => ChatIconUtil.archiveSince(icons.entries, now), [icons, now]);
105
104
  // Those an extension folds into a row of their folder (WebChatIcon.folder), asked again as its icons change.
106
105
  const folderOf = React.useMemo(() => ChatIconUtil.folderOf(icons.entries), [icons]);
106
+ const partnerSessions = home === null || home === void 0 ? void 0 : home.partnerSessions; // The agents' conversations, listed once closed too.
107
+ const groupListed = React.useMemo(() => ChatListUtil.groupListed(folderOf, partnerSessions), [folderOf, partnerSessions]);
107
108
  // One that waits for the user is not archived, however old, as one pinned.
108
109
  const kept = React.useMemo(() => ChatListUtil.keptFiles([...saved, ...(archivedSaved !== null && archivedSaved !== void 0 ? archivedSaved : [])], pinned, letGo), [saved, archivedSaved, pinned, letGo]);
109
- const { listed, archived, removed } = React.useMemo(() => ChatListUtil.entries(sessions, saved, removedFiles, archivedSaved, since, kept, sooner, folderOf), [sessions, saved, removedFiles, archivedSaved, since, kept, sooner, folderOf]);
110
+ const { listed, archived, removed } = React.useMemo(() => ChatListUtil.entries(sessions, saved, removedFiles, archivedSaved, since, kept, sooner, groupListed), [sessions, saved, removedFiles, archivedSaved, since, kept, sooner, groupListed]);
110
111
  // A folder pinned holds its archived conversations too, and stays once they all are: a row pinned never goes away.
111
112
  const { held, rest: archivedRest } = React.useMemo(() => ChatListUtil.heldByPinned(archived, folderOf, pinned), [archived, folderOf, pinned]);
112
113
  const sources = React.useMemo(() => ChatListUtil.sources(listed), [listed]);
@@ -163,7 +164,7 @@ export function ChatList({ sessions, saved, removed: removedFiles, archived: arc
163
164
  const fold = (key) => onFolded(folded.includes(key) ? folded.filter(other => other !== key) : [...folded, key]);
164
165
  const byKey = React.useMemo(() => new Map([...sources, ...ChatListUtil.sources([...archived, ...removed])].map(candidate => [candidate.key, candidate])), [sources, archived, removed]);
165
166
  const isSelected = (session) => (typeof session === 'string' ? session : ChatListUtil.key(session)) === selected;
166
- const isUnseen = (session) => ChatSeenUtil.unseen({ ...session, isStreaming: ChatListUtil.isOpen(session) && session.isStreaming }, ChatListUtil.file(session), seen, inFront);
167
+ const isUnseen = (session) => ChatListUtil.unseen(session, seen, inFront, partnerSessions);
167
168
  // What is folded or not drawn yet still has the conversation shown, and those unseen: the dot of the tab finds them.
168
169
  const stays = (session) => isSelected(session) || isUnseen(session);
169
170
  const taskUnseen = (task) => ChatHomeUtil.unseen(task, seen);
@@ -300,7 +301,6 @@ export function ChatList({ sessions, saved, removed: removedFiles, archived: arc
300
301
  const toggle = (label, open, onClick, title) => (React.createElement("button", { type: "button", className: "ta-chat-section-title ta-chat-fold", "aria-expanded": open, title: title, onClick: onClick },
301
302
  React.createElement(Icon, { icon: ChevronRight, size: 13 }),
302
303
  label));
303
- // The rows in the order of the list, as far as the budget goes: what is drawn after uses what is left.
304
304
  // A group of the list by directory: its head, and its conversations, those older folded.
305
305
  const groupSection = (key, head, sessions) => {
306
306
  const closed = folded.includes(key);
@@ -444,6 +444,7 @@ export function ChatList({ sessions, saved, removed: removedFiles, archived: arc
444
444
  const pageKey = `${pageCount}:${query}`;
445
445
  usePageEnd(budget.more && !(folderOpen && !handheld), scroller, end, nextPage, pageKey);
446
446
  usePageEnd(!!folder && folderBudget.more, folderScroller, folderEnd, nextPage, pageKey);
447
+ useChatListMotion(scroller, folderScroller);
447
448
  const head = (React.createElement("header", { className: "ta-chats-head" },
448
449
  React.createElement("label", { className: "ta-chats-search" },
449
450
  React.createElement(Icon, { icon: Search, size: 15 }),
@@ -21,13 +21,14 @@ export declare namespace ChatSeenUtil {
21
21
  function merge(a: ChatSeen, b: ChatSeen): ChatSeen;
22
22
  /**
23
23
  * Whether it said something the user has not seen: it is not answering now, not the one in front, and its
24
- * last message came after the user last saw it at rest (or, never seen, after `since`).
24
+ * last message came after the user last saw it at rest (or, never seen, after `since`), and after `seenElsewhere`
25
+ * (an agent's answers read in a group chat, WebPartnerChat.seenAt).
25
26
  */
26
27
  function unseen(entry: {
27
28
  updatedAt: number;
28
29
  messageCount: number;
29
30
  isStreaming?: boolean;
30
- }, file: string, seen: ChatSeen, shown?: string): boolean;
31
+ }, file: string, seen: ChatSeen, shown?: string, seenElsewhere?: number): boolean;
31
32
  /**
32
33
  * Whether any of the conversations the list shows (ChatListUtil.entries, those listed) said something unseen:
33
34
  * the dot on the tab of the chats. Only those: one the list leaves out (a package's, closed) has no row to find.
@@ -38,7 +39,7 @@ export declare namespace ChatSeenUtil {
38
39
  isStreaming?: boolean;
39
40
  sessionFile?: string;
40
41
  sessionId?: string;
41
- }[], seen: ChatSeen, shown?: string): boolean;
42
+ }[], seen: ChatSeen, shown?: string, elsewhere?: ReadonlyMap<string, number>): boolean;
42
43
  /**
43
44
  * Everything seen at once, as the user drags the dot of the tab away: kept since the latest of now and of what
44
45
  * the conversations said last (the clocks of the page and the computer may differ). One answering goes on, and
@@ -70,26 +70,27 @@ export var ChatSeenUtil;
70
70
  ChatSeenUtil.merge = merge;
71
71
  /**
72
72
  * Whether it said something the user has not seen: it is not answering now, not the one in front, and its
73
- * last message came after the user last saw it at rest (or, never seen, after `since`).
73
+ * last message came after the user last saw it at rest (or, never seen, after `since`), and after `seenElsewhere`
74
+ * (an agent's answers read in a group chat, WebPartnerChat.seenAt).
74
75
  */
75
- function unseen(entry, file, seen, shown) {
76
+ function unseen(entry, file, seen, shown, seenElsewhere = 0) {
76
77
  var _a;
77
78
  return (seen.since > 0 &&
78
79
  file !== shown &&
79
80
  !entry.isStreaming &&
80
81
  entry.messageCount > 0 &&
81
- (entry.updatedAt > ((_a = seen.at[file]) !== null && _a !== void 0 ? _a : seen.since) || marked(seen, file)));
82
+ (entry.updatedAt > Math.max((_a = seen.at[file]) !== null && _a !== void 0 ? _a : seen.since, seenElsewhere) || marked(seen, file)));
82
83
  }
83
84
  ChatSeenUtil.unseen = unseen;
84
85
  /**
85
86
  * Whether any of the conversations the list shows (ChatListUtil.entries, those listed) said something unseen:
86
87
  * the dot on the tab of the chats. Only those: one the list leaves out (a package's, closed) has no row to find.
87
88
  */
88
- function anyUnseen(entries, seen, shown) {
89
+ function anyUnseen(entries, seen, shown, elsewhere) {
89
90
  return entries.some(entry => {
90
91
  var _a, _b;
91
92
  const file = (_b = (_a = entry.sessionFile) !== null && _a !== void 0 ? _a : entry.sessionId) !== null && _b !== void 0 ? _b : '';
92
- return !!file && unseen(entry, file, seen, shown);
93
+ return !!file && unseen(entry, file, seen, shown, elsewhere === null || elsewhere === void 0 ? void 0 : elsewhere.get(file));
93
94
  });
94
95
  }
95
96
  ChatSeenUtil.anyUnseen = anyUnseen;
@@ -0,0 +1,30 @@
1
+ import type { TaSavedSessionInfo, TaSessionInfo } from '@celljs/ta-protocol';
2
+ import type { TaWebExtensions, WebExtensionsState } from '../extension/web-extension-protocol.js';
3
+ import type { LetGoAsks } from './chat-asks.js';
4
+ import { type ChatEntry } from './chat-list-util.js';
5
+ import { type ChatSeen } from './chat-seen.js';
6
+ /** What the dot of the chats reads of the page. */
7
+ export interface ChatsDotInput {
8
+ sessions: readonly TaSessionInfo[];
9
+ saved: readonly TaSavedSessionInfo[];
10
+ removed: string[];
11
+ pinned: readonly string[];
12
+ letGo: LetGoAsks;
13
+ archiveDays: number;
14
+ seen: ChatSeen;
15
+ /** The conversation in front of the user, by its session id. */
16
+ looking?: string;
17
+ extensions: WebExtensionsState;
18
+ host: TaWebExtensions;
19
+ }
20
+ /**
21
+ * The amber dot of the chats' tab and of the double's entry on the rail, on while a row of the double's list has one,
22
+ * as a messenger's: a conversation it lists (those folded into a folder and the agents' too, but those quiet: a call),
23
+ * and, where the list is the double's, a row of its home, a conversation with a partner that is none of pi (a group
24
+ * chat, a chat of two) and a task that is no conversation. `listed`: the conversations it lists, which dragging the dot
25
+ * away sees; a row of the home or a partner's keeps its dot till it is opened, as on its row.
26
+ */
27
+ export declare function useChatsDot(input: ChatsDotInput): {
28
+ listed: ChatEntry[];
29
+ unseen: boolean;
30
+ };