@celljs/ta-web 4.46.2 → 4.47.0
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.
- package/esm/browser/account/account-side.d.ts +3 -3
- package/esm/browser/account/account-side.js +11 -21
- package/esm/browser/account/device-account.d.ts +8 -0
- package/esm/browser/account/device-account.js +20 -0
- package/esm/browser/chat/chat-protocol.d.ts +7 -0
- package/esm/browser/chat/chat-view.js +1 -1
- package/esm/browser/chat/chat.d.ts +1 -0
- package/esm/browser/chat/chat.js +15 -3
- package/esm/browser/chat/draft-model.d.ts +1 -1
- package/esm/browser/chat/draft-model.js +2 -2
- package/esm/browser/components/access-view.js +12 -10
- package/esm/browser/components/account-menu.d.ts +2 -0
- package/esm/browser/components/account-menu.js +11 -2
- package/esm/browser/components/account-view.js +9 -5
- package/esm/browser/components/app-nav.js +4 -1
- package/esm/browser/components/app-shell-state.d.ts +2 -0
- package/esm/browser/components/app-update-view.d.ts +2 -0
- package/esm/browser/components/app-update-view.js +37 -0
- package/esm/browser/components/app-view.js +33 -108
- package/esm/browser/components/auth-guide.d.ts +25 -0
- package/esm/browser/components/auth-guide.js +44 -0
- package/esm/browser/components/auth-view.d.ts +2 -0
- package/esm/browser/components/auth-view.js +30 -9
- package/esm/browser/components/chat-list-controls.d.ts +38 -0
- package/esm/browser/components/chat-list-controls.js +46 -0
- package/esm/browser/components/chat-list-hooks.d.ts +19 -0
- package/esm/browser/components/chat-list-hooks.js +52 -0
- package/esm/browser/components/chat-list-rows.d.ts +51 -0
- package/esm/browser/components/chat-list-rows.js +110 -0
- package/esm/browser/components/chat-list-sections.d.ts +36 -0
- package/esm/browser/components/chat-list-sections.js +72 -0
- package/esm/browser/components/chat-list.js +48 -221
- package/esm/browser/components/cloud-sign-in-view.d.ts +1 -1
- package/esm/browser/components/cloud-sign-in-view.js +4 -1
- package/esm/browser/components/custom-provider-util.d.ts +2 -0
- package/esm/browser/components/custom-provider-util.js +5 -0
- package/esm/browser/components/custom-provider-view.js +33 -12
- package/esm/browser/components/device-sign-in-page.js +4 -5
- package/esm/browser/components/discover-view.d.ts +8 -1
- package/esm/browser/components/discover-view.js +28 -3
- package/esm/browser/components/environment-view.js +60 -62
- package/esm/browser/components/extension-settings.js +1 -0
- package/esm/browser/components/first-steps-util.d.ts +29 -0
- package/esm/browser/components/first-steps-util.js +41 -0
- package/esm/browser/components/first-steps.d.ts +3 -0
- package/esm/browser/components/first-steps.js +36 -0
- package/esm/browser/components/host-view.d.ts +3 -3
- package/esm/browser/components/host-view.js +11 -11
- package/esm/browser/components/me-rows.d.ts +8 -1
- package/esm/browser/components/me-rows.js +3 -3
- package/esm/browser/components/me-view.js +1 -1
- package/esm/browser/components/message-user.js +6 -3
- package/esm/browser/components/model-picker.d.ts +5 -0
- package/esm/browser/components/model-picker.js +10 -1
- package/esm/browser/components/nav-places.d.ts +14 -0
- package/esm/browser/components/nav-places.js +11 -0
- package/esm/browser/components/phone-shell.d.ts +14 -0
- package/esm/browser/components/phone-shell.js +22 -0
- package/esm/browser/components/picture-dialog.js +4 -7
- package/esm/browser/components/profile-view.js +1 -1
- package/esm/browser/components/relay-services.js +4 -7
- package/esm/browser/components/relay-view-util.d.ts +5 -0
- package/esm/browser/components/relay-view-util.js +14 -0
- package/esm/browser/components/relay-view.js +40 -37
- package/esm/browser/components/scan-screen.js +5 -8
- package/esm/browser/components/screen-navigator.d.ts +9 -0
- package/esm/browser/components/screen-navigator.js +84 -0
- package/esm/browser/components/search-page.js +9 -2
- package/esm/browser/components/serve-value.d.ts +27 -0
- package/esm/browser/components/serve-value.js +61 -0
- package/esm/browser/components/serve-watch.d.ts +23 -0
- package/esm/browser/components/serve-watch.js +36 -0
- package/esm/browser/components/settings-choices.js +2 -0
- package/esm/browser/components/settings-controls.d.ts +15 -0
- package/esm/browser/components/settings-controls.js +13 -0
- package/esm/browser/components/settings-more.js +6 -4
- package/esm/browser/components/settings-parts.d.ts +3 -1
- package/esm/browser/components/settings-parts.js +3 -0
- package/esm/browser/components/settings-view.js +37 -11
- package/esm/browser/components/share-friends.js +3 -4
- package/esm/browser/components/share-sheet.js +3 -4
- package/esm/browser/components/tool-view.js +17 -3
- package/esm/browser/device/app-update.d.ts +62 -0
- package/esm/browser/device/app-update.js +144 -0
- package/esm/browser/extension/icons.js +2 -1
- package/esm/browser/extension/web-api-contributions.d.ts +6 -1
- package/esm/browser/extension/web-api-partners.d.ts +6 -0
- package/esm/browser/extension/web-api-spec.js +1 -0
- package/esm/browser/extension/web-home.js +9 -0
- package/esm/browser/extension/web-metrics.d.ts +3 -0
- package/esm/browser/extension/web-metrics.js +33 -22
- package/esm/browser/extension/web-pages.d.ts +3 -1
- package/esm/browser/extension/web-pages.js +1 -0
- package/esm/browser/gateway/console-agents.js +11 -15
- package/esm/browser/gateway/console-parts.d.ts +7 -4
- package/esm/browser/gateway/console-parts.js +11 -20
- package/esm/browser/gateway/console-trend.js +2 -2
- package/esm/browser/gateway/console-updates.js +6 -4
- package/esm/browser/gateway/console-view.js +6 -6
- package/esm/browser/i18n/en/account.d.ts +7 -0
- package/esm/browser/i18n/en/account.js +13 -6
- package/esm/browser/i18n/en/chat.d.ts +2 -0
- package/esm/browser/i18n/en/chat.js +2 -0
- package/esm/browser/i18n/en/discover.d.ts +3 -0
- package/esm/browser/i18n/en/discover.js +3 -0
- package/esm/browser/i18n/en/service.d.ts +6 -0
- package/esm/browser/i18n/en/service.js +6 -0
- package/esm/browser/i18n/en/settings.d.ts +3 -0
- package/esm/browser/i18n/en/settings.js +3 -0
- package/esm/browser/i18n/ja/account.js +13 -6
- package/esm/browser/i18n/ja/chat.js +2 -0
- package/esm/browser/i18n/ja/discover.js +3 -0
- package/esm/browser/i18n/ja/service.js +6 -0
- package/esm/browser/i18n/ja/settings.js +3 -0
- package/esm/browser/i18n/locales.d.ts +22 -1
- package/esm/browser/i18n/messages.d.ts +21 -0
- package/esm/browser/i18n/zh/account.js +13 -6
- package/esm/browser/i18n/zh/chat.js +2 -0
- package/esm/browser/i18n/zh/discover.js +3 -0
- package/esm/browser/i18n/zh/service.js +6 -0
- package/esm/browser/i18n/zh/settings.js +3 -0
- package/esm/browser/i18n/zh-tw/account.js +13 -6
- package/esm/browser/i18n/zh-tw/chat.js +2 -0
- package/esm/browser/i18n/zh-tw/discover.js +3 -0
- package/esm/browser/i18n/zh-tw/service.js +6 -0
- package/esm/browser/i18n/zh-tw/settings.js +3 -0
- package/esm/browser/notices/notices.d.ts +2 -0
- package/esm/browser/notices/notices.js +2 -0
- package/esm/browser/partners/group-picker.js +3 -4
- package/esm/browser/sandbox/sandbox-runtime-code.js +1 -1
- package/esm/browser/settings/settings-protocol.d.ts +5 -0
- package/esm/browser/settings/settings-protocol.js +2 -0
- package/esm/browser/style/chat-list.d.ts +1 -1
- package/esm/browser/style/chat-list.js +4 -3
- package/esm/browser/style/dialogs.d.ts +1 -1
- package/esm/browser/style/dialogs.js +7 -0
- package/esm/browser/style/pages.d.ts +1 -1
- package/esm/browser/style/pages.js +5 -3
- package/esm/browser/style/shell.d.ts +1 -1
- package/esm/browser/style/shell.js +1 -1
- package/esm/browser/util/tool.d.ts +5 -0
- package/esm/browser/util/tool.js +21 -3
- package/lib/browser/account/account-side.d.ts +3 -3
- package/lib/browser/account/account-side.js +11 -21
- package/lib/browser/account/device-account.d.ts +8 -0
- package/lib/browser/account/device-account.js +20 -0
- package/lib/browser/chat/chat-protocol.d.ts +7 -0
- package/lib/browser/chat/chat-view.js +1 -1
- package/lib/browser/chat/chat.d.ts +1 -0
- package/lib/browser/chat/chat.js +14 -2
- package/lib/browser/chat/draft-model.d.ts +1 -1
- package/lib/browser/chat/draft-model.js +2 -2
- package/lib/browser/components/access-view.js +12 -10
- package/lib/browser/components/account-menu.d.ts +2 -0
- package/lib/browser/components/account-menu.js +11 -2
- package/lib/browser/components/account-view.js +9 -5
- package/lib/browser/components/app-nav.js +3 -0
- package/lib/browser/components/app-shell-state.d.ts +2 -0
- package/lib/browser/components/app-update-view.d.ts +3 -0
- package/lib/browser/components/app-update-view.js +73 -0
- package/lib/browser/components/app-view.js +30 -105
- package/lib/browser/components/auth-guide.d.ts +26 -0
- package/lib/browser/components/auth-guide.js +47 -0
- package/lib/browser/components/auth-view.d.ts +2 -0
- package/lib/browser/components/auth-view.js +29 -8
- package/lib/browser/components/chat-list-controls.d.ts +39 -0
- package/lib/browser/components/chat-list-controls.js +86 -0
- package/lib/browser/components/chat-list-hooks.d.ts +19 -0
- package/lib/browser/components/chat-list-hooks.js +53 -0
- package/lib/browser/components/chat-list-rows.d.ts +52 -0
- package/lib/browser/components/chat-list-rows.js +147 -0
- package/lib/browser/components/chat-list-sections.d.ts +37 -0
- package/lib/browser/components/chat-list-sections.js +108 -0
- package/lib/browser/components/chat-list.js +44 -217
- package/lib/browser/components/cloud-sign-in-view.d.ts +1 -1
- package/lib/browser/components/cloud-sign-in-view.js +4 -1
- package/lib/browser/components/custom-provider-util.d.ts +2 -0
- package/lib/browser/components/custom-provider-util.js +5 -0
- package/lib/browser/components/custom-provider-view.js +32 -11
- package/lib/browser/components/device-sign-in-page.js +4 -5
- package/lib/browser/components/discover-view.d.ts +8 -1
- package/lib/browser/components/discover-view.js +27 -2
- package/lib/browser/components/environment-view.js +60 -62
- package/lib/browser/components/extension-settings.js +1 -0
- package/lib/browser/components/first-steps-util.d.ts +30 -0
- package/lib/browser/components/first-steps-util.js +44 -0
- package/lib/browser/components/first-steps.d.ts +4 -0
- package/lib/browser/components/first-steps.js +72 -0
- package/lib/browser/components/host-view.d.ts +3 -3
- package/lib/browser/components/host-view.js +11 -11
- package/lib/browser/components/me-rows.d.ts +8 -1
- package/lib/browser/components/me-rows.js +3 -3
- package/lib/browser/components/me-view.js +1 -1
- package/lib/browser/components/message-user.js +5 -2
- package/lib/browser/components/model-picker.d.ts +5 -0
- package/lib/browser/components/model-picker.js +10 -1
- package/lib/browser/components/nav-places.d.ts +14 -0
- package/lib/browser/components/nav-places.js +13 -1
- package/lib/browser/components/phone-shell.d.ts +14 -0
- package/lib/browser/components/phone-shell.js +23 -0
- package/lib/browser/components/picture-dialog.js +4 -7
- package/lib/browser/components/profile-view.js +1 -1
- package/lib/browser/components/relay-services.js +4 -7
- package/lib/browser/components/relay-view-util.d.ts +6 -0
- package/lib/browser/components/relay-view-util.js +17 -0
- package/lib/browser/components/relay-view.js +38 -35
- package/lib/browser/components/scan-screen.js +5 -8
- package/lib/browser/components/screen-navigator.d.ts +9 -0
- package/lib/browser/components/screen-navigator.js +85 -0
- package/lib/browser/components/search-page.js +8 -1
- package/lib/browser/components/serve-value.d.ts +28 -0
- package/lib/browser/components/serve-value.js +97 -0
- package/lib/browser/components/serve-watch.d.ts +24 -0
- package/lib/browser/components/serve-watch.js +39 -0
- package/lib/browser/components/settings-choices.js +2 -0
- package/lib/browser/components/settings-controls.d.ts +15 -0
- package/lib/browser/components/settings-controls.js +13 -0
- package/lib/browser/components/settings-more.js +6 -4
- package/lib/browser/components/settings-parts.d.ts +3 -1
- package/lib/browser/components/settings-parts.js +3 -0
- package/lib/browser/components/settings-view.js +36 -10
- package/lib/browser/components/share-friends.js +3 -4
- package/lib/browser/components/share-sheet.js +3 -4
- package/lib/browser/components/tool-view.js +17 -3
- package/lib/browser/device/app-update.d.ts +63 -0
- package/lib/browser/device/app-update.js +182 -0
- package/lib/browser/extension/icons.js +1 -0
- package/lib/browser/extension/web-api-contributions.d.ts +6 -1
- package/lib/browser/extension/web-api-partners.d.ts +6 -0
- package/lib/browser/extension/web-api-spec.js +1 -0
- package/lib/browser/extension/web-home.js +9 -0
- package/lib/browser/extension/web-metrics.d.ts +3 -0
- package/lib/browser/extension/web-metrics.js +32 -21
- package/lib/browser/extension/web-pages.d.ts +3 -1
- package/lib/browser/extension/web-pages.js +1 -0
- package/lib/browser/gateway/console-agents.js +10 -14
- package/lib/browser/gateway/console-parts.d.ts +7 -4
- package/lib/browser/gateway/console-parts.js +12 -21
- package/lib/browser/gateway/console-trend.js +1 -1
- package/lib/browser/gateway/console-updates.js +5 -3
- package/lib/browser/gateway/console-view.js +5 -5
- package/lib/browser/i18n/en/account.d.ts +7 -0
- package/lib/browser/i18n/en/account.js +13 -6
- package/lib/browser/i18n/en/chat.d.ts +2 -0
- package/lib/browser/i18n/en/chat.js +2 -0
- package/lib/browser/i18n/en/discover.d.ts +3 -0
- package/lib/browser/i18n/en/discover.js +3 -0
- package/lib/browser/i18n/en/service.d.ts +6 -0
- package/lib/browser/i18n/en/service.js +6 -0
- package/lib/browser/i18n/en/settings.d.ts +3 -0
- package/lib/browser/i18n/en/settings.js +3 -0
- package/lib/browser/i18n/ja/account.js +13 -6
- package/lib/browser/i18n/ja/chat.js +2 -0
- package/lib/browser/i18n/ja/discover.js +3 -0
- package/lib/browser/i18n/ja/service.js +6 -0
- package/lib/browser/i18n/ja/settings.js +3 -0
- package/lib/browser/i18n/locales.d.ts +22 -1
- package/lib/browser/i18n/messages.d.ts +21 -0
- package/lib/browser/i18n/zh/account.js +13 -6
- package/lib/browser/i18n/zh/chat.js +2 -0
- package/lib/browser/i18n/zh/discover.js +3 -0
- package/lib/browser/i18n/zh/service.js +6 -0
- package/lib/browser/i18n/zh/settings.js +3 -0
- package/lib/browser/i18n/zh-tw/account.js +13 -6
- package/lib/browser/i18n/zh-tw/chat.js +2 -0
- package/lib/browser/i18n/zh-tw/discover.js +3 -0
- package/lib/browser/i18n/zh-tw/service.js +6 -0
- package/lib/browser/i18n/zh-tw/settings.js +3 -0
- package/lib/browser/notices/notices.d.ts +2 -0
- package/lib/browser/notices/notices.js +3 -1
- package/lib/browser/partners/group-picker.js +3 -4
- package/lib/browser/sandbox/sandbox-runtime-code.js +1 -1
- package/lib/browser/settings/settings-protocol.d.ts +5 -0
- package/lib/browser/settings/settings-protocol.js +2 -0
- package/lib/browser/style/chat-list.d.ts +1 -1
- package/lib/browser/style/chat-list.js +4 -3
- package/lib/browser/style/dialogs.d.ts +1 -1
- package/lib/browser/style/dialogs.js +7 -0
- package/lib/browser/style/pages.d.ts +1 -1
- package/lib/browser/style/pages.js +5 -3
- package/lib/browser/style/shell.d.ts +1 -1
- package/lib/browser/style/shell.js +1 -1
- package/lib/browser/util/tool.d.ts +5 -0
- package/lib/browser/util/tool.js +21 -3
- package/package.json +7 -7
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.drawChatSections = drawChatSections;
|
|
37
|
+
const lucide_react_1 = require("lucide-react");
|
|
38
|
+
const React = __importStar(require("react"));
|
|
39
|
+
const chat_icon_1 = require("./chat-icon");
|
|
40
|
+
const chat_list_controls_1 = require("./chat-list-controls");
|
|
41
|
+
const chat_list_util_1 = require("./chat-list-util");
|
|
42
|
+
const icon_1 = require("./icon");
|
|
43
|
+
const ta_avatar_1 = require("./ta-avatar");
|
|
44
|
+
/**
|
|
45
|
+
* The sections of the list, by directory or by day: called as the list renders, not drawn as a component of its own,
|
|
46
|
+
* for the budget is taken in the order the list is drawn.
|
|
47
|
+
*/
|
|
48
|
+
function drawChatSections({ grouped, rest, sources, folders, taskRows, homeRest, folded, fold, foldBefore, foldDays, groupsOlder, setGroupsOlder, olderOpen, setOlderOpen, budget, rowStays, rowItem, draftIn, now, t, }) {
|
|
49
|
+
// A group of the list by directory: its head, and its conversations, those older folded.
|
|
50
|
+
const groupSection = (key, head, sessions) => {
|
|
51
|
+
const closed = folded.includes(key);
|
|
52
|
+
const [recent, older] = chat_list_util_1.ChatListUtil.split(sessions, foldBefore);
|
|
53
|
+
const olderShown = groupsOlder.includes(key);
|
|
54
|
+
// Folded, a group still has the conversation shown and those unseen; so do its older ones.
|
|
55
|
+
const candidates = closed ? sessions.filter(rowStays) : olderShown ? sessions : [...recent, ...older.filter(rowStays)];
|
|
56
|
+
const rows = budget.take(candidates);
|
|
57
|
+
if (rows.length === 0 && candidates.length > 0) {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
return (React.createElement("section", { key: key, className: "ta-chat-group" },
|
|
61
|
+
head,
|
|
62
|
+
rows.length > 0 && React.createElement("ul", { className: "ta-side-list" }, rows.map(row => rowItem(row, true))),
|
|
63
|
+
!closed && older.length > 0 && rows.length === candidates.length && (React.createElement(chat_list_controls_1.ChatFoldToggle, { label: t('ta.chat.olderCount', { days: foldDays, count: older.length }), open: olderShown, onClick: () => setGroupsOlder(olderShown ? groupsOlder.filter(other => other !== key) : [...groupsOlder, key]) }))));
|
|
64
|
+
};
|
|
65
|
+
// The rows in the order of the list, as far as the budget goes: what is drawn after uses what is left. By
|
|
66
|
+
// directory, a folder is a group as a directory is, where its latest is.
|
|
67
|
+
// By directory, the double's tasks that are no conversation are a group of their own, where the latest of them is.
|
|
68
|
+
const doubleRows = [...homeRest, ...taskRows].sort((a, b) => b.updatedAt - a.updatedAt);
|
|
69
|
+
const taskGroup = grouped &&
|
|
70
|
+
doubleRows.length > 0 &&
|
|
71
|
+
groupSection('tasks', React.createElement(chat_list_controls_1.ChatGroupHead, { open: !folded.includes('tasks'), onFold: () => fold('tasks'), leading: React.createElement(ta_avatar_1.DinoFace, { size: 20, mood: "idle" }), label: t('ta.home.tasks'), count: doubleRows.length }), doubleRows);
|
|
72
|
+
return grouped
|
|
73
|
+
? [
|
|
74
|
+
...(taskGroup ? [{ latest: doubleRows[0].updatedAt, group: undefined, folder: undefined, tasks: taskGroup }] : []),
|
|
75
|
+
...chat_list_util_1.ChatListUtil.groups(rest, sources).map(group => { var _a; var _b; return ({ latest: (_b = (_a = group.sessions[0]) === null || _a === void 0 ? void 0 : _a.updatedAt) !== null && _b !== void 0 ? _b : 0, group, folder: undefined }); }),
|
|
76
|
+
...folders.map(folder => ({ latest: folder.updatedAt, group: undefined, folder })),
|
|
77
|
+
]
|
|
78
|
+
.sort((a, b) => b.latest - a.latest)
|
|
79
|
+
.map(({ group, folder, tasks }) => {
|
|
80
|
+
if (tasks) {
|
|
81
|
+
return tasks;
|
|
82
|
+
}
|
|
83
|
+
if (folder) {
|
|
84
|
+
return groupSection(folder.key, React.createElement(chat_list_controls_1.ChatGroupHead, { open: !folded.includes(folder.key), title: folder.title, onFold: () => fold(folder.key), leading: React.createElement(chat_icon_1.ChatIconTile, { found: folder.icon, size: 20 }), label: folder.title, count: folder.sessions.length }), folder.sessions);
|
|
85
|
+
}
|
|
86
|
+
const { source, sessions } = group;
|
|
87
|
+
return groupSection(source.key, React.createElement(chat_list_controls_1.ChatGroupHead, { open: !folded.includes(source.key), title: source.title, onFold: () => fold(source.key), leading: React.createElement(chat_list_controls_1.ChatSourceMark, { source: source }), label: source.label, count: sessions.length }, source.cwd && (React.createElement(icon_1.IconButton, { className: "ta-chat-group-add", icon: lucide_react_1.Plus, label: t('ta.chat.newIn', { name: source.label }), onClick: () => draftIn(source.cwd) }))), sessions);
|
|
88
|
+
})
|
|
89
|
+
: (() => {
|
|
90
|
+
const [recent, older] = chat_list_util_1.ChatListUtil.split(chat_list_util_1.ChatListUtil.withFolders(rest, [...folders, ...taskRows, ...homeRest]), foldBefore);
|
|
91
|
+
const sections = chat_list_util_1.ChatListUtil.sections(recent, now).map(section => {
|
|
92
|
+
const rows = budget.take(section.sessions);
|
|
93
|
+
return (rows.length > 0 && (React.createElement("section", { key: section.id, className: "ta-chat-section" },
|
|
94
|
+
React.createElement("div", { className: "ta-chat-section-title" }, t(section.id)),
|
|
95
|
+
React.createElement("ul", { className: "ta-side-list" }, rows.map(row => rowItem(row))))));
|
|
96
|
+
});
|
|
97
|
+
// Folded, the older still have the conversation shown and those unseen, drawn even before the rows above them are.
|
|
98
|
+
const cut = budget.more;
|
|
99
|
+
const olderRows = older.length > 0 ? budget.take(olderOpen ? older : older.filter(rowStays)) : [];
|
|
100
|
+
return [
|
|
101
|
+
...sections,
|
|
102
|
+
older.length > 0 && (!cut || olderRows.length > 0) && (React.createElement("section", { key: "older", className: "ta-chat-section ta-chat-older" },
|
|
103
|
+
React.createElement(chat_list_controls_1.ChatFoldToggle, { label: t('ta.chat.olderCount', { days: foldDays, count: older.length }), open: olderOpen, onClick: () => setOlderOpen(!olderOpen) }),
|
|
104
|
+
olderRows.length > 0 && React.createElement("ul", { className: "ta-side-list" }, olderRows.map(row => rowItem(row))))),
|
|
105
|
+
];
|
|
106
|
+
})();
|
|
107
|
+
}
|
|
108
|
+
//# sourceMappingURL=chat-list-sections.js.map
|
|
@@ -43,22 +43,19 @@ const use_composer_draft_1 = require("../drafts/use-composer-draft");
|
|
|
43
43
|
const extension_view_1 = require("../extension/extension-view");
|
|
44
44
|
const use_t_1 = require("../i18n/use-t");
|
|
45
45
|
const screen_protocol_1 = require("../screen/screen-protocol");
|
|
46
|
-
const use_screen_part_1 = require("../screen/use-screen-part");
|
|
47
|
-
const workbench_util_1 = require("../workbench-util");
|
|
48
46
|
const chat_asks_1 = require("./chat-asks");
|
|
49
|
-
const chat_busy_1 = require("./chat-busy");
|
|
50
47
|
const chat_home_1 = require("./chat-home");
|
|
51
48
|
const chat_home_util_1 = require("./chat-home-util");
|
|
52
|
-
const
|
|
49
|
+
const chat_list_controls_1 = require("./chat-list-controls");
|
|
53
50
|
const chat_list_hooks_1 = require("./chat-list-hooks");
|
|
54
51
|
const chat_list_row_1 = require("./chat-list-row");
|
|
52
|
+
const chat_list_rows_1 = require("./chat-list-rows");
|
|
53
|
+
const chat_list_sections_1 = require("./chat-list-sections");
|
|
55
54
|
const chat_list_util_1 = require("./chat-list-util");
|
|
56
55
|
const empty_state_1 = require("./empty-state");
|
|
57
|
-
const host_tag_1 = require("./host-tag");
|
|
58
56
|
const icon_1 = require("./icon");
|
|
59
57
|
const loading_1 = require("./loading");
|
|
60
58
|
const phone_shell_1 = require("./phone-shell");
|
|
61
|
-
const ta_avatar_1 = require("./ta-avatar");
|
|
62
59
|
/**
|
|
63
60
|
* The conversations of the server, open or saved, the latest first, with a search and `+` for a new one:
|
|
64
61
|
* by directory or package, each group folding and with a `+` of its own, or by day. Those not updated for
|
|
@@ -122,61 +119,7 @@ function ChatList({ sessions, saved, removed: removedFiles, archived: archivedSa
|
|
|
122
119
|
}, [pinKey]);
|
|
123
120
|
// A failure is a notice of the chat: what it changes goes on without the list.
|
|
124
121
|
const pick = (_change) => onPicked();
|
|
125
|
-
|
|
126
|
-
// The bounds of the archive and of the fold move once a day.
|
|
127
|
-
const searching = !!query.trim();
|
|
128
|
-
const since = workbench_util_1.WorkbenchUtil.daysAgo(now, archiveDays);
|
|
129
|
-
const foldBefore = searching ? undefined : workbench_util_1.WorkbenchUtil.daysAgo(now, foldDays);
|
|
130
|
-
// Those an extension archives sooner (WebChatIcon.archiveDays), asked again as its icons change.
|
|
131
|
-
const icons = React.useContext(extension_view_1.ChatIcons);
|
|
132
|
-
const sooner = React.useMemo(() => chat_icon_1.ChatIconUtil.archiveSince(icons.entries, now), [icons, now]);
|
|
133
|
-
// Those an extension folds into a row of their folder (WebChatIcon.folder), asked again as its icons change.
|
|
134
|
-
const folderOf = React.useMemo(() => chat_icon_1.ChatIconUtil.folderOf(icons.entries), [icons]);
|
|
135
|
-
const partnerSessions = home === null || home === void 0 ? void 0 : home.partnerSessions; // The agents' conversations, listed once closed too.
|
|
136
|
-
const groupListed = React.useMemo(() => chat_list_util_1.ChatListUtil.groupListed(folderOf, partnerSessions), [folderOf, partnerSessions]);
|
|
137
|
-
// One that waits for the user is not archived, however old, as one pinned.
|
|
138
|
-
const kept = React.useMemo(() => chat_list_util_1.ChatListUtil.keptFiles([...saved, ...(archivedSaved !== null && archivedSaved !== void 0 ? archivedSaved : [])], pinned, letGo), [saved, archivedSaved, pinned, letGo]);
|
|
139
|
-
const { listed, archived, removed } = React.useMemo(() => chat_list_util_1.ChatListUtil.entries(sessions, saved, removedFiles, archivedSaved, since, kept, sooner, groupListed), [sessions, saved, removedFiles, archivedSaved, since, kept, sooner, groupListed]);
|
|
140
|
-
// A folder pinned holds its archived conversations too, and stays once they all are: a row pinned never goes away.
|
|
141
|
-
const { held, rest: archivedRest } = React.useMemo(() => chat_list_util_1.ChatListUtil.heldByPinned(archived, folderOf, pinned), [archived, folderOf, pinned]);
|
|
142
|
-
const sources = React.useMemo(() => chat_list_util_1.ChatListUtil.sources(listed), [listed]);
|
|
143
|
-
// The double's tasks: what waits for the user above the rest, those that are no conversation rows by their time.
|
|
144
|
-
const allTasks = home === null || home === void 0 ? void 0 : home.tasks;
|
|
145
|
-
const homeTasks = React.useMemo(() => (allTasks ? chat_home_util_1.ChatHomeUtil.tasks(allTasks) : undefined), [allTasks]);
|
|
146
|
-
// The rows extensions add to the double's list (a daily brief), and the conversations they stand for.
|
|
147
|
-
const allItems = home === null || home === void 0 ? void 0 : home.items;
|
|
148
|
-
const homeItems = React.useMemo(() => (allItems ? chat_home_util_1.ChatHomeUtil.items(allItems) : []), [allItems]);
|
|
149
|
-
const standIns = React.useMemo(() => chat_home_util_1.ChatHomeUtil.standIns(homeItems), [homeItems]);
|
|
150
|
-
// On the double's list its own conversation is its card, one that waits for the user is under the card, and one a
|
|
151
|
-
// row of the home stands for is that row.
|
|
152
|
-
const onHome = React.useCallback((entry) => !!homeTasks &&
|
|
153
|
-
((!!double && chat_list_util_1.ChatListUtil.isDouble(entry, double)) ||
|
|
154
|
-
homeTasks.hidden.has(chat_list_util_1.ChatListUtil.file(entry)) ||
|
|
155
|
-
standIns.has(chat_list_util_1.ChatListUtil.file(entry)) ||
|
|
156
|
-
(chat_list_util_1.ChatListUtil.isOpen(entry) && homeTasks.hidden.has(entry.sessionId))), [homeTasks, double, standIns]);
|
|
157
|
-
// A search finds the archived too.
|
|
158
|
-
const shown = React.useMemo(() => chat_list_util_1.ChatListUtil.filter(searching ? [...listed, ...archived] : listed, query, t).filter(entry => !onHome(entry)), [listed, archived, searching, query, t, onHome]);
|
|
159
|
-
// The conversation of a task (WebTask.session), by its file or the id of its session.
|
|
160
|
-
const byFile = React.useMemo(() => new Map(listed.flatMap(entry => [
|
|
161
|
-
[chat_list_util_1.ChatListUtil.file(entry), entry],
|
|
162
|
-
...(chat_list_util_1.ChatListUtil.isOpen(entry) ? [[entry.sessionId, entry]] : []),
|
|
163
|
-
])), [listed]);
|
|
164
|
-
// A task whose conversation the list does not have is a row of its own; those that ended before the archive's bound are archived.
|
|
165
|
-
const { listed: taskRows, archived: archivedTasks } = React.useMemo(() => chat_home_util_1.ChatHomeUtil.rows(homeTasks, allTasks, byFile, query, searching ? undefined : since, archived.map(chat_list_util_1.ChatListUtil.file), removedFiles), [homeTasks, allTasks, byFile, query, searching, since, archived, removedFiles]);
|
|
166
|
-
const shownRemoved = React.useMemo(() => chat_list_util_1.ChatListUtil.filter(removed, query, t), [removed, query, t]);
|
|
167
|
-
// Those pinned at the top, whatever their day or directory. Those that wait for the user to decide stay where they
|
|
168
|
-
// are, marked by a blue ?: the double's home gathers them (docs/design/ta-decide.md).
|
|
169
|
-
const apart = React.useMemo(() => chat_list_util_1.ChatListUtil.pinnedApart(shown, pinned), [shown, pinned]);
|
|
170
|
-
// Each folder one row where its latest is; those pinned or asking the user stay above, as any other.
|
|
171
|
-
const { folders: allFolders, rest } = React.useMemo(() => (searching ? { folders: [], rest: apart.rest } : chat_list_util_1.ChatListUtil.folders([...apart.rest, ...held], folderOf)), [apart.rest, held, folderOf, searching]);
|
|
172
|
-
// A folder pinned is a row of those pinned, as a conversation pinned; so is a row of the home.
|
|
173
|
-
const { pinned: pinnedFolders, rest: folders } = React.useMemo(() => chat_list_util_1.ChatListUtil.pinnedApart(allFolders, pinned), [allFolders, pinned]);
|
|
174
|
-
// With the conversations with partners that are none of pi (a chat of two, a group chat), by their time as any other.
|
|
175
|
-
const partners = home === null || home === void 0 ? void 0 : home.partners;
|
|
176
|
-
const homeRows = React.useMemo(() => chat_home_util_1.ChatHomeUtil.homeRows(homeItems, partners !== null && partners !== void 0 ? partners : [], query), [homeItems, partners, query]);
|
|
177
|
-
const { pinned: pinnedHome, rest: homeRest } = React.useMemo(() => chat_list_util_1.ChatListUtil.pinnedApart(homeRows, pinned), [homeRows, pinned]);
|
|
178
|
-
const pinnedRows = React.useMemo(() => chat_list_util_1.ChatListUtil.withFolders(apart.pinned, [...pinnedFolders, ...pinnedHome]), [apart.pinned, pinnedFolders, pinnedHome]);
|
|
179
|
-
(0, chat_list_hooks_1.useOfferPins)(listed, folderOf, homeItems);
|
|
122
|
+
const { searching, foldBefore, folderOf, partnerSessions, listed, archived, removed, held, archivedRest, sources, homeTasks, shown, byFile, taskRows, archivedTasks, shownRemoved, apart, rest, folders, homeRows, homeRest, pinnedRows, } = (0, chat_list_rows_1.useChatRows)({ sessions, saved, archived: archivedSaved, foldDays, archiveDays, pinned, letGo, home, double, removedFiles, now, query, t });
|
|
180
123
|
// The folder opened: all of it, those pinned too, as the search of the list finds them; one of the archive, its archived.
|
|
181
124
|
const folder = React.useMemo(() => folderShown
|
|
182
125
|
? chat_list_util_1.ChatListUtil.folders(folderShown.archived ? archivedRest : [...listed, ...held], folderOf).folders.find(candidate => candidate.key === folderShown.key)
|
|
@@ -215,53 +158,19 @@ function ChatList({ sessions, saved, removed: removedFiles, archived: archivedSa
|
|
|
215
158
|
return kept && drafts_protocol_1.DraftsUtil.preview(kept);
|
|
216
159
|
};
|
|
217
160
|
const item = (session, compact) => { var _a; var _b; return (React.createElement(chat_list_row_1.ChatItem, { key: chat_list_util_1.ChatListUtil.key(session), session: session, source: byKey.get(chat_list_util_1.ChatListUtil.sourceKey(session)), selected: chat_list_util_1.ChatListUtil.key(session) === selected, time: chat_list_util_1.ChatListUtil.clock(session.updatedAt, now), compact: compact, actions: actions, task: (_b = (chat_list_util_1.ChatListUtil.isOpen(session) ? double === null || double === void 0 ? void 0 : double.tasks.get(session.sessionId) : undefined)) !== null && _b !== void 0 ? _b : (session.sessionFile ? double === null || double === void 0 ? void 0 : double.tasks.get(session.sessionFile) : undefined), doubleName: double && chat_list_util_1.ChatListUtil.isDouble(session, double) ? double.name : undefined, handable: !!double && chat_list_util_1.ChatListUtil.isOpen(session) && !session.group && !double.tasks.has(session.sessionId) && !chat_list_util_1.ChatListUtil.isDouble(session, double), pinned: pinnedKeys.has(chat_list_util_1.ChatListUtil.file(session)), unseen: isUnseen(session), asking: (_a = chat_asks_1.ChatAskUtil.asking(session, letGo)) === null || _a === void 0 ? void 0 : _a.question, draft: draftOf(session) })); };
|
|
218
|
-
|
|
219
|
-
const inSight = () => (folder ? folderRows : [...apart.pinned, ...apart.rest]);
|
|
220
|
-
(0, use_screen_part_1.useScreenPart)({
|
|
221
|
-
id: 'chats',
|
|
161
|
+
(0, chat_list_hooks_1.useChatsScreen)({
|
|
222
162
|
title: folder ? folder.title : t('ta.chat'),
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
return { id: chat_list_util_1.ChatListUtil.file(entry), text: chat_list_util_1.ChatListUtil.title(entry, t), ...(marks.length ? { marks } : {}) };
|
|
235
|
-
}),
|
|
236
|
-
actions: {
|
|
237
|
-
open: {
|
|
238
|
-
label: t('ta.screen.open'),
|
|
239
|
-
each: true,
|
|
240
|
-
run: file => {
|
|
241
|
-
const entry = inSight().find(one => chat_list_util_1.ChatListUtil.file(one) === file);
|
|
242
|
-
if (entry) {
|
|
243
|
-
actions.open(entry);
|
|
244
|
-
}
|
|
245
|
-
},
|
|
246
|
-
},
|
|
247
|
-
pin: {
|
|
248
|
-
label: t('ta.chat.pin'),
|
|
249
|
-
each: true,
|
|
250
|
-
command: 'chats.pin',
|
|
251
|
-
commandInput: file => ({ file, pinned: true }),
|
|
252
|
-
run: file => pinKey(file !== null && file !== void 0 ? file : '', true),
|
|
253
|
-
},
|
|
254
|
-
unpin: {
|
|
255
|
-
label: t('ta.chat.unpin'),
|
|
256
|
-
each: true,
|
|
257
|
-
command: 'chats.pin',
|
|
258
|
-
commandInput: file => ({ file, pinned: false }),
|
|
259
|
-
run: file => pinKey(file !== null && file !== void 0 ? file : '', false),
|
|
260
|
-
},
|
|
261
|
-
stop: { label: t('ta.stop'), each: true, command: 'chats.stop', commandInput: file => ({ file }) },
|
|
262
|
-
search: { label: t('ta.chat.search'), takes: 'text', run: (_file, input) => { var _a; return setQuery(String((_a = input.text) !== null && _a !== void 0 ? _a : '')); } },
|
|
263
|
-
},
|
|
264
|
-
scroll: { more: () => ((folder ? folderBudget : budget).more ? 'bottom' : undefined) },
|
|
163
|
+
shown,
|
|
164
|
+
inSight: () => (folder ? folderRows : [...apart.pinned, ...apart.rest]),
|
|
165
|
+
letGo,
|
|
166
|
+
isUnseen,
|
|
167
|
+
pinned: pinnedKeys,
|
|
168
|
+
hasDraft: entry => !!draftOf(entry),
|
|
169
|
+
open: entry => actions.open(entry),
|
|
170
|
+
pinKey,
|
|
171
|
+
search: setQuery,
|
|
172
|
+
more: () => (folder ? folderBudget : budget).more,
|
|
173
|
+
t,
|
|
265
174
|
});
|
|
266
175
|
// Into a folder from the top of its list, and back where the list was left.
|
|
267
176
|
const listScroll = React.useRef(0);
|
|
@@ -327,87 +236,29 @@ function ChatList({ sessions, saved, removed: removedFiles, archived: archivedSa
|
|
|
327
236
|
}
|
|
328
237
|
});
|
|
329
238
|
// A toggle of what folds under a title: the older conversations, the archive, those taken out.
|
|
330
|
-
const toggle = (label, open, onClick, title) => (React.createElement(
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
// directory, a folder is a group as a directory is, where its latest is.
|
|
354
|
-
// By directory, the double's tasks that are no conversation are a group of their own, where the latest of them is.
|
|
355
|
-
const doubleRows = [...homeRest, ...taskRows].sort((a, b) => b.updatedAt - a.updatedAt);
|
|
356
|
-
const taskGroup = grouped &&
|
|
357
|
-
doubleRows.length > 0 &&
|
|
358
|
-
groupSection('tasks', React.createElement("div", { className: "ta-chat-group-head" },
|
|
359
|
-
React.createElement("button", { type: "button", className: "ta-chat-group-toggle", "aria-expanded": !folded.includes('tasks'), onClick: () => fold('tasks') },
|
|
360
|
-
React.createElement(ta_avatar_1.DinoFace, { size: 20, mood: "idle" }),
|
|
361
|
-
React.createElement("span", { className: "ta-chat-group-label" }, t('ta.home.tasks')),
|
|
362
|
-
React.createElement("span", { className: "ta-chat-group-count" }, doubleRows.length),
|
|
363
|
-
React.createElement(icon_1.Icon, { icon: lucide_react_1.ChevronRight, size: 13, className: "ta-chat-group-chevron" }))), doubleRows);
|
|
364
|
-
const list = grouped
|
|
365
|
-
? [
|
|
366
|
-
...(taskGroup ? [{ latest: doubleRows[0].updatedAt, group: undefined, folder: undefined, tasks: taskGroup }] : []),
|
|
367
|
-
...chat_list_util_1.ChatListUtil.groups(rest, sources).map(group => { var _a; var _b; return ({ latest: (_b = (_a = group.sessions[0]) === null || _a === void 0 ? void 0 : _a.updatedAt) !== null && _b !== void 0 ? _b : 0, group, folder: undefined }); }),
|
|
368
|
-
...folders.map(folder => ({ latest: folder.updatedAt, group: undefined, folder })),
|
|
369
|
-
]
|
|
370
|
-
.sort((a, b) => b.latest - a.latest)
|
|
371
|
-
.map(({ group, folder, tasks }) => {
|
|
372
|
-
if (tasks) {
|
|
373
|
-
return tasks;
|
|
374
|
-
}
|
|
375
|
-
if (folder) {
|
|
376
|
-
return groupSection(folder.key, React.createElement("div", { className: "ta-chat-group-head" },
|
|
377
|
-
React.createElement("button", { type: "button", className: "ta-chat-group-toggle", "aria-expanded": !folded.includes(folder.key), title: folder.title, onClick: () => fold(folder.key) },
|
|
378
|
-
React.createElement(chat_icon_1.ChatIconTile, { found: folder.icon, size: 20 }),
|
|
379
|
-
React.createElement("span", { className: "ta-chat-group-label" }, folder.title),
|
|
380
|
-
React.createElement("span", { className: "ta-chat-group-count" }, folder.sessions.length),
|
|
381
|
-
React.createElement(icon_1.Icon, { icon: lucide_react_1.ChevronRight, size: 13, className: "ta-chat-group-chevron" }))), folder.sessions);
|
|
382
|
-
}
|
|
383
|
-
const { source, sessions } = group;
|
|
384
|
-
return groupSection(source.key, React.createElement("div", { className: "ta-chat-group-head" },
|
|
385
|
-
React.createElement("button", { type: "button", className: "ta-chat-group-toggle", "aria-expanded": !folded.includes(source.key), title: source.title, onClick: () => fold(source.key) },
|
|
386
|
-
React.createElement("span", { className: `ta-chat-group-avatar ta-tone-${source.tone}`, "aria-hidden": "true" }, source.initial),
|
|
387
|
-
React.createElement(host_tag_1.HostTag, { host: source.host }),
|
|
388
|
-
React.createElement("span", { className: "ta-chat-group-label" }, source.label),
|
|
389
|
-
React.createElement("span", { className: "ta-chat-group-count" }, sessions.length),
|
|
390
|
-
React.createElement(icon_1.Icon, { icon: lucide_react_1.ChevronRight, size: 13, className: "ta-chat-group-chevron" })),
|
|
391
|
-
source.cwd && (React.createElement(icon_1.IconButton, { className: "ta-chat-group-add", icon: lucide_react_1.Plus, label: t('ta.chat.newIn', { name: source.label }), onClick: () => draftIn(source.cwd) }))), sessions);
|
|
392
|
-
})
|
|
393
|
-
: (() => {
|
|
394
|
-
const [recent, older] = chat_list_util_1.ChatListUtil.split(chat_list_util_1.ChatListUtil.withFolders(rest, [...folders, ...taskRows, ...homeRest]), foldBefore);
|
|
395
|
-
const sections = chat_list_util_1.ChatListUtil.sections(recent, now).map(section => {
|
|
396
|
-
const rows = budget.take(section.sessions);
|
|
397
|
-
return (rows.length > 0 && (React.createElement("section", { key: section.id, className: "ta-chat-section" },
|
|
398
|
-
React.createElement("div", { className: "ta-chat-section-title" }, t(section.id)),
|
|
399
|
-
React.createElement("ul", { className: "ta-side-list" }, rows.map(row => rowItem(row))))));
|
|
400
|
-
});
|
|
401
|
-
// Folded, the older still have the conversation shown and those unseen, drawn even before the rows above them are.
|
|
402
|
-
const cut = budget.more;
|
|
403
|
-
const olderRows = older.length > 0 ? budget.take(olderOpen ? older : older.filter(rowStays)) : [];
|
|
404
|
-
return [
|
|
405
|
-
...sections,
|
|
406
|
-
older.length > 0 && (!cut || olderRows.length > 0) && (React.createElement("section", { key: "older", className: "ta-chat-section ta-chat-older" },
|
|
407
|
-
toggle(t('ta.chat.olderCount', { days: foldDays, count: older.length }), olderOpen, () => setOlderOpen(!olderOpen)),
|
|
408
|
-
olderRows.length > 0 && React.createElement("ul", { className: "ta-side-list" }, olderRows.map(row => rowItem(row))))),
|
|
409
|
-
];
|
|
410
|
-
})();
|
|
239
|
+
const toggle = (label, open, onClick, title) => (React.createElement(chat_list_controls_1.ChatFoldToggle, { label: label, open: open, onClick: onClick, title: title }));
|
|
240
|
+
const list = (0, chat_list_sections_1.drawChatSections)({
|
|
241
|
+
grouped,
|
|
242
|
+
rest,
|
|
243
|
+
sources,
|
|
244
|
+
folders,
|
|
245
|
+
taskRows,
|
|
246
|
+
homeRest,
|
|
247
|
+
folded,
|
|
248
|
+
fold,
|
|
249
|
+
foldBefore,
|
|
250
|
+
foldDays,
|
|
251
|
+
groupsOlder,
|
|
252
|
+
setGroupsOlder,
|
|
253
|
+
olderOpen,
|
|
254
|
+
setOlderOpen,
|
|
255
|
+
budget,
|
|
256
|
+
rowStays,
|
|
257
|
+
rowItem,
|
|
258
|
+
draftIn,
|
|
259
|
+
now,
|
|
260
|
+
t,
|
|
261
|
+
});
|
|
411
262
|
// The archive, after the list once it is all drawn: read each time it opens, as it is not read with the list.
|
|
412
263
|
const archive = !searching && archiveShown && !budget.more && (React.createElement("section", { className: "ta-chat-section ta-chat-archive" },
|
|
413
264
|
toggle(archivedSaved ? t('ta.chat.archivedCount', { count: archivedRest.length + archivedTasks.length }) : t('ta.chat.archived'), archiveOpen, () => {
|
|
@@ -430,20 +281,7 @@ function ChatList({ sessions, saved, removed: removedFiles, archived: archivedSa
|
|
|
430
281
|
React.createElement("div", { className: "ta-chat-section-title" }, t(section.id)),
|
|
431
282
|
React.createElement("ul", { className: "ta-side-list" }, section.sessions.map(session => item(session)))))),
|
|
432
283
|
folderRows.length === 0 && React.createElement(empty_state_1.EmptyState, { title: t('ta.chat.noMatch') })));
|
|
433
|
-
|
|
434
|
-
const busyRows = React.useMemo(() => {
|
|
435
|
-
var _a;
|
|
436
|
-
if (!busy) {
|
|
437
|
-
return [];
|
|
438
|
-
}
|
|
439
|
-
const others = new Set([...((_a = double === null || double === void 0 ? void 0 : double.tasks.keys()) !== null && _a !== void 0 ? _a : []), double === null || double === void 0 ? void 0 : double.session, double === null || double === void 0 ? void 0 : double.sessionFile].filter((id) => !!id));
|
|
440
|
-
const going = chat_busy_1.ChatBusyUtil.list(sessions, saved, removedFiles, others, seen, letGo, entry => !!(folderOf === null || folderOf === void 0 ? void 0 : folderOf(entry))).entries.map(each => each.entry);
|
|
441
|
-
const kept = selected && !going.some(entry => chat_list_util_1.ChatListUtil.key(entry) === selected) ? listed.find(entry => chat_list_util_1.ChatListUtil.key(entry) === selected) : undefined;
|
|
442
|
-
const rows = kept ? [...going, kept] : going;
|
|
443
|
-
// Those that wait first, as the double's row counts them, not by when they last said something.
|
|
444
|
-
const found = new Set(chat_list_util_1.ChatListUtil.filter(rows, query, t));
|
|
445
|
-
return rows.filter(entry => found.has(entry));
|
|
446
|
-
}, [busy, double, sessions, saved, removedFiles, seen, letGo, folderOf, selected, listed, query, t]);
|
|
284
|
+
const busyRows = (0, chat_list_rows_1.useBusyRows)({ busy, double, sessions, saved, removedFiles, seen, letGo, folderOf, selected, listed, query, t });
|
|
447
285
|
const busyContent = (React.createElement(React.Fragment, null,
|
|
448
286
|
React.createElement("div", { className: "ta-chat-filter" },
|
|
449
287
|
React.createElement("button", { type: "button", className: "ta-chat-filter-chip", title: t('ta.chats.busyClear'), onClick: () => onBusy === null || onBusy === void 0 ? void 0 : onBusy(false) },
|
|
@@ -474,30 +312,19 @@ function ChatList({ sessions, saved, removed: removedFiles, archived: archivedSa
|
|
|
474
312
|
(0, chat_list_hooks_1.usePageEnd)(budget.more && !(folderOpen && !handheld), scroller, end, nextPage, pageKey);
|
|
475
313
|
(0, chat_list_hooks_1.usePageEnd)(!!folder && folderBudget.more, folderScroller, folderEnd, nextPage, pageKey);
|
|
476
314
|
(0, chat_list_hooks_1.useChatListMotion)(scroller, folderScroller);
|
|
477
|
-
const head = (React.createElement(
|
|
478
|
-
React.createElement("label", { className: "ta-chats-search" },
|
|
479
|
-
React.createElement(icon_1.Icon, { icon: lucide_react_1.Search, size: 15 }),
|
|
480
|
-
React.createElement("input", { value: query, placeholder: t('ta.chat.search'), "aria-label": t('ta.chat.search'), onChange: event => setQuery(event.target.value) }),
|
|
481
|
-
query ? (React.createElement(icon_1.IconButton, { className: "ta-chats-clear", icon: lucide_react_1.X, label: t('ta.close'), onClick: () => setQuery('') })) : (sources.length > 1 && (React.createElement(icon_1.IconButton, { className: "ta-chats-view", icon: lucide_react_1.FolderTree, label: t('ta.chat.byDirectory'), "aria-pressed": byDirectory, onClick: () => onByDirectory(!byDirectory) })))),
|
|
482
|
-
React.createElement(icon_1.IconButton, { className: "ta-chats-add", icon: lucide_react_1.Plus, label: t('ta.chat.new'), onClick: () => pick(chat.draft()) })));
|
|
315
|
+
const head = (React.createElement(chat_list_controls_1.ChatSearchHead, { query: query, onQuery: setQuery, byDirectory: sources.length > 1 ? byDirectory : undefined, onByDirectory: onByDirectory, onNew: () => pick(chat.draft()) }));
|
|
483
316
|
const listPane = (React.createElement("div", { className: "ta-side-scroll", ref: scroller },
|
|
484
317
|
listContent,
|
|
485
318
|
budget.more && React.createElement("div", { ref: end, className: "ta-chat-more", "aria-hidden": "true" })));
|
|
486
319
|
const folderPane = folder && (React.createElement(React.Fragment, null,
|
|
487
|
-
React.createElement(
|
|
488
|
-
React.createElement(icon_1.IconButton, { className: "ta-chat-folder-back", icon: lucide_react_1.ChevronLeft, label: t('ta.back'), onClick: closeFolder }),
|
|
489
|
-
React.createElement("span", { className: "ta-chat-folder-title" }, folder.title),
|
|
490
|
-
React.createElement("span", { className: "ta-chat-group-count" }, folder.sessions.length)),
|
|
320
|
+
React.createElement(chat_list_controls_1.ChatFolderHead, { title: folder.title, count: folder.sessions.length, onBack: closeFolder }),
|
|
491
321
|
React.createElement("div", { className: "ta-side-scroll", ref: folderScroller },
|
|
492
322
|
folderList,
|
|
493
323
|
folderBudget.more && React.createElement("div", { ref: folderEnd, className: "ta-chat-more", "aria-hidden": "true" }))));
|
|
494
|
-
// On a phone those going on are a page pushed over a tab (
|
|
324
|
+
// On a phone those going on are a page pushed over a tab (PhoneHome, phone-shell.tsx): its head, as a folder's, goes back.
|
|
495
325
|
if (busy && handheld) {
|
|
496
326
|
return (React.createElement("section", { className: "ta-chats", "aria-label": t('ta.chats.busy'), ...screen_protocol_1.ScreenUtil.part('chats') },
|
|
497
|
-
React.createElement(
|
|
498
|
-
React.createElement(icon_1.IconButton, { className: "ta-chat-folder-back", icon: lucide_react_1.ChevronLeft, label: t('ta.back'), onClick: () => onBusy === null || onBusy === void 0 ? void 0 : onBusy(false) }),
|
|
499
|
-
React.createElement("span", { className: "ta-chat-folder-title" }, t('ta.chats.busy')),
|
|
500
|
-
React.createElement("span", { className: "ta-chat-group-count" }, busyRows.length)),
|
|
327
|
+
React.createElement(chat_list_controls_1.ChatFolderHead, { title: t('ta.chats.busy'), count: busyRows.length, onBack: () => onBusy === null || onBusy === void 0 ? void 0 : onBusy(false) }),
|
|
501
328
|
notice,
|
|
502
329
|
React.createElement("div", { className: "ta-side-scroll", ref: scroller }, busyRows.length > 0 ? (React.createElement("ul", { className: "ta-side-list" }, busyRows.map(session => item(session)))) : (React.createElement(empty_state_1.EmptyState, { title: t('ta.chats.busyNone') })))));
|
|
503
330
|
}
|